I'm so sorry you're finding it hard at the moment. I hope things improve. 
One of my favourite quotes is, "Most people in this world are about as happy as they have made up their minds to be." (Lincoln)
However, while that's a wonderful mantra to live your life by, it's not that simple really.
I am known for being an extremely positive person. It is rare for me to be down, even though I've had some dramatic hard times. I think the hardest crosses to bear are not the full-on dramas, but the death of a thousand cuts.
The lowest I've been was not when I because homeless, or when my relationship fell apart, or when my parents died. It was when I coped for a number of years living in poverty with constant money worries, chronic sleep deprivation and no time to myself. Nothing major happened, but there was just no joy in my life. I was not depressed, but I wasn't happy. Fortunately, it passed, and getting through it has actually made me happier now as I am able to appreciate so much more in life than I did before.
I think physical health has a huge impact on mental health, so I'm not surprised that you're feeling low mentally when your health is poor. I wish you all the best in finding a way to manage that and hopefully even improve it.
For me, real happiness comes from looking in the mirror and liking the person I see (and I don't mean in appearance since I'm pretty ordinary). I behave in a way I am proud to let others see and I treat all people the way I would like to be treated myself. I have survived and thrived under difficulties that have set others back. I have set myself goals and achieved them. Some small, such as washing the sofa covers on my next rest day, some as significant as a career change.
Chuffin I think you should congratulate yourself on the fact that you've managed to work despite your health problems and that you've shown the resilience to persevere in your dream to be a mum despite fertility problems. It may have cost you a happy marriage, but you're surviving that too. You're a coper. That's something to be proud of.
As an aside, I once read that the best way to improve self-esteem was to do that - set goals and achieve them - that this is way more effective than just telling yourself you deserve better or that you're a good person. The act of doing changes the mindset far more than positive affirmation. And I think if you truly believe you are worth more, you push for more - and in employment situations it is often the squeaky wheel that gets the opportunities and sometimes you have to put yourself out there and make supervisors uncomfortable about ignoring you rather than relying on them to respond as they should to your obvious ability.