With the new automation and script changes in 0.113 I am trying again to convert my YAML files to the UI. I have the following script courtesy of Dr. Zzs;
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?'
event_id:
description: 'Correlation ID for event responses'
example: 'ask_for_temperature'
alexa_device:
description: 'Alexa device you want to trigger'
example: 'media_player.study_dingus'
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.alexa_actionable_notification
value: '{"text": "{{ text }}", "event": "{{ event_id }}"}'
- service: media_player.play_media
data_template:
entity_id: "{{ alexa_device }}"
media_content_type: skill
media_content_id: amzn1.ask.skill.89ba8a0b-04b5-42a3-a80a-dfa2a76ecd10
Firstly, I don’t see a way in the UI to set the fields so I have just added that into the scripts.yaml file manually. But then when I try to add the input_text.set_value
and 'media_player.play_media` although the UI accepts them and the configuration check passes, when I try to run the script I get the following error;
Failed to call service script/activate_alexa_actionable_notification. extra keys not allowed @data['data_template']
Here is the section from scripts.yaml;
activate_alexa_actionable_notification:
alias: Activate Alexa Actionable Notification
mode: single
description: Activates an actionable notification on a specific echo device
fields:
alexa_device:
description: Alexa device you want to trigger
example: media_player.study_dingus
event_id:
description: Correlation ID for event responses
example: ask_for_temperature
text:
description: The text you would like alexa to speak.
example: What would you like the thermostat set to?
sequence:
- data:
data_template:
value: '{"text": "{{ text }}", "event": "{{ event_id }}"}'
entity_id: input_text.alexa_actionable_notification
service: input_text.set_value
- data:
data_template:
entity_id: '{{ alexa_device }}'
media_content_id: amzn1.ask.skill.89ba8a0b-04b5-42a3-a80a-dfa2a76ecd10
media_content_type: skill
service: media_player.play_media
Can someone please point out where I am going wrong here? I’ve tried shifting around the data/data_template to try and nest them but struggling to understand how to get the template/field for {{alexa_device}} to be recognised (I’m guessing this is where the error is rather than in the input_text.set_value section as that seems to make sense to me).