WTH Timers reseted for automation when I restart HA

I have a boiler, I set and automation to stop it after two hours of runing, if HA in restarted during that runing period the boiler is never shutted of.

platform: state
entity_id:
  - switch.boiler
to: "on"
for:
  hours: 2
  minutes: 0
  seconds: 0

Those triggers should be relaeded at startup to avoid this kind of annoyance

Use timers instead, they survive restarts

There is another WTH about the delay feature resetting, but it’s essentially the same issue and the same workarounds apply:

You should be aware, it’s not just if Home Assistant restarts, it’s also if you edit any automation. Basically any action that causes Home Assistant to reload all the automations.

Thanks for the tip, but using helper is not an optimized workflow from my point of view