Automation trigger not firing trying to trigger off a stale timestamp

Hey there everyone! I’ve tried a few different permutations of this but I can’t seem to get the automation to fire. I want to trigger an automation when the last seen value from zwavejsui doesn’t update in over 60 seconds. I’ve tried using a numeric state trigger as well as a template trigger, and neither of them start the automation. I’ve tested it in dev tools and I can see the state change there, but the automation doesn’t fire. Appreciate any assistance I can get! Running 2025.6.3.

Here’s the template trigger:

trigger: template
value_template: >-
  {{ (now() - states('sensor.master_bedroom_heater_last_seen')|as_datetime) >
  timedelta(seconds=60) }}
id: plugs offline
enabled: true

And here’s the numeric state trigger:

trigger: numeric_state
entity_id:
  - sensor.basement_freezer_last_seen
  - sensor.kitchen_fridge_last_seen
  - sensor.master_bedroom_heater_last_seen
above: 60
id: plugs offline
value_template: "{{ now()|as_timestamp - state.state|as_timestamp }}"
enabled: true

If the state is a unique value like a datetime string of when the device was last seen, and it normally refreshes more often than once a minute, why not just use an open State trigger with a duration?

trigger: state
entity_id:
  - sensor.basement_freezer_last_seen
  - sensor.kitchen_fridge_last_seen
  - sensor.master_bedroom_heater_last_seen
not_to:
  - unavailable
for: "00:01:00"
1 Like

Hey that did the trick! My mind did not even go there, great thinking!!