I have a good night trigger than runs when there is no motion for 60 minutes. It’s meant to be a failsafe, I usually trigger the routine with alexa. Anyway, when I restart HA, a few of my zigbee motion sensors report as ON until they actually detect a motion event. Most of the time this is not a big deal, but sometimes (like last night), I was up late working on HA, restarted and went to bed, so my group of motion sensors stayed on and never triggered the automation.
trigger:
- platform: state
entity_id: group.indoor_motion_sensors
from: 'on'
to: 'off'
for:
minutes: 60
I’ll say that if the state stayed on for a continous 60 minutes, it would be very safe to say it’s stuck and might as well be the same as being off. I have other conditions in place so that this only runs at night, etc.
So my question is, is there a way to have this run if the state does not change for 60 minutes as well?
I cannot use To: or From: in that trigger, since i believe it never “changed” it was just on from the start of my HA restart. Or maybe I can? Not sure if a state counts as changed when you restart HA?