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

Of course…ugh. Thank you! So, now I have the proper Action def, but still nothing. It’s showing that the script has been called, but no audio. Stepping thru the trace output, it is definitely seeing the target entity as ‘Playing’, but for some reason the target list of players to resume is empty. The result is that the stream stops, not TTS action occurs, and the stream does not resume at all.

Thanks again!

Update… testing with two different streaming sources yeilds two different results:

Tunin Radio - the Stream is interrupted and the TTS message is played, but the stream does not resume.

SiriusXM - The stream is never interrupted, no TTS message - IF I change the stream to Tunin, then the inteded message is played, but much delayed.

Thanks in advance

Is the script started? And if it is, could you send me a trace?

Scripts starts and runs. OK, next dumb question, how can I attache the trace - it’s too large to paste inline.

Thanks

Put it on a code sharing site like dpaste.org

Here you go: dpaste/feB1V (Python)

I did notice that it ends rather abruptly

Thanks

So the first trace was with SiriusXM, and I did notice that there was no stream info.

This one is even stranger. dpaste/hzUAq (Python)
This one is for TuneIn Radio (porch_speaker is the target), and it shows idle. but I can clearly hear the music playing, and the TTS message is played, then no resume.

This one was triggered by the automation. Try disabling the automation if you start the script yourself. I’m working on a new version where I remove the automation and simplify calling the script. But I haven’t found the time to finish it.

No change. dpaste/ZRYLv (Python)

Thanks for all the help.

The data is still coming from the automation, I can see that in the trace

            "automation": true,
            "target_list": [
              "media_player.porch_speaker"
            ],
            "player_data": [
              {
                "data_source": "automation",
                "entity_id": "media_player.chromecastaudio8669",
                "state": "off",
                "type": "speaker",
                "members": []
              }

Disable the automation in the script settings and reload customization and scripts in developer tools > yaml afterwards

Weird, I had done that, but I just re-ran after reloading the scripts and rebooting HA.
Still seeing the same scenario: dpaste/XjMcn (Python)

I can see in that trace where automation = false early on.

Hope this helps.

Data still seems to be coming from the automation. Could you check if the automation indeed ran and send me the trace from the automation?
And maybe turn the automation off?

Yes, hte automation ran, here is that trace: dpaste/vbib3 (Python)

Just disabled it and re-ran the test - same results.
Confirmed the automation did not run that time.
Here’s that trace: dpaste/fnJYZ (Python)

Thanks again…

Okay, I can probably have a look tomorrow

Thank you!! I really appreciate it.
Have a good evening.

@prockeo Can you try if it works with 2023.8.0?

Update

:rotating_light: NEW REPOSITORY FOR THE PACKAGE :rotating_light:

The package has been moved to an own dedicated GitHub repo: GitHub - TheFes/Google-Home-Resume: Google Home Resume package for Home Assistant. Update your bookmarks accordingly!

:radio: GENERAL

:rotating_light: BREAKING

  • (2022.8.0) Removed support for Music Assistant. The integration is broken for a couple of months already, and the new version is still in beta. Will look at it again if the final version of MA2 is released

:recycle: RESUME SCRIPT

:sparkles: New features

  • Added support for resuming BBC streams (BBC Sounds and BBC Iplayer (for players with a screen))

:bug: Bug fixes

  • (2022.8.0) Fix bug in target determination
  • (2022.8.0) Actually use the correct setting for enabling the automation, so now setting this to false actually works.
2 Likes

Hey hey— Loaded 2023.8.0 and TuneIn now works!!! Goes to a commercial after every message, but that’s not your problem. THANK YOU

SiriusXM however still does not work. Music is never interrupted, but when I stop the Sirius stream manually, then the message or messages play. → dpaste/5w9us (Python)

Let me know what else I can do.

Weyy!! This update has resolved my issues I had. Everything is back working again and I am now in my happy place. Thank you!

I don’t know SiriusXM, but there is not much to work from. The media_content_id is empty

              {
                "data_source": "resume_script",
                "entity_id": "media_player.nestmini3896",
                "state": "playing",
                "type": "speaker",
                "members": [],
                "volume_level": 0.2,
                "app_name": "SiriusXM",
                "media_content_id": "",
                "media_position": 18937.33,
                "media_artist": "Jimmy Buffett",
                "media_title": "Stars On The Water",
                "media_content_type": "music",
                "entity_picture": "http://pri.art.prod.streaming.siriusxm.com/images/chan/b3/84d622-95f8-f106-51f1-ce3686887756.png"
              },

I don’t know how this can be resumed.
It is a bit strange that it isn’t even stopped though