I love problem solving. There are few things I find as satisfying in software development as finding a creative solution to a complex problem.
Because of this I've also kind of become “that guy who fixes the tricky stuff” around the office. I'm the guy who gets to do work on weird hardware, or who gets to do complex things like doing highly optimised image processing.
I think that this is great, this is what keeps me motivated. I can't really imagine just sitting around “grinding away” at the same boring things over and over without having productivity dropping through the floor.
This lead me to think about what constitutes a boring task. What is it that makes something boring? Can we avoid something being boring?
I would say that boring tasks are generally doing things that are mostly the same over and over again. Things like building the 20th similar UI application do not sound quite as exciting as integrating with hardware where you have the only prototype in the world.
I would say that a first step is to consider what is the “best” solution in every situation. This can lead you to finding fun challenges in solving something even if you've done it before. If you can see what is unique in every project you'll quickly notice the unique nuances.
The second is to make sure you've built good, re-usable code so you can focus on just the unique parts of each project. If you can automate away the more “boring” parts you won't be bored as quickly. Figuring out how to automate parts can also be a fun challenge.
Variation is also key. If you only have the same tasks to do over and over again then try to hack together something fun inbetween projects. If your employer is good they will most likely encourage this provided it doesn't hurt deadlines or productivity.
In short, there are many ways to combat boredom. The big one being figuring out ways to make all projects more interesting.