i have absolute no idea where to start, but this is what i need:
If a Switch was turned on 6 hours ago and the state was NOT off during the same (every other state needs to be ignored, even unavaiable because its a battery zigbee device) it should be automatically tuned off. This should avoid to keep water running in my garden for longer then 6 hours, which happens from time2time
Create a helper timer. The use the below automation. This will start the timer when switched on, cancel it if switched off and turn off the water switch when 6 hours has elapsed after switch on. You may need to tweak a bit but should do what you want.
Does it still work when I restart HomeAssistant? The main problem is, that a lots of automations getting canceled:(
Due to not being native speaker, I don’t understand the docs:
Timers will be restored to their correct state and time on Home Assistant startup and restarts when configured with the restore option.
However, automations using the timer.finished event will not trigger if the timer expires when Home Assistant is not running.