Trigger automation when Alexa is activated

I’m thinking of putting an Alexa device in each of my kids rooms for alarm clocks, but I don’t want them talking to it when it’s time for bed.

Is there anyway for me to activate a HA automation when someone says Alexa? Can I limit it to the two specific devices?

I don’t think there any way to do this, I’ve looked into the past.

They have a freetime option you can look into.

https://parents.amazon.com/

I have my kids echos set to DND mode at bedtime. I also have automations that automatically reduce their echos volume to 0 overnight.

Thank you I’ll look into the DND option.

@ThisBytes5 @popboxgun This is an older thread, but I have been able to trigger based on when Alexa is activated. My trigger and conditions are below. The idea is to check to see if the last_called_timestamp attribute has changed. The spacing might be off because I copied/pasted and took out a bunch of stuff that wouldn’t be of interest to you.

  trigger:
    - platform: state
      entity_id: media_player.kid_s_echo_dot

  condition:
    - condition: template
      value_template: '{{ trigger.to_state.attributes.last_called_timestamp | float > trigger.from_state.attributes.last_called_timestamp | float }}'   # Alexa has been triggered

And now, I have a question for you (or anyone who might be able to help!): I really want to be able to completely disable my kid’s Alexa if he’s in timeout, but I haven’t found a good way to do it. I have tried DND mode, and setting the volume to 0. But he’s smart enough to get around that. Freetime has the Bedtime setting that allows you to disable it during a range of hours. Does anyone know if/how this can be set through HA?

I have an automation that auto lowers the volume of media_players when the kids turn it up loud. You can set an input_boolean in the condition or as the trigger then have it adjust the volume.

- alias: Volume control
  trigger:
  - platform: state
    entity_id: 
      - media_player.echo1
      - media_player.echo2
  condition:
    - condition: template
      value_template: "{{ trigger.to_state.attributes.volume_level | float > 0.61 }}"
    - condition: template
      value_template: "{{ trigger.to_state.attributes.volume_level is defined }}"
    - condition: template
      value_template: "{{ trigger.to_state.attributes.volume_level is not none }}"
    - condition: template
      value_template: "{{ trigger.to_state.state != 'unavailable' }}"      
  action:
    - service: media_player.volume_set
      data_template:
        entity_id: '{{ trigger.entity_id }}'
        volume_level: 0.60

This is the only reason I am holding onto my pi running openHAB. It’s Alexa add on had a last voice command so you can see what was asked.

I use this for a few automations. I just have openHAB send a mqtt message any time the last voice command is changed.