>>1015885 (OP)
Motivation does not just come to you. You feel motivation by doing things, not by wishing for inspiration to take over you.
The hardest part is starting while continuing is much easier. If you can force yourself to start to do something, then you require much less effort to continue. The 2 minute rule, or whatever it is called, could be useful to you.
If you find it difficult to be consistent and continue, then you're not categorizing and organizing your tasks properly. The solution is to break a task, or feature, into independent measureable steps; this way when you've sunk 5 hours into something, you can see the actual progress you've made. If you don't, then you'll just be thinking to yourself, "I've sunk 5 hours into this and made some more additions but I'm nowhere close to being done". Todo lists or task managers should not list the overall task or program alone, but instead include rational subtasks that allow you to reflect upon your progress.