Chromecast announcement issues

Hi,

I started to get some strange troubles recently and my announcements on my chromecasts do not work anymore. I have pretty simple test rule

rule    "Voice Testing Rule"
	when
		Item    Voice_Robot     changed from OFF to ON  
	then
        playSound("chromecast:chromecast:ChromecastSpeakerLiving", "soft_chime.mp3", new PercentType(40))
        playSound("chromecast:chromecast:ChromecastSpeakerOffice", "soft_chime.mp3", new PercentType(40))
        var Timer myTimer = createTimer(now.plusSeconds(2), [ |
                playSound("chromecast:chromecast:ChromecastSpeakerLiving", "pa.mp3", new PercentType(40))
                playSound("chromecast:chromecast:ChromecastSpeakerOffice", "pa.mp3", new PercentType(40))
                ])
        var Timer myTimer1 = createTimer(now.plusSeconds(6), [ |
                        say("Halo, this is test.", "googletts:enGBWavenetC", "chromecast:chromecast:ChromecastSpeakerOffice")
                        say("Halo, this is test.", "googletts:enGBWavenetC", "chromecast:chromecast:ChromecastSpeakerLiving") 
                ])
end

and the chromecasts go offline when the rule tries to play or say something and they come back immediately online:

2021-05-07 09:38:23.763 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerOfficeappName' changed from Default Media Receiver to UNDEF

2021-05-07 09:38:23.771 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerOfficeIdling' changed from OFF to ON

2021-05-07 09:38:24.508 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerLivingappName' changed from Default Media Receiver to UNDEF

2021-05-07 09:38:24.510 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerLivingIdling' changed from OFF to ON

2021-05-07 09:38:50.931 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerLivingappName' changed from UNDEF to Default Media Receiver

2021-05-07 09:38:50.933 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerLivingIdling' changed from ON to OFF

2021-05-07 09:38:50.983 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerLiving' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media

2021-05-07 09:38:51.051 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerLiving' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

2021-05-07 09:38:52.995 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerOfficeappName' changed from UNDEF to Default Media Receiver

2021-05-07 09:38:52.997 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerOfficeIdling' changed from ON to OFF

2021-05-07 09:38:53.130 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerOffice' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media

2021-05-07 09:38:53.154 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerOffice' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

2021-05-07 09:38:55.806 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerLiving' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media

2021-05-07 09:38:55.820 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerLiving' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

2021-05-07 09:38:56.181 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerOffice' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media

2021-05-07 09:38:56.202 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerOffice' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

2021-05-07 09:38:59.503 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerOffice' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media

2021-05-07 09:38:59.547 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerOffice' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

2021-05-07 09:39:00.037 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerLiving' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media

2021-05-07 09:39:00.054 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerLiving' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

I already tried restart, reinstallation of the binding clearing the cache (that caused me other trouble yesterday) but nothing helps.

I am running openhabian with OH3 and the chromecast binding is the latest 3.0.2.
The speakers are members of several groups, and by default all TTS is announced on a chromecast group serving for that purpose. Both those chromecasts are part of the default TTS group, so when I try to say something via the default group, then only the group speaker goes off and online.

2021-05-07 09:45:58.193 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:audiogroup:ChromecastGrpGoogleTTS' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media

2021-05-07 09:45:58.229 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:audiogroup:ChromecastGrpGoogleTTS' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

Any ideas?

Hi, no one having the same issues?
I have same behaviour also when I only try to play mp3 to the speaker or when I use say.
I can hear that the speaker makes some noise (like it is waking up and adjusting the volume), but the sound message does not go trough, the speaker goes offline and in few milliseconds back online


2021-05-10 12:48:10.496 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerLivingVolume' changed from 40 to 45

2021-05-10 12:48:10.669 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerLivingOFF' changed from OFF to ON

2021-05-10 12:50:04.879 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastGrpGoogleTTSVolume' changed from 37 to 35

2021-05-10 12:50:05.494 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerLivingVolume' changed from 45 to 40

2021-05-10 12:50:05.554 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerLiving' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media

2021-05-10 12:50:05.565 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:ChromecastSpeakerLiving' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

2021-05-10 12:50:05.687 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastGrpGoogleTTSVolume' changed from 35 to 37

2021-05-10 12:50:15.261 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerLivingVolume' changed from 40 to 45

2021-05-10 12:53:04.672 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerOfficeappName' changed from Default Media Receiver to UNDEF

2021-05-10 12:53:04.674 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ChromecastSpeakerOfficeIdling' changed from OFF to ON

Hi @DarkoG, I have very similar issues. I have not been able to resolve it either, posting my error report here for reference.

Summary:
Chromecast binding does not allow me to say or playSound anything anymore on my Google Home(s). Just the “pling” and then nothing. Error in the log:

2021-05-11 18:51:18.332 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:[xxx]' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to load media
2021-05-11 18:51:18.472 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'chromecast:chromecast:[xxx]' changed from OFFLINE (COMMUNICATION_ERROR): Unable to load media to ONLINE

This happens with both Groups of Google Homes and a single one.

System:
openHAB 3.02 (release), ChromeCast binding 3.02, running on Windows 10. Google Homes, minis and Nest displays. Upgraded from 3.01 (release) during the troubleshooting, did not help. So basically the same problem on 3.01.

Background:
I had a lot of online/offline errors in the log with the Chromecast binding so I tried to add Callback URL in the interface, I read that in a thread somewhere in the forum.

Before this the only thing that was not “working” was the many entries in the log about Google Homes going off- and online all the time. Then, after the change of the callback url, the sound (say or playSound) stopped playing on the Google Homes. I changed the url back to nothing as it was before when it was working - it turns out it is not possible (on my installation at least) to save a totally empty string from the gui of openHAB 3 - if it is totally empty, the saving does not take place att all.

If I put anything in (space, underscore or similar), it saves but then that configuration is wrong of course. Found the config file for the chromecast binding and manually deleted the space there and saved it. Now there is no space in the config for the binding in the gui. No difference regarding the problem.

From the moment I edited the callback URL from the user interface, I have not being able to send anything to my Google Home(s) - I have tried both groups and a single one. Just the chime and then nothing.

It might be that the reason is something else than the editing of the callback url but that is at least when I noticed it. So it could be a coincidence that it happened more or less at the same time and that it has nothing to do with the url. The url was totally empty when it was working, that I know for sure though. Because of the above post from DarkoG I suspect that something else is behind it though.

I wasn’t doing any other operations on the system at the time, only trying to solve the many on- and offline error (which does not occur now on a regular basis).

Tried uninstalling the binding, cleaning cache, restarting. No improvement.

I have read a lot about this problem (on- offline, unable to load media) and found a few threads about it, also with [solved] in the title but the problem and solutions did never apply to my system, at least not from what I could understand. So I am a bit lost here and really don’t know how to troubleshoot more. If anyone could nudge me in the right direction, that would be very nice.

Some other info, relevant or not (I don’t know). Whenever I have restarted my system since 3.01 sometimes I need to go into my textual rule files and just change a small thing (so it is changed) and then resave them. Otherwise I get an error in the log when running a cron script with an actions.publishMQTT inside it. But that solves itself after the resave of the rule files. A bit strange, took me some time to understand that. Otherwise it is working quite nicely with version 3.02.

This is the cron/mqtt error that goes away after just resaving the file:
2021-05-11 19:35:00.910 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'TimeDependant-4' failed: null in TimeDependant

Hi @Samir.E, same thing here. I didn’t touch anything before the fault started and already tried all you described.
Not able to get it working yet. I am thinking of installing Home Assistant on other device (NAS) that I would use as interface to chromecast and Spotify only via MQTT, my experience shows problems with those 2 bindings in OH3. The idea is to keep the control in OH and send some switches to HA, which will trigger actions on the chromecasts.
I don’t have experience with HA so I don’t know if there are some issues that I might face, but will try when I have some time

Yes, that is one way to go. I will try to wait and see if anybody has some sort of idea of what is going on and try to solve this inside OH3 instead. My experience is that if you try to involve even more other stuff, you will probably encounter some other new problems there. But we will see which way to go is the best :slight_smile:
Hopefully someone in the OH community with more experience or knowledge can give us some tips on how to go on.

Are we the only two OH users that have this problem or does no-one have any idea of a possible solution to this problem? I have really tried to figure this out myself but with no luck so far. So I am stuck at the moment. Would be much appreciated to have some sort of input on this if possible.

Hello today I have the same issue with OH3 too. Few years back had the same with OH2 but after a while deleting the callback URL in Chromecast binding it get fixed anyhow. .

I got the solution - ezt least for myself - : I had to create a service.cfg file with the callback url address. Thaks for Chromecast problems with playSound and say - #3 by homer66

You rule @a.alakszai !
Thanks, that solved it

You are the hero of the day @a.alakszai , thanks for understanding and writing about the solution!