I have 2 Xiaomi Aqara Humidity sensors installed in 2 bathrooms and I am trying to configure it to trigger via relative humidity. Right now, I can get readings from each and my Nest thermostat. What I am trying to accomplish is to have the bathroom fans turn on when the humidity delta exceeds certain threshold, and turn off once it returns to a normalized range.
The config I have right now, which doesn’t seem to work at all.
- alias: Turn on Master Bathroom Fan
initial_state: on
trigger:
- platform: numeric_state
entity_id: sensor.humidity_158d0002c8ed66
value_template: ‘{{ sensor.humidity_158d0002c8ed66 - sensor.nest_thermostat_humidity }}’
above: 20
action:
service: light.turn_on
entity_id: light.master_bath_fan
- alias: Turn off Master Bathroom Fan
initial_state: on
trigger:
platform: state
entity_id: light.master_bath_fan
to: 'on'
for:
minutes: 15
condition:
- condition: numeric_state
entity_id: sensor.humidity_158d0002c8ed66
value_template: '{{ sensor.humidity_158d0002c8ed66 - sensor.nest_thermostat_humidity }}'
below: 10
action:
service: light.turn_off
entity_id: light.master_bath_fan
- alias: Turn on Shared Bathroom Fan
initial_state: on
trigger:
- platform: numeric_state
entity_id: sensor.humidity_158d0002c9d057
value_template: '{{ sensor.humidity_158d0002c9d057 - sensor.nest_thermostat_humidity }}'
above: 20
action:
service: light.turn_on
entity_id: light.shared_bath_fan
- alias: Turn off Shared Bathroom Fan
initial_state: on
trigger:
platform: state
entity_id: light.shared_bath_fan
to: 'on'
for:
minutes: 15
condition:
- condition: numeric_state
entity_id: sensor.humidity_158d0002c9d057
value_template: '{{ sensor.humidity_158d0002c9d057 - sensor.nest_thermostat_humidity }}'
below: 10
action:
service: light.turn_off
entity_id: light.shared_bath_fan