I have these two automation that I want to combine or maybe there is a completely different way of implementing this, any pointers or guidance would be great.
I have seen a few posts regarding combining two automations, but I haven’t been able to figure out how to adapt them to what I need.
alias: Air Circulation Fan On
description: >-
If Workshop 3 RH is greater than Workshop 2 RH by 0.5% or more, turn on Air
Circulation Fan
trigger:
- platform: template
value_template: >-
{% set workshop2_rh = states('sensor.h5100_5e5f_humidity')|float %} {% set
workshop3_rh = states('sensor.h5100_3536_humidity')|float %} {% set
difference = workshop3_rh - workshop2_rh %} {{ difference >= 0.5 }}
for:
minutes: 5
condition:
- condition: state
entity_id: switch.tbp_switch_4570
state: "off"
action:
- service: switch.turn_on
data: {}
target:
entity_id: switch.tbp_switch_4570
mode: single
alias: Air Circulation Fan Off
description: >-
If Workshop 3 RH is less than or equal to Workshop 2 RH by 0.5% or more, turn
off Air Circulation Fan
trigger:
- platform: template
value_template: >-
{% set workshop2_rh = states('sensor.h5100_5e5f_humidity')|float %} {% set
workshop3_rh = states('sensor.h5100_3536_humidity')|float %} {% set
difference = workshop3_rh - workshop2_rh %} {{ difference <= 0.5 }}
for:
minutes: 5
condition:
- condition: state
entity_id: switch.tbp_switch_4570
state: "on"
action:
- service: switch.turn_off
data: {}
target:
entity_id: switch.tbp_switch_4570
mode: single