I love lifting weights/using machines at the gym but absolutely despise doing the exact same things at home alone (or at an empty gym for that matter).
There is something about being surrounded by others that also workout that really motivates me at the moment, gets me into the mood of working out and giving it my best.
Then, while lifting/using a machine, it becomes a game of how much i can manage today, how much have i progressed, how much i lift compared to some other random person. There is also thr good natural feeling you get while working out, and when i give it my all, i can really feel it.
I still heavily dislike cardio at the gym, such as using a treadmill. I try to turn it into a game though - manage to run exactly 1 kilometer in exactly 5 minutes etc. It somewhat helps for short runs.