Luup and Sonos

Just getting my feet wet with luup coding. I am trying to create a simple scene that will announce the station playing on my Sonos speaker. Can someone help me with the following code? I keep getting a return value of nil for varCurrentRadio. What am I missing.


local SonosConnectDeviceID = 15
local Sonos_SID = “urn:micasaverde-com:serviceId:Sonos1”
local Sonos_DeviceID = “urn:upnp-org:serviceId:DeviceProperties”

local varCurrentRadio = luup.variable_get(Sonos_DeviceID ,“CurrentRadio”,

if (varCurrentRadio == nil) then
luup.call_action(Sonos_SID, “Say”,
{Text=“I’m not sure.”, Language=“en”, Volume=15},
luup.call_action(Sonos_SID, “Say”,
{Text=varCurrentRadio, Language=“en”, Volume=15},

You use the wrong service id. For this variable, the service id is urn:upnp-org:serviceId:AVTransport.

Thanks for all of your help

How do you determine which service id to use for different variables?

If I wanted to return the favorites variable what service id would I use?


Went through your code and figured it out…

Plus it is written in the wiki page.