This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

sonos script on homeLynk
#1
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
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
Reply


Messages In This Thread
sonos script on homeLynk - by stevesu - 22.06.2017, 14:08
RE: sonos script on homeLynk - by stevesu - 23.06.2017, 16:24
RE: sonos script on homeLynk - by stevesu - 06.07.2017, 07:15
RE: sonos script on homeLynk - by admin - 06.07.2017, 07:49

Forum Jump: