Script to resume Google Cast devices after they have been interrupted by any action

Do you mean this?

(script.google_home_resume) turned on
Version number
Failsafe to remove all groups if the script was not running: No action taken
Create variables based on action section
Wrong actions provided: No action taken
Set variables to be used in the script
Update Spotify data if there are Spotify entities: Update Spotify entities
Update Spotify entities
(script.google_home_resume) turned off
(media_player.speakers_groep) turned playing
2 seconden later
(media_player.speakers_groep) turned idle
Stopped because an error was encountered at 19 oktober 2022 om 12:51:33 (runtime: 0.12 seconds)

ValueError: dictionary update sequence element #0 has length 1; 2 is required

thanks for the reply.

No, the entire json of the trace.
There is some info on how to do this in the first post

Has anyone previously encountered this error?


Every time I click ā€˜Submitā€™ it says that it is repaired, but then when the automation gets triggered I keep getting this error.

As stated here you need to add group: to your configuration.yaml if you donā€™t have any old style groups defined yet.

1 Like

Ah great, I missed that small part. Thank you very much!

Hi I just tested your latest script as I always do and I noticed that volume is not restored after playing the message. Is there something changed around this point.

Not on purpose anyway.
I will do some tests myself. Could you also send me s trace of the main script and helper script maybe?

#Update

Version 2.8.6 - 27 October 2022

:bug: Bug fixes

  • Fixed a typo which caused that volume restore was not working anymore
1 Like

Hi, suddenly I got warning and errors. I used the latest version of your code.



These screenshots donā€™t show me the info I need, please send the traces as described here

Instructions were a bit outdated though, Iā€™ve updated them

Hi, here are the JSON files.

00 - Google Home Resume: dpaste/bcv2c (JSON)
00 - Google Home Resume - Helper Script - dpaste/YWWYj (JSON)

I donā€™t think these traces are the right one, there are no errors in these traces.

Make sure to send the traces with the error.
They should roughly match the timestamp of the error (5:33 PM)

Every time the script triggered it always logged the warning and errors. This is what I got from fresh HA restart after attempted to trigger the script (8:21 PM).

Logs: dpaste/2HujT (Plain Text)
00 - Google Home Resume: dpaste/FOb0i (JSON)

I noticed, it triggered 00 - Google Home Resume - Helper Script multiple times. I didnā€™t check if all of the contents of the traces if they are the same.
1st: dpaste/bhpTk (JSON)
2nd: dpaste/3wHGc (JSON)
3rd: dpaste/X5Gg9 (JSON)
4th: dpaste/pMYrA (JSON)
5th: dpaste/yVWvK (JSON)

00 - Google Home Automatic Resume (Automation): dpaste/JUu2z (JSON)

I have 2 devices that are offline, maybe this is the cause of the error? I didnā€™t use TTS, I just used recorded audio file to broadcast a message.

Hereā€™s the screenshot of the triggered Automation

It doesnā€™t matter if I use the Script: Turn on or calling the script directly.

Only the 4th has an error, I will look into this later.

1 Like

The 4th item is media_player.sheena_s_speaker
It looks like that one is not available, and is therefore causing some issues.

It looks like the rest is resumed as it should.

I will have a look how I can best avoid these errors

Ah! Thatā€™s why I started getting those errors when I turned off my sisterā€™s bedroom power including that speaker. Thank you for the time reviewing the trace logs. Your code is very helpful migrating from assistant relay. And Iā€™m glad you can further improve the code from this.

Update

Version 2.8.7 - 29 October 2022

:bug: Bug fixes

  • Fix to avoid helper script started for players which are unavailable
2 Likes

Should be fixed now :slight_smile:

2 Likes

@chicknlil25 For how many accounts did you setup spotcast, and for how many accounts did you add the Spotify integration?