Hello guys.
I made a scene in SmartLife app for turning on my ac unit thru Tuya Smart IR.
I then created an automation on HA with my Sonoff zigbee Temp/Humidity sensor linked to the scene on SmartLife app.
It looks like this:
id: ‘xxxxxxxxxxxx’
alias: Ar condicionado Verão
description: ‘’
trigger:
- type: temperature
platform: device
device_id: xxxxxxxxxxxxxx
entity_id: sensor.tybf137143d2bbc1920bmgdk_2
domain: sensor
above: 26
condition:
action:
- scene: scene.ligar_ar_condicionado_frio
mode: single
When i run the action it does work. But the automation itself does not.
I made another automation with my Covers the same way and it work’s fine.
Any thoughts on this?
Thanks
State trigger only triggered when it crosses your threshold.
In your case, it must start below your threshold (example: 25) to above your threshold (example: 27).
Also, if your run the action manually, it skips the trigger as well as the condition - and just run the action part of the automation.
In addition, you can use numeric_state
trigger like below-
trigger:
- platform: numeric_state
entity_id: sensor.tybf137143d2bbc1920bmgdk_2
above: '26'
condition: []
action:
- service: scene.turn_on
target:
entity_id: scene.ligar_ar_condicionado_frio
Using numeric_state
will give you more convenience whenever you decide to change your device (Temperature sensor) rather than by using device_id
as you will need to re edit your automation to match the new device’s device_id
.