Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Last active December 29, 2020 16:23
Show Gist options
  • Save Didgeridrew/3c140b6620824835a7fbe9a0bd892544 to your computer and use it in GitHub Desktop.
Save Didgeridrew/3c140b6620824835a7fbe9a0bd892544 to your computer and use it in GitHub Desktop.
Scripts for use to create Alexa Console in Home Assistant
send_alexa_command:
alias: Send Alexa command
sequence:
- service: media_player.play_media
data_template:
entity_id: 'media_player.{{ states("sensor.alexa_selector") }}'
media_content_id: "{{ states('input_text.cmd_text') }}"
media_content_type: custom
send_alexa_annoucement:
alias: Send Alexa Announcement
sequence:
- service: notify.alexa_media
data:
data:
type: announce
target:
- 'media_player.{{ states("sensor.alexa_selector") }}'
message: "{{ states('input_text.announcement_text') }}"
stop_alexa_command:
alias: STOP Alexa command
sequence:
- service: media_player.play_media
data_template:
entity_id: 'media_player.{{ states("sensor.alexa_selector") }}'
media_content_id: "stop"
media_content_type: custom
@Didgeridrew
Copy link
Author

Didgeridrew commented Dec 24, 2020

For new HA/Alexa Media Player users: To use this script you will need to create 3 helpers (input_text.announcement_text, input_text.cmd_text, and input_select.alexa_state). The input_select needs to include either the location (room) or some other identifier for each Alexa device you want to use. You will then need to add those detail to the following template sensor:
https://gist.github.com/Didgeridrew/2e37eb631bd357117f1b0d1464be0777 .

This is not my original creation, but I can not find where I got it... if anyone knows the source please let me know so I can give credit where it is due.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment