Im trying to create an automation that will turn off the bathroom light lights but keep on the light over the toilet on if the light level is low. Also to turn off the extractor fan if the humidity is below a level of 64.
But have realised that the 2 conditions only work if the first one is true, it then continues to the next condition (the extractor fan). If this is during the day when the light level is above 70, then that condition returns false and the second condition is ignored, living the extractor on.
I also tried:
- entity_id: light.toilet
service_template: >
{% if states.sensor.outside_light_level.state | int < 70 %}
light.turn_on
brightness_pct: '1'
{% endif %}
- entity_id: switch.bath_extractor
service_template: >
{% if state.sensor.humidity_bathroom.state | int < 64 %}
switch.turn_off
{% endif %}
but that didn’t work so Im stuck for ideas now, can anyone help or advise me here. Thank you.
Thank you for your prompt help @pnbruckner . I don’t know a lot about yaml but was wondering if anchors and aliases can be used in the trigger section to save on repeat typing.
Oh wow, thank you, I spent the afternoon trying different ways to solve this with anchors and aliases, and you do it that quick. Thats very good of you.