Sonos rule

Hi all,

Bit of help on this one please.

I have a rule that works perfectly, except for one thing.

It runs on an alexa command, it turns a smart plug on, gets a Sonos playlist, controls the volume and then plays the playlist…perfect…

However, if the opposite alexa command is called, the plug switches off as designed but the STOP command on the sonos speaker does nothing…any ideas? I’m sure the syntax is correct but do I need to get it to refer to the playlist again or something? I assumed that the STOP command just stops whatever is playing???

rule "Alexa command Bedtime is called"
when
	Item aBedtimeRoutine changed
then
    if(aBedtimeRoutine.state == ON)
        {
        logInfo(logName, "Bedtime routine called by Alexa")
        MyPlug.sendCommand(ON)
        sendCommand(Sonos_EB_PlayPlaylist, "12345")	
        sendCommand(Sonos_EB_Volume, "6")
        sendCommand(Sonos_EB_Control, PLAY)
        }
	else
        {
        logInfo(logName, "Awake routine called by Alexa")
        MyPlug.sendCommand(OFF)
        sendCommand(Sonos_EB_Control, STOP)
        }
end  

Have you tried

 PAUSE

Hi,

Yes, PAUSE works, but I wanted it to STOP…

Having said that, what actually is the difference to Sonos in reality I wonder???

1 Like

That’s the same result I got with a client’s Sonos kit.