Due to save energy (so popular topic in present time) I have decided to modify my automations script.
The hardware items are.
Two fans, one is blowing air into the bathroom, from the hall, the other one is fanning the air outside the home. Also, I have two humidity sensors. One located in the hall, next to the fan that pomps air the into the bathroom, the other one right next to the outflow fan in the bathroom.
The main concept is having a script that, based on the sensors readings, trigger both fans at the same time, then humidity hits 72%, or above.
Here is the trigger script that does the work.
alias: "Bathroom ON "
description: “”
trigger:
- platform: time_pattern
minutes: /5
condition:- condition: time
before: “22:00:00”
after: “06:00:00”
action:- choose:
- conditions:
- type: is_humidity
condition: device
device_id: bla_bla_bla
entity_id: sensor.hall_humidity
domain: sensor
above: 72
sequence:- type: turn_on
device_id: bla_bla_bla
entity_id: switch.bathroom_fan
domain: switch- type: turn_on
device_id: bla_bla_bla
entity_id: switch.hall_bath_fan
domain: switch
default:
mode: restart
The main question is how to get the reading from the bathroom sensor is let’s say 5% higher readings than the hall one trigger both fans, and turn them off, when the figure goes down below 5%, compare to the other one. As far as know, it is template conditions:
value_template: “{{ (‘sensor.hall_humidity’+‘5’ < ‘sensor.bathroom_humidity’) }}”
But I am not sure how to put it together.
Any help appreciated.