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 app
Hi,

See this article for full set of commands ( only doorbell is added later )

https://forum.logicmachine.net/showthrea...44#pid2244

BR,

Erwin
Reply
Hi Erwin,

Thank you for the complete list commands, I have a last question, to get the feedback information (like a track name, time track, album art, etc) what is better, That I send 255 value every second to virtual value or use a Javascript example from page 4 of this thread?

Thankyou very much
Reply
For now you need to poll every x seconds, we are working on a change to use the Sonos event services.

Next version will give update when something change on server side automaticly. This to reduce cpu load.

BR,

Erwin
Reply
Hi,

After the new update of the SONOS app my sayall function is not working.
When running this command:

'http://10.0.1.51/apps/data/sonos/sonos.lp?action=sayall&audiofile=http://10.0.1.51/user/doorbell.mp3&volume=30&duration=5'

I get the following error:
Error in store/libs/sonos/sonos.lua at line 1158: attempt to index a nil value
Reply
Hi,

Current Sonos app is re-build by our development team, they added Sonos Event services and the deep level for the touch visu

I think they used the previous version without the added functions for speech/doorbell.

I will send them the functions so they can add them to sonos.lp so it will work again.

BR,

Erwin
Reply
Hi,

We updated the Sonos app, the feedback is now changed to the Sonos event services and will be using a lot less of CPU power, also the say and sayall functions are repaired.

Please update your app to have the latest version.

BR,

Erwin
Reply
The sayall function is now working, however there is a huge load/delay time before the mp3 file is played. It takes more then 20 seconds for the file to start playing, and sometimes it does not start playing at all. I have to set the duration time from 5 to 15++ just to get it to play...
Unfortunately, when it takes more 20 seconds for a file to play (if it plays at all) using this for a doorbell becomes too unreliable to use.
I also use this as a heads up when the alarm has been triggered, but waiting 20 seconds for a sound is too long. 

It seems like the rebuild has made some changes that has an impact on loading time for local mp3 files. Also the file seems now to load as radio station... I am not sure if it used to do so before?

Any suggestions?
Reply
Hi,

I noticed there where more issues then this.

I will add it to the comment i sended to the developer.

I will also ask the source code back so i can see what they have changed and maybe add some improvements.

BR,

Erwin


Verzonden vanaf mijn iPhone met Tapatalk
Reply
Hi,

An update of the app was released yesterday, but I don't see any changes in my delay issue. Did it not install correct or was the issues I am seeing not addressed in this release?

Thanks
Mr.D
Reply
(10.08.2017, 19:37)Mr. Danielsen Wrote: Hi,

An update of the app was released yesterday, but I don't see any changes in my delay issue. Did it not install correct or was the issues I am seeing not addressed in this release?

Thanks
Mr.D

Hi
I just got info from SE that they fixed only this:
-- Load modules
require('socket.http')
 
-- Set timout
socket.http.TIMEOUT = 5
 
reply = socket.http.request('http://127.0.0.1/apps/data/sonos/sonos.lp?action=mute&ip=192.168.10.26')
log(reply) Error in /www/apps/data/sonos/sonos.lp at line 633: attempt to call global 'Mute' (a nil value)
 
reply = socket.http.request('http://127.0.0.1/apps/data/sonos/sonos.lp?action=unmute&ip=192.168.10.26')
log(reply) Error in /www/apps/data/sonos/sonos.lp at line 665: attempt to call global 'Unmute' (a nil value)
Reply
Hi everyone,

I am working on the the integration of Sonos to LM5 and just wanted to give a small feedback.
Like Mr Danielsen :
- it takes a long time before a local mp3 file is played
- when it is played you do no see any information about the song in the Sonos player (name, singer, time passing by) even though you can to play/pause/sound up/sound down

Do you know if there is a way of showing in the Sonos App a local file (stored in /user in LM) with a 100 songs so that I can play these songs when I don't have internet ?
Or maybe you can store songs directly in the Sonos ?

Thank you for your help et for the App it is great !
Reply
Hi,

We are currently checking if and why the delay is there. If needed we will fix this.

When playing a local file you also need to pass the metadata, this is a soap envelope with all the data for playingtime, albumart etcetera. If you add a song with the Sonos it is generated automaticly but when you control your Sonos through UpnP (like the API does) you need to pass it manualy. Because it's not a easy task to create the metadata by hand we have decided to not implement this throug the API. So basicly there is no way to solve this. This is only when you use say and sayall function.

What you can do is create a playlist and call the playlist with the API, this way the metadata is already generated by the Sonos system and loaded by the App.

To load a list you can use a command like this: http://127.0.0.1/apps/data/sonos/sonos.l...oplay=true

You can't store files in a Sonos device but you can load them from a network share. Add this share to the Sonos by the Official Sonos App and create a playlist for it.

With the API you can load it from LM.

Sample of a metadata envelope to show you how complex it is to create manually:
   

BR,

Erwin
Reply
Hello!!

i want to launch 5 favorites os Sonos using the APP.

Favorite 1: Radio Station
Favorite 2: Radio Station
Favorite 3: List of Sonos with 1 song
Favorite 4: List of Sonos with 3 songs
Favorite 5: List of Sonos with 50 songs

I use the action "playuri" like this: 
http://192.168.1.91/apps/data/sonos/sono...stnumber=3

In "listnumber" i put numbers from 1 to 5 corresponding Favorites.

When i play a favourite with a radio station (1 or 2), works well, but when i'am in a radio station and i call a favorite with a playlist (3,4 or 5), the songs are loaded in the queue but don't start playing.
When i'm in a favorite with songs (3,4,5) and i call other favorite with songs (3,4,5), it's works well.

Can you help me??
Thanks, and sorry for my english...

Homelynk FW: 2.0.1
Reply
I'm not familiar with Sonos, but what you can try is clear queue then load then play.
Reply
Hi,

Playlist are not always 1,2,3,4,5 if you remove a playlist it results in a gap in the numbering.

You can also call a playlist by name with the API so you don't need to know the list number.

You can also request the lists (and log the result) stored in the Sonos to see the available list numbers.

BR,

Erwin
Reply
(19.10.2016, 09:51)Erwin van der Zwart Wrote: Hi Andreas,

Are you using the Sonos app to control the volume or do you also have another script running?

The Sonos app can handle all (external) request you want to do, but that don't work with upnpcmd function.

If you use the app you need to control the functions with http commands like: (192.168.1.202 is my homeLYnk addres)

Code:
http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolume&uuid=RINCON_000E5821B62C01400&volume=10

http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolume&ip=192.168.10.31&volume=10

http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolume&name=Woon_Kamer&volume=10 -- use _ for spaces in the name

full sample:
Code:
-- Load modules
require('json')
require('socket.http')

-- Set timout
socket.http.TIMEOUT = 5

-- Read IP address from controller
data = io.readproc('if-json')
data = json.decode(data)
ip = data.eth0.inetaddr

-- Set SONOS name
Sonos_Player_Name = 'Sonos_Speaker'  

-- Get event value
value = event.getvalue()

-- Set stepsize volume
Volume_Step = 10

-- Set Action
if value == 101 then
    Sonos_Action = 'play'
elseif value == 102 then
    Sonos_Action = 'stop'
elseif value == 103 then
    Sonos_Action = 'next'
elseif value == 104 then
    Sonos_Action = 'previous'
elseif value == 105 then
    Sonos_Action = 'mute'
elseif value == 106 then
    Sonos_Action = 'unmute'
elseif value == 107 then
    Sonos_Action = 'setvolumeup'
 Volume_Step = Volume_Step or 10
elseif value == 108 then
 Sonos_Action = 'setvolumedown'
 Volume_Step = Volume_Step or 10
else
 action = 'none'
end

-- Execute action on value 0 to 100
if value >= 0 and value <= 100 then
 local reply = socket.http.request('http://' .. ip .. '/apps/data/sonos/sonos.lp?action=setvolume&name=' .. Sonos_Player_Name .. '&volume=' .. value .. '')
end

-- Execute action on value 101 to 106
if value >= 101 and value <= 106 then
    local reply = socket.http.request('http://' .. ip .. '/apps/data/sonos/sonos.lp?action=' .. Sonos_Action .. '&name=' .. Sonos_Player_Name .. '')
end

-- Execute action on value 107 to 108
if value >= 107 and value <= 108 then
    local reply = socket.http.request('http://' .. ip .. '/apps/data/sonos/sonos.lp?action=' .. Sonos_Action .. '&name=' .. Sonos_Player_Name .. '&step=' .. Volume_Step .. '')
end

-- Execute action on value 255 (Feedback)
if value == 255 then
    local reply = socket.http.request('http://' .. ip .. '/apps/data/sonos/sonos.lp?action=getextendedstate&name=' .. Sonos_Player_Name .. '&createbaseimg=true')
 reply = json.pdecode(reply)
 if reply then
     local current_volume = reply[1].volume
     local current_mutestate = reply[2].mute
   local current_crossfadestate = reply[3].crossfade
   local current_playmode = reply[4].playmode
   local current_transportmode = reply[5].transport
   local current_duration = reply[7].duration
   local current_playingtime = reply[8].playingtime
   local current_title = reply[9].tracktitle
   local current_artist = reply[10].creator
   local current_album = reply[11].album
   local current_albumart = reply[12].albumart
   local current_mediatype = reply[11].mediatype
 end
end

Full set of possible actions:

Code:
-- SONOS server side API interface for homeLYnk and spaceLYnk apps version 0.1 (DEV VERSION)
-- Includes SONOS auto IP discovery and all needed commands to perform basic and extended operation

-- Commands for SONOS API Interface

-- Get sonos data from players, only new found players are added to the existing array, earlier discovered players are already stored and not updated to keep fast performance
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getsonosdata

-- Remove all items from stored array and rediscover all players again from start, this will reduce speed performance (only trigger by button)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=refreshsonosdata

-- Refresh group data, no new sonos will be discovered, all groupings are (re)checked for current state
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=refreshgroupdata

-- Set player as standalone group (remove player from grouping)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setplayerasstandalonegroup&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setplayerasstandalonegroup&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setplayerasstandalonegroup&name=Woon_Kamer -- use _ for spaces in the name

-- Get extra / more details from player like MAC address and icons etc, can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getsonosplayer&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getsonosplayer&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getsonosplayer&name=Woon_Kamer -- use _ for spaces in the name

-- Get limited transport details from player like position, duration and volume, can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata (fastpolling)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getstate&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getstate&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getstate&name=Woon_Kamer -- use _ for spaces in the name

-- Get extended transport details from player same as getstate with extra's like current albumart, shuffle, crossfade, repeats etc, can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata (slowpolling)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getextendedstate&uuid=RINCON_000E5821B62C01400&createbaseimg=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getextendedstate&ip=192.168.10.31&createbaseimg=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getextendedstate&name=Woon_Kamer&createbaseimg=false -- use _ for spaces in the name

-- Get current albumart URL, can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata (slowpolling)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getalbumart&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getalbumart&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getalbumart&name=Woon_Kamer -- use _ for spaces in the name

-- Get stored playlist(s) and corresponding playlist numbers (numbers are needed to call them), can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getplaylists&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getplaylists&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getplaylists&name=Woon_Kamer -- use _ for spaces in the name

-- Store current qeueu as new playlist, there must be a paramater 'listname' send for the name of the new list 'listname', can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=saveplaylist&uuid=RINCON_000E5821B62C01400&listname=newplaylist
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=saveplaylist&ip=192.168.10.31&listname=newplaylist
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=saveplaylist&name=Woon_Kamer&listname=newplaylist  -- use _ for spaces in the name

-- Get stored items inside playlist, must be called by corresponding playlist numbers (numbers are needed to call them), can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getplaylistitems&uuid=RINCON_000E5821B62C01400&listnumber=9
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getplaylistitems&ip=192.168.10.31&listnumber=9
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getplaylistitems&name=Woon_Kamer&listnumber=9 -- use _ for spaces in the name

-- Get current items in queueu including all additional information like track URI, Artist, Album, Albumart etc. can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getqueue&uuid=RINCON_000E5821B62C01400&createbaseimg=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getqueue&ip=192.168.10.31&createbaseimg=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getqueue&name=Woon_Kamer&createbaseimg=false -- use _ for spaces in the name

-- Get current items in favorites including all additional information like track URI, Station, Track, Remote Albumart (not always present) and Local Albumart URI (always present) etc. can be resolved by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getfavorites&uuid=RINCON_000E5821B62C01400&createbaseimg=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getfavorites&ip=192.168.10.31&createbaseimg=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getfavorites&name=Woon_Kamer&createbaseimg=false -- use _ for spaces in the name

-- Execute 'play' command on player, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=play&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=play&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=play&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'play with queue check' command on player, this will check if there is a track in the 'queue', if not the first stored playlist will be loaded to avoid no sound situations, can be called by RINCON or IP (IP and RINCON are found by getsonosdata
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playqueue&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playqueue&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playqueue&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'seek' command on player, this will require the paramter position to jump to that time, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=seek&uuid=RINCON_000E5821B62C01400&position=0:01:23
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=seek&ip=192.168.10.31&position=0:01:23
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=seek&name=Woon_Kamer&position=0:01:23 -- use _ for spaces in the name

-- Execute 'load uri' from queue or favorites (radio streams) command on player, set listtype to 'queue' or 'favorites' and 'listnumber' to the x number track/station in the list. The listnumber is checked on valid range.
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loaduri&uuid=RINCON_000E5821B62C01400&listtype=queue&listnumber=1
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loaduri&ip=192.168.10.31&listtype=queue&listnumber=1
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loaduri&name=Woon_Kamer&listtype=queue&listnumber=1 -- use _ for spaces in the name

-- Execute 'load and play uri' from queue or favorites (radio streams) command on player, set listtype to 'queue' or 'favorites' and 'listnumber' to the x number track/station in the list. The listnumber is checked on valid range.
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playuri&uuid=RINCON_000E5821B62C01400&listtype=queue&listnumber=1
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playuri&ip=192.168.10.31&listtype=queue&listnumber=1
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playuri&name=Woon_Kamer&listtype=queue&listnumber=1 -- use _ for spaces in the name

-- Execute 'load and play uri' from queue list by number (needed to keep next and previous working) command on player, set listtype to 'queue' or 'favorites' and 'listnumber' to the x number track/station in the list. The listnumber is checked on valid range.
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playqueueuri&uuid=RINCON_000E5821B62C01400&listnumber=1
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playqueueuri&ip=192.168.10.31&listnumber=1
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=playqueueuri&name=Woon_Kamer&listnumber=1 -- use _ for spaces in the name

-- Execute 'stop' command on player, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=stop&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=stop&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=stop&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'next' command on player, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=next&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=next&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=next&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'previous' command on player, can be called by RINCON or IP (IP and RINCON are found by getsonosdata
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=previous&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=previous&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=previous&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'mute' command on player, can be called by RINCON or IP (IP and RINCON are found by getsonosdata
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=mute&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=mute&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=mute&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'groupmute' command on player, can be called by RINCON or IP (IP and RINCON are found by getsonosdata
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupmute&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupmute&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupmute&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'unmute' command on player, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=unmute&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=unmute&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=unmute&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'groupunmute' command on player, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupunmute&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupunmute&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupunmute&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'set volume' command on player, volume must be send as parameter and will be checked on scope 0-100, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolume&uuid=RINCON_000E5821B62C01400&volume=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolume&ip=192.168.10.31&volume=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolume&name=Woon_Kamer&volume=10 -- use _ for spaces in the name

-- Execute 'group set volume' command on player, volume must be send as parameter and will be checked on scope 0-100, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolume&uuid=RINCON_000E5821B62C01400&volume=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolume&ip=192.168.10.31&volume=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolume&name=Woon_Kamer&volume=10 -- use _ for spaces in the name

-- Execute 'volume up' command on player, volume step must be send as parameter and will be checked on scope 0-50 and top / floor limits, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolumeup&uuid=RINCON_000E5821B62C01400&step=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolumeup&ip=192.168.10.31&step=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolumeup&name=Woon_Kamer&step=10 -- use _ for spaces in the name

-- Execute 'group volume up' command on player, volume step must be send as parameter and will be checked on scope 0-50 and top / floor limits, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolumeup&uuid=RINCON_000E5821B62C01400&step=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolumeup&ip=192.168.10.31&step=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolumeup&name=Woon_Kamer&step=10 -- use _ for spaces in the name

-- Execute 'volume down' command on player, volume step must be send as parameter and will be checked on scope 0-50 and top / floor limits, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolumedown&uuid=RINCON_000E5821B62C01400&step=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolumedown&ip=192.168.10.31&step=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setvolumedown&name=Woon_Kamer&step=10 -- use _ for spaces in the name

-- Execute 'group volume down' command on player, volume step must be send as parameter and will be checked on scope 0-50 and top / floor limits, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=snapshotgroupvolume&uuid=RINCON_000E5821B62C01400
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=snapshotgroupvolume&ip=192.168.10.31
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=snapshotgroupvolume&name=Woon_Kamer -- use _ for spaces in the name

-- Execute 'snapshot group volume' command on player, volume step must be send as parameter and will be checked on scope 0-50 and top / floor limits, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolumedown&uuid=RINCON_000E5821B62C01400&step=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolumedown&ip=192.168.10.31&step=10
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=groupsetvolumedown&name=Woon_Kamer&step=10 -- use _ for spaces in the name

-- Execute 'crossfade' command on player, state must be send as parameter, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setcrossfade&uuid=RINCON_000E5821B62C01400&state=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setcrossfade&ip=192.168.10.31&state=true
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setcrossfade&name=Woon_Kamer&state=true -- use _ for spaces in the name

-- Execute 'playmode' command on player, mode must be send as parameter (options: normal, repeat_all, repeat_one, shuffle_no_repeat, shuffle and shuffle_one , can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setplaymode&uuid=RINCON_000E5821B62C01400&mode=normal
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setplaymode&ip=192.168.10.31&mode=normal
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=setplaymode&name=Woon_Kamer&mode=normal -- use _ for spaces in the name

-- Execute 'load playlist into queue' command on player, 'listname' must be send as parameter and corresponding listnumber will be searched automaticly, also a autoplay parameter must be send to play direct after load, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loadplaylist&uuid=RINCON_000E5821B62C01400&listname=My Playlist&autoplay=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loadplaylist&ip=192.168.10.31&listname=My Playlist&autoplay=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loadplaylist&name=Woon_Kamer&listname=My Playlist&autoplay=false -- use _ for spaces in the name

-- Execute 'load playlist into queue' command on player, 'listnumber' must be send as parameter, also a autoplay parameter must be send to play direct after loading, can be called by RINCON or IP (IP and RINCON are found by getsonosdata)
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loadplaylist&uuid=RINCON_000E5821B62C01400&listnumber=9&autoplay=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loadplaylist&ip=192.168.10.31&listnumber=9&autoplay=false
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=loadplaylist&name=Woon_Kamer&listnumber=9&autoplay=false -- use _ for spaces in the name

-- Execute 'getbase64img' command on current selected player, 'listnumber' and 'tablename' must be send as parameter
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getbase64img&tablename=favorites&listnumber=1 --get's a base64 image of albmuart of the first item in the favorites list
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getbase64img&tablename=queue&listnumber=4 --get's a base64 image of albumart of the 4th item in the queue list
--http://192.168.10.202/apps/data/sonos/sonos.lp?action=getbase64img&tablename=state&listnumber=0 --get's a base64 image of albumart of the current playing item ( listnumber is always '0' must always be send because of checks in script )

BR,

Erwin van der Zwart

Hello I tested them below to play a song from a playlist but it does not work me can someone help me?

http://10.10.20.99/apps/data/sonos/sonos....10.20.254
http://10.10.20.99/apps/data/sonos/sonos...stnumber=1
http://10.10.20.99/apps/data/sonos/sonos...play=false
Reply
(18.08.2017, 11:02)Erwin van der Zwart Wrote: Hi,

Playlist are not always 1,2,3,4,5 if you remove a playlist it results in a gap in the numbering.

You can also call a playlist by name with the API so you don't need to know the list number.

You can also request the lists (and log the result) stored in the Sonos to see the available list numbers.

BR,

Erwin

Hi,
I call the list by number because calling by name doesn't work. I put &listname=Dj and there is no action....
And.. in case of it works, that don't solve the problem. Going from radio station to song list (in favorites) with command "playuri"

Thanks!!
Reply
Hi,

Sorry i gave wrong info, the numbering is always 1,2,3,4,5 etc, the gaps only counts for playlist id's.

I notice a mistake in loading a playlist, the play command is not executed after the load of a list (only with radio or single track), i will try to fix this in the next version.

For now you can solve it by sending a load command and after that the play command.

Code:
socket.http.request('http://127.0.0.1/apps/data/sonos/sonos.lp?action=playuri&ip=192.168.0.11&listtype=favorites&listnumber=1')
socket.http.request('http://127.0.0.1/apps/data/sonos/sonos.lp?action=play&ip=192.168.0.11')

BR,

Erwin


(18.08.2017, 12:08)kythas100Hello I tested them below to play a song from a playlist but it does not work me can someone help me? Wrote: http://10.10.20.99/apps/data/sonos/sonos....10.20.254
http://10.10.20.99/apps/data/sonos/sonos...stnumber=1
http://10.10.20.99/apps/data/sonos/sonos...play=false

Hi,

I assume your controller IP is 10.10.20.99 and your Sonos IP is 10.10.20.254

Run this from the browser to see the list ID's:

http://admin:admin@10.10.20.99/apps/data....10.20.254

Run this from script to call a list and use a listnumber received from command above:


Code:
socket.http.request('http://admin:admin@10.10.20.99/apps/data/sonos/sonos.lp?action=loadplaylist&ip=10.10.20.254&listnumber=1&autoplay=true')
 
BR,
Erwin
Reply
Hi, 

I continue with the test of the app to manage correctly lists of favorites, queue, etc..
I find some problems:

The command "loadplaylist" doesn't work.

Code:
socket.http.request('http://192.168.0.91/apps/data/sonos/sonos.lp?action=loadplaylist&uuid=RINCON_000E58C103D601400&listnumber=4&autoplay=true')

No action in Sonos. When i execute it in webbroser, it respondes "true".
It doens't load any list in queue (Neither by number nor by name).

The command "playuri" doesn't work when the "queue isn't in use" and you try to listen a list that need the queue.

Code:
socket.http.request('http://192.168.0.91/apps/data/sonos/sonos.lp?action=playuri&uuid=RINCON_000E58C103D601400&listtype=favorites&listnumber=3')

When you are listening a radio station, the queue is not in use. In this moment, you execute "playuri" with a playlist that require the queue (songs in mp3), and the songs are loaded in queue but it doen't play automaticaly. The queue appears "isn't in use" and you can't do a play or stop of the queue because it affects at the radiostation you are listening.

The command "loaduri" doesn't work.

Code:
socket.http.request('http://192.168.0.91/apps/data/sonos/sonos.lp?action=loaduri&uuid=RINCON_000E58C103D601400&&listtype=favorites&listnumber=4&autoplay=true')

No action in Sonos. When i execute it in webbroser, it respondes "ListaXXX is loaded", but it doesn`t load anything.

With this problems managing lists and queue, is imposible for me to complete the project.
I need to play songs and radiostations together with knx light scenes.
I think that other posibility is to use the command "say" to launch the songs, ex. loaded in homelynk memory. But this command neither work for me:


Code:
require('socket.http')
require('socket.url')
audiofile = socket.url.escape('http://ftp:ftp@192.168.0.91/Musica/track1.mp3')

socket.http.request('http://192.168.0.91/apps/data/sonos/sonos.lp?action=say&uuid=RINCON_000E58C103D601400&audiofile=' .. audiofile .. '&volume=30&duration=20')


Any help with this???
THANKS from Spain.

Iván.
Reply
Hi,

Can you try to execute the commands with credentials in the url?

http://admin:admin@127.0.0.1/...

BR,

Erwin


Verzonden vanaf mijn iPhone met Tapatalk
Reply


Forum Jump: