Trigger when state does not change

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?

for: requires to: while the doc’s don’t explicitly say that in the verbiage, I think it’s implied in one of the examples. So, I think your only ‘quick’ option would be to just build 2 triggers, one for ‘on’ and one for ‘off’ in the to section. Your group should only be on or off so you don’t have too many triggers to create. You could build a timer script that gets reset on state changes but that might be more work than you want. If that’s something you’re interested in I can post some examples in the morning.