Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Last active February 1, 2021 22:35
Show Gist options
  • Save Didgeridrew/cde4e9e86ff955276196082c91985dad to your computer and use it in GitHub Desktop.
Save Didgeridrew/cde4e9e86ff955276196082c91985dad to your computer and use it in GitHub Desktop.
# This is my variation of Alexa Media Player Broadcasting with a custom card
# (https://github.com/custom-components/alexa_media_player/wiki/Examples:-Broadcasting-with-a-custom-card)
# which requires Steve Rollason's text input row card (https://github.com/gadgetchnnel/lovelace-text-input-row)
#AUTOMATION
alias: Alexa Command
description: Allows interactive tts to alexa via input_text
trigger:
- platform: state
entity_id: input_text.cmd_text
- platform: state
entity_id: input_number.alexa_volume
action:
- service: media_player.volume_set
data_template:
entity_id: 'media_player.{{states.input_select.alexa_state.state}}'
volume_level: '{{states.input_number.alexa_volume.state}}'
- service: media_player.play_media
data:
entity_id: 'media_player.{{states.input_select.alexa_state.state}}'
media_content_id: '{{states.input_text.cmd_text.state}}'
media_content_type: custom
- service: input_text.set_value
data:
entity_id: input_text.cmd_text
value: ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment