Help setting up alexa tts card

Paste the following into the TEmplate Editor tools then you can copy the output into the template sensor.

{% for a in integration_entities('alexa_media')|select('match', 'media_player.') %}
{{ states[a].attributes.friendly_name}}:  {{ a }},
{%- endfor %}

Make sure the device names match what’s in your Input select.

I’m pretty sure there is, but I’ve never bothered since I mostly use a browser when I’m editing stuff.

1 Like

sorry, where am i copying the top text to? i dont think ive seen/ heard of that yet?

In Developer Tools there’s a Tab called “Template” which lets you access a tool to test templates that you are building.

1 Like

image
is this sutable?

No… there should be entity names not the word Entity.

It worked on my instance, but maybe try:

{% for a in integration_entities('alexa_media')
|select('match', 'media_player.') if states[a].attributes.source  %}
"{{ states[a]['name']}}": "{{ a }}",
{%- endfor %}

EDIT: Added double quotes

1 Like


oh yea im stupid i havre to do the top ones

hows this?
image

You need quotes around the names and entity ids, make sure to use " since you have apostrophes in some of the names:

"Brian's echo dot.": "media_player.brian_s_echo_dot",
1 Like

image
soooo like this then?

Yep. I don’t know if it counts as a big enough change or not, but since this is your first template sensor, you probably should do a restart.

1 Like

i just did funnily enough wanted to add the other devices to the card dropdown so added the others and restarted t so hopefully they will work properly

I just realized that you need to remove media_player. from the second-to-last line of the template sensor. It should look like:

{{ echo_select.get(room) }} instead of media_player.{{ echo_select.get(room) }}

1 Like

image
just like this?

note: after the reset still getting the script not found error

1 Like

anything i should do next?

Go to the States tab of Developer Tools and search for send_alexa_announcement.

If the script is there, but its entity ID isn’t script.send_alexa_announcement:

  • Click on the circle-i/information button to the left of the script’s name, click the settings menu/gear button at the top right of the popup, type or paste the correct value in the Entity ID field. Click the “Update” button.

If the script is found and its entity ID matches:

  • Open the script in the script editor, click the 3-dot menu on the top right and select “Edit in YAML”, copy/paste what you have there into a the forum, highlight the whole thing then press the "preformatted text’ button (</>)
1 Like


ok thanks so much i have found this ut i cant find any kind of edit in yaml option?

“Edit in YAML” is in the script editor…

  1. Start at the Script settings page

  2. Find your script and open it

  3. Click the 3-dot menu at the top right, then select Edit in YAML from the dropdown.

ah yes thanks so what am i pasting just this?

image

No, that’s not part of the script. Once you have the script yaml editor open, select everything then paste it here in the forum so we can see if there’s something keeping the script from initializing properly.

image
of course of course here

That looks normal… Will the script run if you use the Run Script option in the 3-dot dropdown?