Switch to turn all automations off

What I would like to achieve is to have a switch on my front end which allows me to deactivate all automations at once. I know that I can simply add a single automation to the front end and it should appear as switch (and possibly group.all_automations as well). But what I try to achieve is an inverse switch, once the switch is on, the automations should be off.

I tried the following which works in terms of correctly showing the state of group.all_automations but I cannot interact with it: Once I switch it on, it quickly goes back to the off state.

switch:
  - platform: template
    switches:
      all_automations:
        friendly_name: Disable automation
        value_template: "{{ is_state('group.all_automations', 'off') }}"
        turn_on:
          entity_id: group.all_automations
          service: homeassistant.turn_on
        turn_off:
          entity_id: group.all_automations
          service: homeassistant.turn_off

Any inputs on what I am doing wrong?

I thought you wanted it so when the switch was on, the automations were off? If so, your turn_on and turn_off actions are the wrong way round.

Thanks a lot, what a silly mistake from my side.

1 Like

I set this up (with the correction noted), but the switch does nothing. I turn it on, it stays on for a few seconds, then it turns off.

That is because this

does not exist anymore for over a year. (since 0.104)

2 Likes