I have a circuit that I want to turn on for 5 seconds then turn off. 10 seconds later I want to turn another circuit on for 5 seconds then off. But, I want to be able to chose whether that 2nd circuit is turned on based on toggling a second automation on or off.
So, I have two automations set up.
- id: '1535300995148'
alias: Automation1
trigger:
- at: '11:32'
platform: time
condition: []
action:
- data:
entity_id: switch.sonoff_4ch_pro__r1_channel
service: switch.turn_on
- delay: 5
- data:
entity_id: switch.sonoff_4ch_pro__r1_channel
service: switch.turn_off
- delay: '10'
- data:
entity_id: automation.Automation2
service: automation.trigger
- id: '1535301295580'
alias: Automation2
trigger:
- platform: template
value_template: '9999'
condition:
action:
- data:
entity_id: switch.sonoff_4ch_pro__r3_channel
service: switch.turn_on
- delay: '5'
- data:
entity_id: switch.sonoff_4ch_pro__r3_channel
service: switch.turn_off
I’m just using a time trigger for automation1 while testing. I added a blank template trigger to automation2 because without a trigger it would automatically toggle off.
The automations run as intended, but toggling automation2 off in the HA control panel does not stop it from running. I even tried adding a condition to automation2 that would only allow it to run if automation2 was toggled on. That didn’t work. Is there a good way around this?