Sonos plugin showing "offline"

Hi everyone. My plugin works great most of the time but it seems that when I’m away from home for a couple of days, it stops working. It just happen today once again, and the only way to fix it was to go into the plugin Settings page and check the state of it.

I have a fixed IP address for the sonos so as long as it is powered it should always be on. I do turn my Sonos off when I’m in a away mode, but as soon as I’m back home, it is automatically turned on.

Is there any way to run some luup code to check for the Sonos state? Can you please give me a code sample? Thanks!!!

PS - what about some code to set the sleeping timer? that would be awesome to have too!

i had the same issue, and what i found seems to correct it was in the setttings tab of sonos app, you can adjust the check state time interval… i put my to 30 mins… this seemed to correct my offline issue.

If you power off one Sonos device and your Vera reliads, the device will be displayed normally as OFF.

If you power off one Sonos device and your Vera reliads, the device will be displayed normally as OFF.

Hello lolodomo! Thanks for your help. When I’m away from home, I turn off the power to my Sonos speaker, so that may explains why it shows offline, even after restoring power to the unit.

My goal is to start playing music when I get back home. My entrance sensor turns on lamps, turns on the Sonos, runs a scene to play music but sometimes it fails because Sonos is offline when in fact it is on. Is there anyway to run some luup code to check for the Sonos state after powering it up?

Thanks again for your help!

Yes of course.
http://forum.micasaverde.com/index.php/topic,25769.0.html
Consider that Sonos will take several seconds to boot.

Would this be the correct luup code to use, to force updating the Sonos status?

Assuming 192.168.1.10 is the Sonos IP address:

luup.call_action("urn:schemas-micasaverde-com:device:Sonos:1","SelectSonosDevice", {"http://192.168.1.10:1400/xml/device_description.xml"})

I’m not sure this is the proper syntax, specially on the last ‘parameter’.
Thanks again for your help!