Safety timer that isn't thrown off by brief periods of device becoming unavailable

Then I suggest you add an id to each trigger and use trigger.id to identify the trigger. Why? Because trigger.idx is position dependent and if you’re forgetful you might add the new trigger before the existing one.

BTW, at this point it’s a complete farce to label the second post as the Solution; I suggest you untag it to avoid misleading others. You’re not using a History Stats sensor for your application. Plus it wouldn’t care if your switch was unavailable for a moment or for several hours. It just reports the cumulative number of hours the switch is on. That’s wildly different from how a State Trigger’s for option behaves or your timer based automation.

It’d probably be good housekeeping to swish to id instead of idx. I’ll consider doing that. Not doing was mere lazyness.

Changed solution marker. I’ve often found great FAST solutions by reading the solution so it’s quite relevant to keep up to date. Thanks for reminding me.

1 Like