Get Alexa trigger for automations

Hey folks!

I want to trigger an automation only if the command is comming from Alexa.
Here is what I see in the Logs:

I want to trigger an automation that fires, if that light entity is set only by an Alexa command.

Is that possible?

Thansk in advance!!

Check whether the event was triggered by your Alexa user_id.

This is the event

event_type: alexa_smart_home
data:
  request:
    namespace: Alexa.PowerController
    name: TurnOff
    entity_id: media_player.tv
  response:
    namespace: Alexa
    name: Response
origin: LOCAL
time_fired: "2023-02-13T18:32:01.006989+00:00"
context:
  id: 01GS60RM7CWF1NKV6D4R4M3E4M
  parent_id: null
  user_id: xxxx8b6cxxxx4369xxxx59bcxxxxbd09

This is the automation

description: "Executed by Alexa"
mode: single
trigger:
  - platform: event
    event_type: alexa_smart_home
    event_data:
      request:
        namespace: Alexa.PowerController
    context:
      user_id:
        - xxxx8b6cxxxx4369xxxx59bcxxxxbd09
condition: []
action:
  - service: notify.wesley
    data:
      message: Executed by Alexa
1 Like

Thank you so much!!