In template tester the trigger value is true (so the last change is more than 600 seconds), and the ‘switch.schakelaar_printer’ shows idle (see screenshot).
I would suppose this is correct, but the automation does not trigger at all.
Manualy triggerd it does turn off the printer-switch.
I tried, but unfortunately it does not do what I hoped.
If for one or else reason within those 600 seconds HA restarts for one or else reason, the trigger fails. After a restart of HA the printer is in idle state for more than 10 minutes, but the automation does not trigger. I am looking for a kind of trigger ‘for more than’ in stead of ‘for’.
As Tom a;ready said: when HA starts and the printer is in idle state, the automation won’t trigger.
It does exactly what you originally asked for. Then you added another requirement involving a restart. No trigger survives a restart. In fact, neither does the value of a sensor’s last_changed property. On startup, it’s set to the current time and date.
You may wish to consider creating a Trigger-based Template Sensor that uses a State Trigger to monitor the printer’s state-changes (from/to idle) and reports the time difference (in seconds). Your automation can use a Template Trigger to detect when the value of the Trigger-based Template Sensor exceeds 600 seconds.
So the automation triggers if the device has been idle for 600 seconds (first state trigger), or if the automation has been reloaded (your second trigger), then make sure (with a state condition) the device has been idle for 600 seconds.
At startup, won’t the sensor’s last_changed be set to the startup time?
So when the automation is triggered at startup, the condition that checks if the sensor has been idle for 600 seconds can’t be true. Yet brinkgit has concluded this “Works great”.