I have followed your instruction, probably in a wrong way, now if I call the script, it does not work anymore, these are the lines which I added in the configuration :
You are missing a semicolon (:) after media_player.casa
BTW, please don’t post pictures code, just post the code, it makes it easier for me to give you a corrected version without having to type it all again.
Ok, I will do it immediatelly:
speaker_groups:
media_player.casa:
- media_player.cucinanest
- media_player.camerastudio
- media_player.salottomini
default_volume_level: 0.75
It does not work anyway, it gives now another error:
That’s a strange error, that would imply there is an entity in your setup which isn’t off but still doesn’t have a volume_level attribute.
However, I think it is fixed in this version, could you give it a try?
The template to store the data was failing because somehow the group had the state playing while it was actuanlly not playing anything.
This caused that the app_name in the template was Undefined and because of that the whole list was saved as a string. Can you try 2022.11.9b3 from the link above?
I made also some additional tests. If I call the service also for one device, it still the same problem, so the problem is not only for the group.
If I call the service with tunein active, it works both for single device and group. So the problem is again with spotify.
I have also tried the google nest hub device with some yutube videos…here the same situation, it resumes.
Anyway, there are some remarks… during the announcement, I hear the “beeb” from the 3 devices not synchronized…the second thing is that the volume raises before the announcement, so tunein or the youtube video for one second play with a louder volume before playing the tts message…the other thing that I noticed, is that now the volume does not return to its previous setting…so in my case it remains louder, because I set the announcement volume to be higher, while in the past there weren’t this problem.
Can you try 2022.11.9 from the same link above. I’ve also made some changes to the automation.
For the volume restore thing I will need traces, for both the main script and the helper script. Do note that the helper script might be started several times (once for each device).
BTW, are you saying that Spotify was playing on the group in all these cases?
If that is indeed the case, it won’t resume, there is simply no information available in Home Assistant that Spotify is actually playing.
Only the Speaker Group shows as playing, but without any information what it is playing. All the members show as idle.
No, I have done another kind of test. I started spotify on google home mini while youtube on google nest hub. Afterwards I called a group announcement. To check after if it will resume to all the devices. it is enough that on one device is present Spotify, it will automatically not resume also the other devices. Now I will check the new version
If it is playing tunein on camerastudio and spotify on salottomini, and I start a call tts only to camerastudio, not only it does not resume camerastudio, but it does not restore the volume, so next time I start anykind of activity on camerastudio, it is with louder volume. Spotify will continue playing on salottomini. camerastudio+salottomini - Pastebin.com camerastudio+salottomini - Pastebin.com
For now I had a look a these traces.
From the player_data from the main script, and the helper script I can see that on speaker was indeed playing a web stream, and it was resumed nicely by the helper script. I don’t see any issues in that helper script.
From the player data in the main script, I can see that according to Home Assistant the camerastudio player was playing on TuneIn, that is the one which is resumed
{
"data_source": "resume_script",
"entity_id": "media_player.camerastudio",
"state": "playing",
"type": "no screen",
"members": [],
"app_name": "TuneIn Free",
"volume_level": 0.3,
"media_content_id": "https://kisskiss.fluidstream.eu/KissKiss.aac?FLID=3",
"media_position": 15.51,
"media_artist": "Radio Kiss Kiss",
"media_title": "Io Tu e KissKiss",
"media_content_type": "music",
"entity_picture": "https://cdn-profiles.tunein.com/s61955/images/logoq.jpg?t=1"
}
The solattomini player was not playing at all according to Home Assistant:
On all of these traces, only the camerastudio player was playing on TuneIn.
I might have missed the answer on my earlier question, but how are you starting Spotify on these devices? Is that through a voice command, or starting it with the app? Or something else?
Wait, a had a second look at the traces, they are all exactly the same trace you uploaded 3 times.
The start timestamp is exactly the same. So this is only one of the 3 use cases, probably the first one which was the successful resume when camerastudio was playing on TuneIn
Make sure you upload the right trace for the right test scenario.
I’m off to bed now
Hi, is there a way to trigger the google assistant to listen (like saying hey google) after the resume? I noticed before the script randomly triggered the google assistant after the resume.