Sonos Online check after reboot?

Hello everyone.
I have several Ikea Symfonisk Sonos speakers in the house.
I switch off a few speakers via a Zigbee socket so that they don’t consume so much in standby mode.

I have an automation that plays a radio station by voice command, for example.
However, if the Zigbee socket has to be switched on first, the actual command to play the radio station goes nowhere and is not received because the Sonos Box is not yet “online”.

I have tried to intercept this via the “unavailable” status of the Sonos box. However, this is very unreliable, as the status sometimes only changes after several minutes when the Sonos is no longer online or goes online.

Then I tried a loop where it always checks after 20 seconds whether the status of the Sonos is “playing” and otherwise simply sends the command again. But even that only works 80% of the time. The status is simply too slow.

My next idea would be to send a ping to the IP of the Sonos. But I couldn’t find the function in the automations. Does anyone else have any ideas on how I can solve this reliably?

Greetings Moni_Ka

Had the same problem, and ended up leaving my speakers powered on all the time.

If you want to try pinging them, there’s an integration which gives you on/off binary sensors:

1 Like

does calling homeassistant.update_entity then checking unavailable status help?

I have my automations check the state of the socket. If the socket is switched off, I switch the socket on and send the play command one minute later.

2 Likes

Hello.
Thank you very much for your answers. I have tried it with the Ping adapter. Unfortunately that doesn’t work either. Even if I can already send a ping and it arrives, the Sonos is apparently not ready to accept the play command from home assistant.

With “homeassistant.update_entity” the status of the Sonos does not update either. Not even after several minutes.

However, I have noticed that sometimes the status is still set to “unavailable” after several minutes. I can then send a play command via the Sonos app and also via Node Red, which is also accepted. Only via Home Assistant directly does the Play command not go through.

I am now trying to realise this somehow via Node Red.

Thank you very much.
Moni_Ka

Please post your automation. Are there any errors / warnings in the log file when this occurs.