Use Alexa Voice Command to Disable/Enable HA Automation

Hi.

I have HA automations to turn on and off my Hallway Light depending on a Hue Motion Sensor. How would I be able to create a voice command for Alexa to disable and renable this HA automation?

Thanks

You could create a helper button to toggle that automation. Then, expose the helper to Alexa. Name it something like “Hallway Toggle”, so you can tell Alexa to turn on or off that toggle.

1 Like

I believe if you expose the automation to Alexa you should be able to tell it to turn off/on the automation.

1 Like

That’s how I have it set up:

A bunch of input booleans that correspond to room automations:


Then a single automation that does all the automation switch flipping:

alias: Automation Controls
description: ''
trigger:
  - platform: state
    entity_id: input_boolean.dining_room_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.dining_room_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.living_room_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.living_room_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.media_room_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.media_room_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.kitchen_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.kitchen_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.front_entryway_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.front_entryway_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.bedroom_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.bedroom_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.bedroom_2_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.bedroom_2_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.downstairs_bathroom_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.downstairs_bathroom_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.den_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.den_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.2nd_floor_bathroom_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.2nd_floor_bathroom_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.all_automations
    to: 'on'
  - platform: state
    entity_id: input_boolean.all_automations
    to: 'off'
  - platform: state
    entity_id: input_boolean.ring_announcements
    to: 'on'
  - platform: state
    entity_id: input_boolean.ring_announcements
    to: 'off'
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.dining_room_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            target:
              entity_id:
                - automation.dining_room_accent_lights_auto_on
            data: {}
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_dining_room_accent_lights
                - switch.adaptive_lighting_dining_room_house_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.dining_room_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            target:
              entity_id:
                - automation.dining_room_accent_lights_auto_on
            data: {}
          - service: switch.turn_off
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_dining_room_accent_lights
                - switch.adaptive_lighting_dining_room_house_lights
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.living_room_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.living_room_accent_lights_auto_on_2
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_living_room_accent_lights
                - switch.adaptive_lighting_living_room_house_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.living_room_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.living_room_accent_lights_auto_on_2
          - service: switch.turn_off
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_living_room_accent_lights
                - switch.adaptive_lighting_living_room_house_lights
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.kitchen_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.kitchen_accent_lamps_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_kitchen_accent_lights
                - switch.adaptive_lighting_kitchen_house_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.kitchen_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.kitchen_accent_lamps_auto_on
          - service: switch.turn_off
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_kitchen_accent_lights
                - switch.adaptive_lighting_kitchen_house_lights
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.media_room_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.media_room_accent_lights_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_media_room_house_lights
                - switch.adaptive_lighting_media_room_accent_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.media_room_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.media_room_accent_lights_auto_on
          - service: switch.turn_off
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_media_room_accent_lights
                - switch.adaptive_lighting_media_room_house_lights
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.front_entryway_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.front_entryway_accent_lights_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_downstairs_accent_lights
                - switch.adaptive_lighting_downstairs_house_lights
                - switch.adaptive_lighting_spotlights
      - conditions:
          - condition: state
            entity_id: input_boolean.front_entryway_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.front_entryway_accent_lights_auto_on
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.2nd_floor_bathroom_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.2nd_floor_bathroom_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.adaptive_lighting_misc_house_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.2nd_floor_bathroom_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.2nd_floor_bathroom_auto_on
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.stairway_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.stairway_lights_auto_on_off
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.adaptive_lighting_misc_house_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.stairway_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.stairway_lights_auto_on_off
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.laundry_room_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.laundry_room_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.adaptive_lighting_misc_house_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.laundry_room_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.laundry_room_auto_on
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.bedroom_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id:
                - automation.bedroom_1_accent_lights_auto_on
                - automation.office_accent_lights_auto_on
                - automation.bathroom_1_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_bedroom_house_lights
                - switch.adaptive_lighting_bedroom_accent_lights
          - service: media_player.media_stop
            data: {}
            target:
              device_id:
                - 209e5cd089075c9f5714db83ed70bf30
                - 782214079897c40cfc06c457b559de46
          - service: media_player.play_media
            data:
              media_content_id: set bedroom air filter to auto
              media_content_type: routine
            target:
              device_id: 235e82eb53b31541086c290d32f56f28
          - delay:
              hours: 0
              minutes: 0
              seconds: 8
              milliseconds: 0
          - service: media_player.play_media
            data:
              media_content_id: set office air filter to auto
              media_content_type: routine
            target:
              device_id: 235e82eb53b31541086c290d32f56f28
      - conditions:
          - condition: state
            entity_id: input_boolean.bedroom_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id:
                - automation.bedroom_1_accent_lights_auto_on
                - automation.office_accent_lights_auto_on
                - automation.bathroom_1_auto_on
          - service: switch.turn_off
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_bedroom_accent_lights
                - switch.adaptive_lighting_bedroom_house_lights
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.bedroom_2_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id:
                - automation.bedroom_2_accent_lights_auto_on
                - automation.bathroom_2_accent_lights_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_bedroom_2_accent_lights
                - switch.adaptive_lighting_bedroom_2_house_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.bedroom_2_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id:
                - automation.bedroom_2_accent_lights_auto_on
                - automation.bathroom_2_accent_lights_auto_on
          - service: switch.turn_off
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_bedroom_2_accent_lights
                - switch.adaptive_lighting_bedroom_2_house_lights
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.garage_entryway_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.garage_entryway_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_downstairs_accent_lights
                - switch.adaptive_lighting_downstairs_house_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.garage_entryway_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data:
              stop_actions: true
            target:
              entity_id: automation.garage_entryway_auto_on
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.downstairs_bathroom_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.downstairs_bathroom_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.adaptive_lighting_downstairs_house_lights
                - switch.adaptive_lighting_downstairs_accent_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.downstairs_bathroom_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.downstairs_bathroom_auto_on
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.den_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.den_auto_on
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.adaptive_lighting_downstairs_accent_lights
      - conditions:
          - condition: state
            entity_id: input_boolean.den_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.den_auto_on
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.garage_automations
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id: automation.garage_auto_on
      - conditions:
          - condition: state
            entity_id: input_boolean.garage_automations
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id: automation.garage_auto_on
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.all_automations
            state: 'on'
            for:
              hours: 0
              minutes: 0
              seconds: 0
        sequence: []
      - conditions:
          - condition: state
            entity_id: input_boolean.all_automations
            state: 'off'
            for:
              hours: 0
              minutes: 0
              seconds: 0
        sequence:
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id:
                - input_boolean.laundry_room_automations
                - input_boolean.bedroom_2_automations
                - input_boolean.bedroom_automations
                - input_boolean.media_room_automations
                - input_boolean.dining_room_automations
                - input_boolean.kitchen_automations
                - input_boolean.living_room_automations
                - input_boolean.stairway_automations
                - input_boolean.2nd_floor_bathroom_automations
                - input_boolean.front_entryway_automations
                - input_boolean.garage_entryway_automations
                - input_boolean.garage_automations
                - input_boolean.den_automations
                - input_boolean.downstairs_bathroom_automations
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.ring_announcements
            state: 'on'
        sequence:
          - service: automation.turn_on
            data: {}
            target:
              entity_id:
                - automation.announcement_front_door
                - automation.announcement_garage_door
                - automation.announcement_sliding_glass_door
                - automation.announcement_interior_garage_door
      - conditions:
          - condition: state
            entity_id: input_boolean.ring_announcements
            state: 'off'
        sequence:
          - service: automation.turn_off
            data: {}
            target:
              entity_id:
                - automation.announcement_front_door
                - automation.announcement_garage_door
                - automation.announcement_interior_garage_door
                - automation.announcement_sliding_glass_door
    default: []
mode: parallel
max: 50

On my Dashboard, I have all of them turned into buttons to where I can turn on/off automations if I want and easily see which automations are on/off:

I have a button that will kill all automations, a button that runs a script that kills certain automations when the cleaners are here, and another button that runs a script to basically turn all those automations back on when they leave. This is all possible from the above automation control that I provided (because all everything is doing is just flipping the input boolean).

When you expose these input booleans to alexa, you can tell her to turn off Bedroom automations and she will do that (by flipping the boolean).

With the new groups functionality, if HA would allow us to group the automation switches, we could remove all this man in the middle nonsense. I submitted a feature request: Group Automations with Switch (please vote) that would allow you to group automation controls which would have the built in benefit of creating a switch for automations and allowing you to control them via alexa without having to go through all the above nonsense.

Oh and it’s instantaneous. When I was on ST and Webcore, I had to give it a sec to disable a bunch of automations. I can tell alexa to disable a rooms automations as I am walking in the room and they wont fire. They still all turn on/off instantly even when flipping dozens of automation switches at the same time.

1 Like

What about creating a helper and use that as a condition to run the automation(s), or not?

1 Like

Thanks. That’s really helpful. Thanks to your replies I’ve managed to achieve my goal.