I'm not sure if you'll find this helpful, but I hope so.
I really struggled to stay on track many times. The lure of food was too much for me to take and I would just give in and eat, which really only made me more miserable.
What helped me was to eliminate foods from my diet that I couldn't manage without going overboard. I realized that all those foods had two ingredients: sugar and flour. It was incredibly difficult for me to take those out of my life. I felt like I was losing a best friend. But now, I'm a new woman. I am so much more in control than I was before.
Another thing I do is eat my meals at set times and only have one snack which is the same few things in rotation. For example, I'll have a greek yogurt with blueberries or I'll have a hard boiled egg and a hand full of pistachios. I also try not to eat anything too exciting because that will set me off.
Finally, I try to move around a lot. I do exercise but maybe only two or three times a week if I'm lucky. But I walk the dog every day and I park far from my destinations and take stairs, etc.
As TheSkinnyProject said, motivation isn't always there to be found. It's more about commitment and finding whatever you can do that will work with your lifestyle and that you can live with for the rest of your life.
I really hope you'll find a way and I send you many, many hugs.