My sonoff zigbee thermostat not triggering

Hi I have set up an automation on my zigbee thermostat:

I know the action works as i can click the run now button and it sends me a message. The thermostat is working as i can see the temperature and the temp changes are accurate:

The image if it does not display currently records at 13.5 C ( i have put it in the attic to force the temp drop).

The automation does not trigger…there is no activity being recorded. Can anyone please help?

YAML:

alias: Arjans Room Tempreture Monitor
description: ""
triggers:
  - type: temperature
    device_id: ce4aa4aa4ead3d8469cdd98b080db328
    entity_id: sensor.ewelink_snzb_02p_temperature
    domain: sensor
    trigger: device
    id: Arjans-Temp
    above: 24
    below: 21
    for:
      hours: 0
      minutes: 0
      seconds: 30
conditions: []
actions:
  - device_id: 67fa680d64e282dc4e66ba721df90c10
    domain: mobile_app
    type: notify
    message: Arjans temp has changed
    title: Arjans temp has changed
  - device_id: 6b081902c38bb228390e3832cc789257
    domain: mobile_app
    type: notify
    message: Arjans temp has changed
    title: Arjans temp has changed
mode: single

Please format your code correctly using the code button </>

A few pointers try using state instead of device, with the temp as a condition.
This will only trigger when the temp goes from above 21 to below 21 or below 24 to above 24.

This is really what the generic thermostat is for and you will find it far easier.

Hi, thanks for replying :slight_smile:

I was looking at the generic thermostat but it looks like it needs to be hooked up with actuator switch for heating / cooling. I agree this does look far better and on the forums this seems to be the best way forward. If you can help me on getting around this i am happy to use it.

I only need HA to message me if the temp is outside of the tolerances so i dont want to trigger any actuator actions

Just use a helper for that. I did it for my thermostats as they do not “switch” anything but i control an OT device for that (and that doesnt even switch, just tells setpoints)
Settings → Devices and Services → Helpers → Create Helper → Toggle

I can’t tell fully if that automation is right because you need to fix the formatting. but make sure this is not what you are running into.
Trigger only happens when the value passes thru their on / off thresholds,

Thanks so much for all this

I have had a play with the state and it seems to be the way to go. Unfortunately my daughter has took the thermostats off the wall and has put them in her play room somewhere as biscuits for her tea party. Until I find them I cant test anything but i will try it out once I find them.
Thanks guys!

ok i ended up just changing the numeric state in developer tools and it has pinged me! so i think i am good now.

thanks everyone for your help!

PS i formatted the code as requested

new code is here:

alias: Test
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.ewelink_snzb_02p_temperature_2
    for:
      hours: 0
      minutes: 1
      seconds: 0
    below: 21
conditions: []
actions:
  - device_id: 67fa680d64e282dc4e66ba721df90c10
    domain: mobile_app
    type: notify
    message: Arjans temp has changed 123
    title: Arjans temp has changed 123
mode: single