Just got my Homey Pro 2023, tried the Chromecast app and… as many of you know already, it lose connection to Chromecast devices fairly often. Yes, it could be related to meshed network router switch, 2,4 to 5Ghz switch, sleep mode, … so many potential reasons that 100% reliability is probably not achievable, even after optimisation of the network.
So I wrote a small (advanced) flow: the AND statement ‘Device X is playing’ returns with an error when the device cannot be reached, so I used it to check all my devices and restart the Chromecast app via an ANY box in case one of them fails to respond. I start with this flow in any Chromecast related flow and then insert other commands with a delay of a few seconds (time it takes to restart the Chromecast app)
It isn’t ideal, but it does make the Chromecast connections almost 100% reliable in flows, more so than restarting the app ‘just in case’ every X hours via a separate flow.
(Sorry for Dutch text: ‘Is aan het afspelen’ = ‘Is playing’; ‘Herstart’ = ‘Restart’)
My apologies, that flow only worked because back then I used to terminate casting by launching the ‘Stop Casting’ card only. This did indeed stop the music, but the speaker’s status remained ‘playing’ because it hadn’t been paused. So ‘Is Playing’ was a way to reach out to the speaker and see if it replied, because ‘No’ could only mean that the speaker couldn’t be reached. This is not reliable of course, because any speaker can be really ‘stopped’ via Google Home. Since, I realized that relaunching the Chromecast app takes less than a second and doesn’t affect ongoing streams, so I restart the Chromecast app quickly before starting a cast. To be honest, I’m not even sure that this is still needed, the app seems to be more reliable than 3 years ago.