Well, I experienced exactly what you wrote in the text.
Home-office is good. But it might be a nightmare if you don’t have a social life outside work.
After I got my home-office job, I was really happy, as you did. But time went by and each day I was less able to work.
So my first though was: “Ok, maybe now I need a psychologist”. For me, it didn’t helped too much, so I asked my boss to be fired, because I thought I was being reckless at work because I’ve never really needed to try hard to stay in a job. But he didn’t. He said that this feeling is normal, that he already felt this way, and what I should do is to find something else to do with life, to not stay at home the whole time.
What I did: I went to Ireland to study English. I needed something different in my life, and it helped. I can’t say I’m 100% better, but at least now I enjoy working more than before.
Maybe you don’t need to go to another country, maybe just a sport, something that you interact with people might help. Normal humans are sociable animals, do not try to go against the nature.
Also, another thing that I did to give me more enthusiasm to work was to start using VIM as code editor as a challenge. It made the repetitive tasks more enjoyable, because I was learning something new.
Your brain needs new experiences, push yourself into something new. If you don’t have energy to do it alone, summon a friend, an ex-coworker to do with you.
Well, that’s my tips for you. Good luck :)