Hello,
I have a script that takes over my TTS output to Alexa devices.
A fixed list of Alexa devices is kept ready in the script:
sequence:
- service: notify.alexa_media
data:
message: "{{message}}"
title: "{{title}}"
target: "{{target}}"
data:
type: announce
method: all
fields:
message: []
title: []
target:
selector:
select:
options:
- media_player.uberall
- media_player.erdgeschoss
- media_player.obergeschoss
- media_player.k68_3_firetv_r13
- media_player.alexa_bmw
multiple: true
name: Ziel
I would like to replace this fixed list with a template that could query Alexa devices. Then the script would be more flexible and would offer new devices automatically. I do know how to write such a template:
{{ integration_entities('alexa_media') | select('search', 'media_player\.')
| list }}
# or with friedly_names like this:
{{ integration_entities('alexa_media') | select('search', 'media_player\.')
| map('state_attr', 'friendly_name') | list }}
But I don’t know how to put it into a format that replaces my fixed list.
Can anyone help me with this?
Best regards, Eckart