Stage changed automation not working

I have a simple automation like this which should alert when this state hasn’t changed in 1 min (for testing purposes, will be longer once confirmed working)

alias: Shaper TEST
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.openevse_shaper_power
    for:
      hours: 0
      minutes: 1
      seconds: 0
conditions: []
actions:
  - action: persistent_notification.create
    metadata: {}
    data:
      message: Testing shaper
mode: single

However it does nothing and I am pretty sure it should work, state is stuck for 2 days:
image

What’s wrong with the automation?

you need to add “to” to your trigger

alias: Shaper TEST
description: ""
triggers:
  - trigger: state
    to:
    entity_id:
      - sensor.openevse_shaper_power
    for:
      hours: 0
      minutes: 1
      seconds: 0
conditions: []
actions:
  - action: persistent_notification.create
    metadata: {}
    data:
      message: Testing shaper
mode: single

Didn’t work either.
Also tried:
image
But I suppose the state isn’t changing at all so maybe nothing to trigger it?

Hi

If you want it to trigger in any state change, The for: seems an odd choice. I have not tried it so I cannot guarantee it will work set-up like that. without the to: is fine without the for:, I use that all the time.

Also if you want to know if the trigger entity change state, look in developer tools at the state and look at it over the time period.

A State Trigger will trigger when there’s a state-change.

In your example, the State Trigger has the following additional requirement: after the state-change occurs the new value must remain unchanged for at least a minute. Only then will it trigger.

Based on the chart you posted, the sensor’s value hasn’t experienced a state-change recently so that’s why the State Trigger hasn’t triggered recently.

Correct but it also never triggered recently after it stopped updating.
I wish HA had a LAST UPDATE value for every single sensor, would make it perfect for situations like these.

If it ceased updating then that State Trigger won’t trigger. It doesn’t detect the absence of activity.