Hello, I recently successfully added a Sonoff relay to my ventialtion system and I can now trigger extractor fan when either 2 bathrooms or kitchen humidity goes over a certain level (70% for bathrooms and 60% for kitchen) and turn off if all three are below the set humidity level OR if time is after 10PM or before 6AM (basically ventilation should never be triggered between 10PM and 6AM)
Originally I’ve made 3 automations, for each bathroom and the kitchen plus another 3 automations to turn ventialtion off based on the humidity of the 3 rooms and a another automation to turn off after 10PM, for a total of 7 automations…
I then realised I can definetely simplify that, am I correct in understanding that each trigger in the automation is considered on its own?
Here my 2 automation for ventilation ON and ventilation OFF:
or if you prefer review the code:
ventilation on
alias: "ventilation ON "
description: ""
trigger:
- type: humidity
platform: device
device_id: d73d7f1649feea66f53982dd61375073
entity_id: sensor.ewelink_th01_humidity
domain: sensor
above: 70
for:
hours: 0
minutes: 2
seconds: 0
- type: humidity
platform: device
device_id: 25891d20773080b4421a11cfb9206287
entity_id: sensor.ewelink_th01_humidity_2
domain: sensor
above: 70
for:
hours: 0
minutes: 2
seconds: 0
- type: humidity
platform: device
device_id: c8e55a0f409ec513df09f947c4a0a36f
entity_id: sensor.kitchen_living_humidity
domain: sensor
above: 60
for:
hours: 0
minutes: 2
seconds: 0
condition:
- condition: time
after: "06:00:00"
before: "22:00:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
action:
- type: turn_on
device_id: 4a48b1e85cfbe115b01a2bbf6b700c1a
entity_id: light.sonoff_01minizb_light
domain: light
mode: single
ventilation off
alias: ventilation OFF
description: ""
trigger:
- type: humidity
platform: device
device_id: 25891d20773080b4421a11cfb9206287
entity_id: sensor.ewelink_th01_humidity_2
domain: sensor
below: 70
for:
hours: 0
minutes: 2
seconds: 0
- type: humidity
platform: device
device_id: d73d7f1649feea66f53982dd61375073
entity_id: sensor.ewelink_th01_humidity
domain: sensor
below: 70
- type: humidity
platform: device
device_id: c8e55a0f409ec513df09f947c4a0a36f
entity_id: sensor.kitchen_living_humidity
domain: sensor
below: 60
- platform: time
at: "22:00:01"
condition:
- condition: and
conditions:
- type: is_temperature
condition: device
device_id: 25891d20773080b4421a11cfb9206287
entity_id: sensor.ewelink_th01_temperature_2
domain: sensor
below: 70
- type: is_temperature
condition: device
device_id: d73d7f1649feea66f53982dd61375073
entity_id: sensor.ewelink_th01_temperature
domain: sensor
below: 70
- type: is_humidity
condition: device
device_id: c8e55a0f409ec513df09f947c4a0a36f
entity_id: sensor.kitchen_living_humidity
domain: sensor
below: 60
- condition: or
conditions:
- condition: time
after: "22:00:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
before: "06:00:00"
action:
- type: turn_off
device_id: 4a48b1e85cfbe115b01a2bbf6b700c1a
entity_id: light.sonoff_01minizb_light
domain: light
mode: single