Configuration: Events - alandtse/alexa_media_player GitHub Wiki
Minimum Version: 2.9.0
Events
The component will provide the following events:
-
alexa_media_relogin_required- (>= 3.0.0) The component has detected a need to relogin. This may be useful to detect when services will stop working because the cookies have expired. It will return two values:email- The accounturl- The Amazon url
DEPRECATION WARNING: This was previously
alexa_media_player/relogin_requiredbut was deprecated in the 3.0.0 since the HA UI does not allow testing of events with/.alexa_media_player_relogin_requiredwas also deprecated in 3.0.0. Please switch your automations over. -
alexa_media_relogin_success- (>= 3.0.0) The component has successfully relogged in. It will return two values:email- The accounturl- The Amazon url
DEPRECATION WARNING:
alexa_media_player_relogin_successwas deprecated in 3.0.0. Please switch your automations over. -
alexa_media_notification_event- (>= 3.2) An Amazon notification (Timer/Alarm/Reminder) has triggered. It will return two values:email- The accountevent- The notification json that triggered the event. The event should be queried to determine the type.
-
alexa_media_alarm_dismissal_event- (>= 3.10) An Amazon alarm has been dismissed. It will return two values:device- The serial number of the Echo device.event- The notification json that triggered the event. The event can be queried to determine more details.
-
alexa_media_last_called_event- An Echo device became the "last called" device, i.e. the one that most recently received a voice command. It will return five values:last_called- The serial number of the Echo device.name- The name of the Echo device.timestamp- The time of the command in milliseconds.summary- What Alexa understood, e.g.add bread to the shopping list.response- Alexa's spoken response, orNoneif there is none.
If several commands are spoken within a few seconds, only the newest one is reported. Use
alexa_media_voice_commandbelow if you need every command. -
alexa_media_voice_command- (>= 5.18.0) A voice command was spoken to an Echo. One event is fired for every new voice command in the Alexa history, oldest first, and each command is reported only once. Use it instead oflast_calledwhen several commands can be spoken within a few seconds (e.g. adding multiple items to a shopping list), becauselast_calledonly reports the newest command of such a burst. It will return five values:serial- The serial number of the Echo device.timestamp- The time of the command in milliseconds (creationTimestampof the Alexa history record).summary- What Alexa understood, e.g.add bread to the shopping list.response- Alexa's spoken response, ornullif there is none.entity_id- Themedia_playerentity of the Echo, ornullif it is unknown.
Notes:
- The serial is called
serialhere, unlikelast_calledinalexa_media_last_called_event. - The event relies on the push connection (HTTP2). When the state is only refreshed by polling, commands are not reported by this event.
- A command can arrive late if Amazon's history does not contain it yet when the push is processed. It is then fired with a later probe, without duplicates. Use
timestampif the order matters. - Commands from before Home Assistant started are not replayed.
Example automation:
automation: - alias: "Log voice commands" trigger: - platform: event event_type: alexa_media_voice_command action: - service: persistent_notification.create data: title: "{{ trigger.event.data.entity_id }}" message: "{{ trigger.event.data.summary }}"
Automations
Please see Automations Page