WTH - Enable or Disable automations by group

I was just creating an automation (School holidays On/OFF) and it turns out i have to disable about 18 individual automations using a toggle. It would be amazing on the automations page, When you have a category, if there was a toggle for the category, and the Category could be added to an automation.

For example,

Trigger - Toggle helper.
Action - Automation - Turn off - “school term automations category”.

This would then turn off that entire group of automations.

I have seen a work around for making an entities card with a top toggle, but i don’t really want the full card showing, i’d just like the little simple button.

Quite cumbersome without this kind of feature for an On automation and an Off varient.

Why not use a label?

2 Likes

Have you got an example of how you would approach this? Would be great to know.

I’m already adding automations to specific groups by how they are used, so it just felt intuitive to have it there?

I can create a label, but when I try to create an automation and select label, and use a switch to Toggle, nothing shows up. But this also seems a bit redundant as it’s creating more work and just duplicating the group basically. As I add the automation to a category, but i’d have to add the same label created as the group name basically, then the automation still. Rather than just having a simple toggle on the group name that just turns them all on or off?

I had a quick look, it looks like you need to create a script also if I’m not mistaken to then create the toggle.

Also it would mean as i create more automations and such and they are just added to the group, that the automation would be constantly kept up to date :slight_smile: Without forgetting to add extra steps and labels.

Use home_assistant.turn_off or automation.turn_off. (Or toggle)

Or the service you posted above pointing to the label.

1 Like

So i tried the label one but nothing would show up earlier. It just showed blank. I’ve Just tried it a number of hours later and now shows up working, maybe a glitch or something, or delay adding it perhaps. I guess the label way would have advantages where if you have a group but only want specific ones related to that particular condition the label way may offer more control over entire groups.

Thanks both for drawing attention to this route! A real helper there! So very much appreciated.

1 Like

I am interested in this too. My use case would be a button to toggle all automations in the security category when I’m away.
So there’s no way to toggle automations on/off by their assigned category?

Can’t you just write a script to enable/disable the automations?

A simple group toggle would be a far easier lower skill user friendly option. Some wont know where to begin creating a script to do that. Also as you add new automations the same as labels you would have to assign them and update things.

Where as a group would automatically update by default for other automations and such that used it. Therefore less maintenance and tinkering with others and trying to keep things updated.

I have several automations that are a pain to add to and update so ive not done it. Would ha been great to auto update them etc

What is hard about adding labels and using the toggle tap action using the label?

I use the workday sensor in my automations.

Create a toggle/button, whatever helper that creates an input_boolean, then create a template sensor switch. Below is one that is toggled on when my TV is on a certain input. Just use it and disable the automations or group of automations. I have a split config so below is what is in my sensors yaml file. I believe you can paste it in when you create the helper now, it’s been a while. That or (see below). I use the below as a trigger to take a snapshot of my soundbar using a scene and setting the volume low while listening then another that restores the snapshot when it goes from listening to processing. If you create a binary sensor just change listening to on. I still copy/paste the code manually even though it can all be done in the UI when creating the helper…

Edit: So got curious about helpers and creating a toggle helper creates the switch for you. You used to have to do both. So just use it as a trigger in an automation and use the service mentioned above to turn off automations one by one or specify a group/label with the automations in it.

- platform: template
  sensors:
    sony_input_dune:
      value_template:  "{{ states('input_boolean.input_dune') }}"
      friendly_name: 'Sony Dune'        

    respeaker_listening_phase:
      value_template: >
        {% if is_state('assist_satellite.respeaker_assist_satellite', 'listening') %}
        listening
        {% else %} 
            no
        {% endif %}