Skip to content

Commit

Permalink
HA Script Selectors (#193)
Browse files Browse the repository at this point in the history
* Update configuration.yaml

Adds selectors for Home Assistant UI functionality when calling the script in an automation.

* Update configuration.yaml

Adds in selectors to utilise UI features when calling the script
  • Loading branch information
dwoosnam authored Jul 7, 2023
1 parent a1be7c5 commit 7492427
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions home-assistant/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,49 @@ script:
alias: activate_alexa_actionable_notification
description: Activates an actionable notification on a specific echo device
fields:
text:
description: The text you would like alexa to speak.
example: 'What would you like the thermostat set to?'
message:
name: Message
description: The content of the message that you want to be announced.
required: true
example: "Would you like the heating turned off?"
selector:
text:
type: text
multiline: false
event_id:
name: Event ID
description: Correlation ID for event responses
example: 'ask_for_temperature'
required: true
example: "ask_for_temperature"
selector:
text:
type: text
multiline: false
alexa_device:
name: Alexa Device
description: Alexa device you want to trigger
example: 'media_player.bedroom_echo'
required: true
example: "media_player.bedroom_echo"
selector:
entity:
filter:
- integration: alexa_media
domain: media_player
suppress_confirmation:
name: Suppress Confirmation
description: Set true if you want to suppress 'okay' confirmation
example: 'true'
required: true
example: "true"
selector:
boolean: null
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.alexa_actionable_notification
value: '{"text": "{{ text }}", "event": "{{ event_id }}", "suppress_confirmation": "{{ suppress_confirmation }}"}'
value: '{"text": "{{ message }}", "event": "{{ event_id }}", "suppress_confirmation": "{{ suppress_confirmation }}"}'
- service: media_player.play_media
data_template:
entity_id: "{{ alexa_device }}"
media_content_type: skill
media_content_id: <Your Skill ID>
mode: single
mode: single

0 comments on commit 7492427

Please sign in to comment.