I have a Tuya Multiprise connected through Zigbee to hassio. It also has physical buttons to switch on/off each independent socket.
I wired a fan to socket 1, and wrote an Template automation to turn it on whenever the humidity is too high (I’ve got an Mijia sensor).
My issue is that sometimes when I turn off socket 1 manually (press the switch), and when the condition is satisfied to trigger the automation, the automation does not fire.
How can I investigate what’s going wrong? With the latest update, I can see the trace when the trigger is fired and debug, but I can’t check when the trigger condition is satisfied but it’s not triggered.
Can someone help me? I’ve included my automation below:
alias: Turn the Fan On
description: >-
Turn on the fan in the room whenever the humidity OR the temperature are too high
trigger:
- platform: template
value_template: >-
{% if states.sensor.room_temperature.state | float > 35 %} true {%
endif %}
- platform: template
value_template: >-
{% if states.sensor.room_humidity.state | float > 70 %} true {% endif
%}
condition: []
action:
- type: turn_on
device_id: c28
entity_id: switch.0x001234_l1
domain: switch
mode: single
So if I turn off the switch manually (humidity is 75), and few minutes later the humidity hits 90 (value increases), the switch does not turn on. Does my template condition always need to go from below 70 to above 70 or does it mean that anytime the change above 70 happens the action is executed?