Hi @markcs , the way I did this is do a script to each device where you let the devide id defined and the variable is the tts that you want to send, and after you created a script to every devide you create a last one that controls that picks witch script to run using a helpers list
You will need to create the list with the devices but you can use any name dont have to be the Id or anything could be “Bedroom”, “Living Room” etc.
After that you can just put the list as an entity in the dashboard and a trigger to the script that rules all the scripts as a button.
here examples:
this code send the command to alexa, jsut change it to the tts of google
alias: play music in oficina
sequence:
- service: media_player.play_media
data:
media_content_id: '{{ states(''input_text.play_on_echo'') }}'
media_content_type: SPOTIFY
entity_id: media_player.echo_dot_de_oficina
mode: single
This one controls what script to run
alias: play music
sequence:
- service: script.turn_on
data:
entity_id: >-
{% if is_state("input_select.echos", "Cuarto") %} script.play_my_music
{% elif is_state("input_select.echos", "Oficina") %}
script.play_music_in_oficina {% endif %}
mode: single
and this one is the card i use, not fancy but works
Hi all, and thanks for this fantastic Lovelace Card !
I have a question and hope someone can help me…
First of all my stuff is some Alexa speakers around the house some of the grouped ( in alexa ).
What i want to do is to have some buttons in Mini-Media-Player that can starts a script that plays playlist in particolare groups or speakers.
If I create a button that calls a script everything works perfectly but i don’t want to create a script for each playlist and each speaker so I need to pass some variables but i not able to do that…
The following is correctly working :
SCRIPT :
( playlist < any pl > su < speaker > is the italian way to send music on alexa )
avvia_riproduzione_mp:
sequence:
- service: media_player.play_media
data:
media_content_id: playlist emile su stanza emile
media_content_type: APPLE_MUSIC
target:
entity_id: media_player.stanza_emile
mode: single
icon: mdi:speaker
alias: pl emile su emile
I solved my problem above: the clue was only to use button type script instead of service !!!
for who needs here is how I solved changing the buttons part :
That most likely has to do with the media player used and not the card. I’ve seen this happen sometimes with my Apple TV media player integration. Check the state of your player to see if there is cover art when you don’t expect it.
Is it possible to do speaker management with forked-daapd or owntone? I don’t see it listed as a platform for speaker group management, but it seems that some have been able to accomplish this
Are there any typical explanations as to why artwork would suddenly stop working in this card? I’m using a few Sonos devices and the artwork is appearing the Sonos app. I even just threw together a new, basic card to see if the artwork would appear and it does not:
No artwork… the play button works, but it does not change to a pause button while playing and will not pause if clicked again. The volume slider works from Lovelace, but does not reflect volume changes made from within the Sonos app. There’s no progress bar. Strange.
same behaviour happened to me, just after “Sonos system update” (firmware update).
In my case it is not linked to the lovelace: mini media player, as I use the standard Spotify built-in of home assistant. The artwork and name of song do not change anymore.
This is more than enough for me about this proprietary software/hardware sonos. I am at day 85 from my 90-days return policy from the vendor (Ikea), so I am packing this thing and going to Ikea tomorrow.
Test the core media_player card, or better yet: use the dev tool of HA to test out the Sonos media_player. Check if artwork and service-calls work there. All this card does is process the info given to it by HA. So chances are there is no artwork to begin with and volume service calls don’t work anymore. If they don’t work there, there is nothing this card can do about it