Create switch to manage automations

This is prob super simple, only I can’t find it anywhere.

I simply want to create a switch in the HASS gui that allows me to turn on/off automations.
Eg. I’ve made a couple of vacation automations (turning lights on and off, changing temperatures etc.) and I want to turn them on with a switch.

Do I have to use a template switch for this or is there something simpler?

look at an input Boolean.

I have one called Vacation_mode and then those automations have a condition that says it must be on to run.

Just put then in a group and you are done :-).

You can group your automations:

group:
  sys_automations:
    name: Automations & Scripts
    control: hidden
    entities:
      - automation.kodi_home
      - automation.mcp_test_motion_04

And if you want to get really fancy, set up a config page and a input_select dropdown box to “filter” by groups of options. This uses an automation that hides and shows groups.

1 Like

Can you share config for this?

First you’ll need to group your input_booleans and switches etc into their own group. Add all the groups into a config group that is a view.

Next, create an input_select with your options.

Finally, here’s the automation. Add a new action for every group of options:

  - alias: "Config Dropdown"
    initial_state: on
    trigger:
      - platform: state
        entity_id: input_select.config
      - platform: homeassistant
        event: start
    action:
      - service: group.set_visibility
        entity_id: group.speech_options
        data_template:
          visible: >
            {% if is_state("input_select.config", "Speech") or is_state("input_select.config", "Guest Mode") %}true{% else %}false{% endif %}
      - service: group.set_visibility
        entity_id: group.guest_mode_options
        data_template:
          visible: >
            {% if is_state("input_select.config", "Guest Mode") %}true{% else %}false{% endif %}
      - service: group.set_visibility
        entity_id: group.calendar_options
        data_template:
          visible: >
            {% if is_state("input_select.config", "Calendar") %}true{% else %}false{% endif %}
2 Likes