Temperature change trigger is not firing

I’m new to HA and got my Aqara temp and humidity sensor connected using a Zigbee Zonoff dongle and the Zigbee Home Automation integration. I can see the temperature changing on the graph, but when I tried to create a trigger based on the the temp changing, nothing happens. This is the yaml:

alias: Test temp change notif
description: “”
triggers:

  • type: temperature
    device_id: fdd4bb1c5263a2c02e110cc4696dc684
    entity_id: 93bce935d4d342f623fb4b820c7bd1b4
    domain: sensor
    trigger: device
    above: 1
    below: 146
    conditions:
    actions:
  • action: notify.mobile_app_pixel_6_pro
    metadata: {}
    data:
    message: test temp changed
    title: temp changed
    mode: single

I’ve attached an image of what it looks like setting it up visually.

I manually ran the action and I got the notification.

Any ideas?

For a Numeric State trigger (or a Device trigger based on numeric state in this case) to fire, the threshold values must be crossed… just being in the range will not fire the trigger. So for your example, the temperature value has to change from either below 1 to above 1 or from above 146 to below 146. All the value changes between 1-146 have zero effect as far as the trigger is concerned.

Thanks for the reply! So is there a way to perform an action every time the temperature changes regardless of what the value is? Another option I can think of is just to have it run every 10 minutes, but temperature change seems cleaner.

Did you read the whole bit that was linked to? The last paragraphs go into that: You can, but you should not need to and the downsides are worse than the upsides.

1 Like

Yes, use a State trigger:

trigger: state
entity_id: sensor.EXAMPLE

If you prefer the UI Editor, “State” can be found in the “Entity” section of the “Add Trigger” configuration flow popup, or via the search bar:

Be forewarned, you will very likely need to include multiple conditions to avoid being spammed by notifications.

1 Like

I’m so sorry, I completely missed that part. Thank you!

Don’t worry you are not the only one, it is probably the most asked question here.