22.06.2017, 14:08
hello, i'am trying to get the sonos script ,i found on the forum, to simulate a doorbell.
when i give the value's to the groupadress manually ( value = 1 " for stopping the current player", value =20 "adding playlist", value = 30 "playing from queue" , value = 19 "clearing current queue") and even getting in it sequence a part of it, but only the stopping of the player gives me a error.
this is a piece of the script i used and partly modified
if someone could look into it an d give me hand with it ...
greatings steven
when i give the value's to the groupadress manually ( value = 1 " for stopping the current player", value =20 "adding playlist", value = 30 "playing from queue" , value = 19 "clearing current queue") and even getting in it sequence a part of it, but only the stopping of the player gives me a error.
this is a piece of the script i used and partly modified
Code:
-- Action on object value 20
if value == 20 and Sonos_Info.sonos_ipaddress ~= nil then
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'Pause') -- here it goes wrong
id = getplaylistid(PL_1)
if id ~= nil then
-- add playlist to queue
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'AddURIToQueue', addplaylist(id))
end
sleep(1)
-- Start playing with first track in que
uri_queue = "x-rincon-queue:" .. Sonos_Info.sonos_rincon .. "#0"
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'SetAVTransportURI', '<CurrentURI>'..uri_queue..'</CurrentURI><CurrentURIMetaData/>')
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'Play', '<Speed>1</Speed>')
sleep(3)
-- Clear current queue
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'RemoveAllTracksFromQueue')
sleep(1)
-- Set volume to <DesiredVolume>??</DesiredVolume>
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'SetVolume', '<Channel>Master</Channel><DesiredVolume>' .. Sonos_Volume .. '</DesiredVolume>')
-- Unmute
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'SetMute', '<Channel>Master</Channel><DesiredMute>0</DesiredMute>')
-- Set radio to xx
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'SetAVTransportURI', '<CurrentURI>x-rincon-mp3radio://' .. URL_1 .. '</CurrentURI><CurrentURIMetaData/>')
-- Start playing
upnpavcmd(Sonos_Info.sonos_ipaddress, 1400, 'Play', '<Speed>1</Speed>')
--Exit script
return
end
if someone could look into it an d give me hand with it ...
greatings steven