Question: Sonos Unavailable --> Available (Flow Possibilities)

Dear All

I’m back, it’s been a while. I migrated away to HA again for a while but after the so manieth time of my Home Assistant Server going fully bonkers (fans blowing like a madman), I’m biting the bullet and going back to Homey, because I have to admit, it’s been running in the background but it’s been stable so I can’t complain.

I have a question to see if it’s feasible to do so in Homey, but I have a pretty specific case where my mother in law comes to our home to help and normally the Sonos speaker would automatically start playing some radio for her. Sadly enough, sometimes the children would plug out the Sonos speaker because they need an outlet for their power bank and all the things and they forget to plug it back in.

So in Home Assistant I created a flow that basically said: When the Sonos goes from Unavailable to Available and my mother in law is home. Play music. This was possible with Home Assistant, but I don’t seem to find a good way to do so in Homey.

Does anyone have any experience with this or has a workaround to come across this limitation from Homey?

Thanks for the help!

Welp.. I solved my own issue. Should’ve waited before asking. However, just in case someone might be interested in the flow that I use to try to fix this issue:

This is my main flow. It just checks if the Sonos is not already playing something, places the volume on 10%, then starts playing the radio Joe FM. In the event that the Sonos is offline, sending a command such as “Set volume” or “Play” will always fail. Since the first command is a volume setting, the flow will always fail on that block.

I’ve made an error handling flow. “Error Checking - Sonos Offline” which gets Activated and then sends me a notification that the Sonos is not available.

The Sonos Offline flow is as follows:

Simply put, it follows the same flow as my main flow, but tries to do so each 30 seconds. If it fails, it fails on the volume action and it won’t do anything, until after 30 seconds have passed again. From the moment that the Sonos gets plugged in and the 30 seconds passes again, the volume action and play action will succeed. I get a notification, and I disable my error checking flow so that this flow doesn’t take up any unnecessary compute time on the Homey.

Just tested it out and that seems to work perfectly fine!

1 Like

Just another thing to consider: I always turn my Sonos devices completely off, via a smart plug, when not in use. After powering them on again, I always need to restart the Sonos app on my Homey (I have automated that in the power on-flow). If I don’t do that, Homey does not update the status of my Sonos devices and flowcards don’t work. Not sure whether this also applies to your case.