Trigger automation on stale sensor value

Is there a way to trigger an automation if the value of a sensor has been stale for e.g. 30 minutes ?

The sensor is updated every minute - but I need to be able to send a notification if the content/value doesn’t change for 30 minutes…

trigger:
  - platform: state
    entity_id: sensor.foobar
    to:
    for:
      minutes: 30
1 Like

Will this method work if the sensor reports the same exact value for more than 30 minutes? Does it rely on the actual value changing, or does it use the underlying last_updated/last_reported metadata?

I am struggling to figure out how to invalidate values from sensors that stop updating. The default behavior seems to just preserve the last reported value even if it’s, say, 3 days old, which makes it really difficult to handle sensor outages reasonably. Thanks!

Why do they stop updating?

It’s a State Trigger so the value must first change to something else then remain at that new value for at least 30 minutes in order to cause it to trigger.

1 Like

Power outage, equipment failure, sabotage…

Ah! Evil doers… Understood. :grin: