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

@TheFes I used this configuration and it work for a while. Recently this script won’t work anymore. I am not sure what I need to fix or if I need to set it up from scratch.

This is the script I used

PS. In my configuration.yaml I do not have this

homeassistant:
#include this line
packages: !include_dir_named packages

I assume that I use old version that won’t work anymore. So what is the best way to fix this?

THANKS!

  - alias: Version number
    variables:
      version: 2.5.0

You are indeed using a quite old version, from May 2022

A lot has changed in the year that passed, both in the script and in Home Assistant itself. I’d suggest you update to the latest version.

I have got 4 errors when I pasted content from the link.



Is this normal ? Do I have to change anything?

PS. I do not understand what “radio_data” is and what should I change it to.

Thanks for your help!

The automation seems to triggerd (as photo show) but nothing is resume.

When I try to setup in a script like I used to nothing resume either.

Here is my full code

The errors/warnings VSCode gives are incorrect, the code is valid.

radio_data is used to provide metadata when resuming TuneIn radio streams. This is explained here

These screenshots don’t tell me anything, please provide traces of the scripts and automation as described here

google home resume

helper

"error": "Could not get spotify token."
Please check your Spotify and Spotcast configuration

It turn out that sp_dc and sp key has changed. Now it’s working. Thank you!

1 Like

My doorbell script is not working (The automation works fine)

google home resume

My doorbell press script

My doorbell press data script (script to call in service)

Sorry, what do you mean with not working

Nothing is resume. I played Spotify and run doorbell script.

Update

2023.6.0

:bug: Bug fixes

  • (2022.6.0) Fix bug in target determination

I try to update to 2023.6.0 but I cannot find the package (it’s still 2023.5 in the link). So I try to copy the code and repace it (Thought you might forgot to change version number). Now the automation not working nor script.

Here is the trace

So now I downgrade to 2023.5 and the automation works fine but not the script.

Thanks!

I indeed forgot to change the version number.

How did you downgrade to 2023.5?
I did not make any changes in the automation for 2023.6, so that one should still work.

Could you try this one?
https://github.com/TheFes/HA-configuration/blob/427a7ce25343db5d1e33765e4df8153fb8bb51fa/include/integrations/packages/google_cast/google_home_resume.yaml

I run home assitant on proxmox so I downgrade by restore proxmox backup.

Now for the 2023.6.1 the script is working but the automation is not

Trace for automation that not working

Trace for the script that now working

THANKS !

The HA core version is unrelated, I just use the same version numbering system.
I don’t want you to downgrade HA Core

1 Like

I did not downgrade HA core. I just roll back my Proxmox VM to the day before (before upgrade to 2023.6). So I can downgrade anything.

THANKS!

Hi TheFes,
after update to 2023.6 (with version variable “2023.5”) I see this error all the time script should run:
Did not try 2023.6.1

Logger: homeassistant.components.script.google_home_resume
Source: helpers/script.py:410
Integration: Script (documentation, issues)
First occurred: 20:58:44 (1 occurrences)
Last logged: 20:58:44

00 - Google Home Resume: Error executing script. Error rendering template for variables at pos 11: TypeError: can only concatenate str (not "list") to str

Here is the trace:
https://dpaste.org/Qjdu8

That should be fixed in 2023.6.1.
I will push it now

1 Like