Okay, I should have a trace from a script run when it went wrong. However, I can see from the previous trace that is is truncated, and that the information I need might not be in it. I can see the settings (in the variables) you set. Could you tell me what the target for the message is, and which entities are playing, when it does not work properly?
I think I already see it. You did not include the sub_groups variable I created based on your previous posts.
@tivoo I made some changes to the code in which the players to be resumed are determined.
The sub_groups variable is no longer needed now.
If you update your script with the version on my GitHub page, it should work better now.
Apologies it took me a while to revert back.
Indeed, the code was a copy/paste, hence explaining the incorrect indentation. But that is not the problem, as this is correct in my script.yaml file.
Also, to your question, I indeed did not yet had Spotcast installed, but installed in the meantime. However, still no success. Hence, looking forward to know if you see anything weird or missing in the shared script.
Unfortunately also here the script is truncated before it gets interesting
Some things I can see:
The speaker_groups you have set up should match with the speaker groups set up in the Google Home app. I don’t think media_player.spotify_nonkelsue is set up as a member of your beneden_groep in Google Home.
If you update to the last version of the script, sub_groups is no longer needed.
In the part I can see, I see that the script had an error: "script_execution": "error", And the error message is "Error rendering data template: Result is not a Dictionary". According to the trace it is in sequence/7 but that is the step in which the TTS is sent. Does it actually send the TTS?
If it does, what is the last step which is performed according to the trace?
Unfortunately I am have an issue with this. I’ve gone through the debug and the issue seems to be that I am not passing a tts_volume (I would like the TTS volume to be whatever the media_player. is set to).
This is the error I am getting, which is generated on this part of the code:
Stopped because an error was encountered at January 2, 2022, 15:08:20 (runtime: 0.04 seconds)
Error rendering data template: TypeError: ‘<’ not supported between instances of ‘str’ and ‘int’
Just wanted to report back to you that I am enjoying your script a lot. I got it working flawelessly in my set up! Thank you very much, I’ll keep an eye out on future versions.
I could look into that, but right now I don’t really see the need for it.
As far as I understand blueprints are for cases where you would reuse code for several scripts/automatons. That is not the case here, because you only need this script. No need to create one per media_player for example.
This looks brilliant - I was really excited to see it but then noticed the discussion on YouTube Music - which is what I use. Did anyone find a solution?
Did a quick search, but it looks like Youtube Music Player is still the only option to use it in Home Assitant, and resuming that requires the stream to be started using that integration.
There is already an example about resuming it on the Github page