Nice tutorial! You used a date time helper. I did something similar using a timer helper instead.
You set the timer for your duration, then every time you turn on/off the boiler you ‘reset’ the timer. You can then have a trigger in your automation for when the timer reaches zero. Same solution but without the need to work with templates and other ‘codish’ things.