Hey Everyone, not sure why this simple automation is giving me so much trouble. I just want this fan to turn on when the room is above 60, and turn off when it is above 62. Any help would be greatly appreciated
thanks for helping me through this, doesnt seem like it’s as simple as I thought. That automation still isnt working, but it could be because my yaml indentation is off. Is the format of the code you wrote designed to be copy and pasted into File Editor directly?
when i plug it into HA automations yaml I get:
Message malformed: Unable to determine action @ data[‘action’][0][‘then’][0]
All the merits to @finity who came with the solution first.
But basically you have two triggers, the first one for when the temperature is below your helper. Note this trigger has an Id named fan_off.
The other trigger test for the temperature above the other helper. Note this trigger doesn’t have an id, although it would work the same if you had a different id.
Then in the actions it tests if the automation was triggered by the trigger with Id fan_off and, if this is the case, it calls the service switch.turn_off to turn off your fan, otherwise (else) it will call the switch.turn_on service.
This was working last night, but stopped responding today. Think It could have something to do with the fact I’m trying to integrate an Ecowitt sensor with a Kasa smart plug? Should I convert them both over to mqtt?
Which one is not working properly? The sensor or the switch? What is the problem?
Maybe you should create another topic specifically for the sensor or the switch becoming unavailable.
i believe the problem is with either the automation, or my helpers. I hooked up a binary switch as the trigger and relay works fine. I also tried out this automation, bypassing my helpers and it seems to work fine
alias: cure room fan on
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.cureroom_ecotemp
above: 61
condition: []
action:
- type: turn_on
device_id: 78293e8e119adfc3be273c2be92cc798
entity_id: switch.cure_room_fan
domain: switch
mode: single
alias: cure room fan off
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.cureroom_ecotemp
below: 60
condition: []
action:
- type: turn_off
device_id: 78293e8e119adfc3be273c2be92cc798
entity_id: switch.cure_room_fan
domain: switch
mode: single