I think I’m not seeing the wood for the trees with merging two automations into one.
I am using two automations for switching some AC units to OFF in the morning depending on whether it is a working day/school day or whether it is holidays or weekends.
As two separate automations, one for work days/school days and another automation for switching the AC units to OFF on holidays/weekends this is working perfectly for years now.
Now I want these two automations mergend into one but it seems I am missing something: The merged two automations simply don’t trigger. The “trace” is showing me that at step “choose” the automation simply jumps to the end without actually doing the “choosing”:
Here comes my latest try which is also simply refusing to fire correctly at the given times. The template editor reports no error (today is Sunday, AC in state “Cool”) and also activating the automations renders no errors. It simply doesn’t fire.
trigger:
- platform: time
at:
- '05:00:02'
id: "school_days"
- platform: time
at:
- '07:00:02'
id: "holidays"
action:
- choose:
- conditions:
- condition: trigger
id: "school_days"
- condition: template
value_template: >
{{ is_state('calendar.kalender_local', 'off') }} or {{
is_state('binary_sensor.workday_sensor', 'on') }} and {{
is_state('climate.master_bedroom_ac', 'cool') }}
sequence:
- service: climate.set_temperature
target:
entity_id: climate.master_bedroom_ac
data:
temperature: 25
- service: climate.set_fan_mode
target:
entity_id: climate.master_bedroom_ac
data:
fan_mode: auto
- delay:
seconds: 1
- service: climate.turn_off
target:
entity_id: climate.master_bedroom_ac
- conditions:
- condition: trigger
id: "holidays"
- condition: template
value_template: >
{{ is_state('calendar.kalender_local', 'on') }} or {{
is_state('binary_sensor.workday_sensor', 'off') }} and {{
is_state('climate.master_bedroom_ac', 'cool') }}
sequence:
- service: climate.set_temperature
target:
entity_id: climate.master_bedroom_ac
data:
temperature: 25
- service: climate.set_fan_mode
target:
entity_id: climate.master_bedroom_ac
data:
fan_mode: auto
- delay:
seconds: 1
- service: climate.turn_off
target:
entity_id: climate.master_bedroom_ac
mode: single
Where did I went wrong here?