The upper part triggers - the fan comes on when the humidity goes over 85%, but, it refuses to trigger when it drops below 84% - my sensor is surrently sitting at 83%.
alias: Bathroom fan on when Humidity over 85
description: Comes on over 85%
trigger:
- type: humidity
platform: device
device_id: 977bf22057c0a364dc6b5b89497c9b38
entity_id: sensor.humidity_sensor_humidity
domain: sensor
above: 85
id: Humidity over 85
- type: humidity
platform: device
device_id: 977bf22057c0a364dc6b5b89497c9b38
entity_id: sensor.humidity_sensor_humidity
domain: sensor
id: Humidity below 84
below: 84
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: Humidity over 85
sequence:
- type: turn_on
device_id: 19ceffb4c4de58d18c09816c2c4d92cf
entity_id: fan.bathroom_extractor_fan
domain: fan
- conditions:
- condition: trigger
id: Humidity below 84
sequence:
- type: turn_off
device_id: 19ceffb4c4de58d18c09816c2c4d92cf
entity_id: switch.bathroom_extractor_fan
domain: switch
mode: single
If I view it in the visual edit (whihc I created it in) and “test” Option 2 under actions, it says “Condition did not pass” - why is this? when I can see on the device that humidity is at 83%
Is it a fan or switch…? In one option you use domain: switch and the other domain: fan.
Your conditions are trigger-based. These cannot be tested with the condition testing tool in the Automation editor because the trigger.id is undefined.
Triggers are event-based… "sitting at 83%" is not an event. The automation needs to be properly configured and enabled at the time the humidity goes from “above 83%” to “below 83%”. It is the event of crossing that threshold that actually triggers the automation.
Ahh I see, thanks. I changed the low threshold number (%) after the event hence it wasn’t “triggered” then . I understand your point about passing “though/past the trigger”.
It’s a physical z-wave switch controlling a fan. I’ve used the helper to make it a “fan”. Not sure why there is an inconsistency. I did initially create the action as calling a service “switch turn on”, and then selected the target device as the fan switch - all in the UI/GUI, which didn’t work (following a tutorial) , so changed it to calling the specific device , device_turn_on. I didnt understant why you’d call a “switch_on” service, then choose the device?
Both actions test OK and switch it on and off, when tested manually (run)
Good to know the test won’t work on this config. Was confusing me.
Edit - I’ve changed the option 2 to fan.bathroom_extractor_fan from switch.bathroom_extractor_fan, and the entity to fan (from switch) , and it still works the same.
Really no idea how one was a switch entity and one a fan.