How-to: configure Sleep timer for Sonos plugin

Hi everyone! I’m trying to get my Sonos automated and I want to run a scene when I go to bed that plays a certain playlist and configures Sonos to play for 15 minutes.

I believe there is a “ConfigureSleepTimer” luup action but I can’t seem to make it work. This is the code I’m trying:

luup.call_action("urn:upnp-org:serviceId:AVTransport","ConfigureSleepTimer",{InstanceID=1,NewSleepTimerDuration=15})

Eventually I’m using the incorrect InstanceID. Should this be always 1 (in case I have just one Sonos device)? Should it be the Device id?

I’m lost at this. Can someone please help? Thank you so much!

For the record, just in case someone needs a solution, the correct code is:

local SONOS_DEV = 25 luup.call_action("urn:upnp-org:serviceId:AVTransport","ConfigureSleepTimer",{InstanceID="0",NewSleepTimerDuration="00:10:00"}, SONOS_DEV)

This code will set the sleep timer for 10 minutos on the Sonos device id #25

cool , exactly what I needed.

Thanks,
Cor

Nicely done… Thank you !