Logic Machine Forum
SONOS app - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Application Store (https://forum.logicmachine.net/forumdisplay.php?fid=11)
+--- Thread: SONOS app (/showthread.php?tid=415)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


RE: SONOS app - Daniel - 16.12.2019

Unfortunately there is no such option in this version. You can play specific playlist if that will be your door bell. As alternative you can still use it old way only you have to upload old libraries manually. It was explained here earlier.


RE: SONOS app - zuuper - 28.12.2019

>-- play playlist by ID
>sonos_app.SendApiActionCommand(url_group_id, 'playPlaylist', playlist_id)

How can I play, a playlist with repeat?


RE: SONOS app - Daniel - 29.12.2019

To set Repeat try this

Code:
-- set volume
sonos_app.SendApiActionCommand(url_group_id, 'setPlayModes', 'repeat')
Not tested so might not work.  Instead repeat also try ['repeat']  other options for 'setPlayModes' are:
  • repeatOne
  • crossfade
  • shuffle



RE: SONOS app - zuuper - 29.12.2019

It does not work.. :-(


RE: SONOS app - Daniel - 30.12.2019

You can just add the player to group and then create widget in Mosaic, after that all the control objects will be created. Repeat will be one of them. I will check this once back to office after the brake.


RE: SONOS app - Trond Hoyem - 03.01.2020

Hi
Is there a command for controlling one single planer? I am only finding groups, but my customer are regrouping all the time, so working with groups will not be so good.


RE: SONOS app - Daniel - 03.01.2020

No such thing in the current API, You can still use old one. It was explained here how to do it.


RE: SONOS app - Trond Hoyem - 13.01.2020

(01.08.2019, 06:18)admin Wrote: You are probably missing user/sonos.lua file. Have you uploaded both files (sonos.lp and sonos.lua) to FTP?

I am trying this as well, and get the same error. I have uploaded both the files to /user.

I got the files from post #83, but maybe there is something wrong in one of them? Is there another place I can dowload the two files?
Or maybe I have another problem?
The code I have is; 

Code:
require('json')
require('socket.http')
reply = socket.http.request('http://admin:password@192.168.1.9/user/sonos.lp?action=getsonosdata')



RE: SONOS app - Daniel - 13.01.2020

Do you mean this?
https://forum.logicmachine.net/showthread.php?tid=415&pid=12301#pid12301


RE: SONOS app - Trond Hoyem - 13.01.2020

(13.01.2020, 11:53)Daniel. Wrote: Do you mean this?
https://forum.logicmachine.net/showthread.php?tid=415&pid=12301#pid12301
Yep, thx

There must have been something wrong with the one I had, because now it seems to work.

(13.01.2020, 12:02)Trond Hoyem Wrote:
(13.01.2020, 11:53)Daniel. Wrote: Do you mean this?
https://forum.logicmachine.net/showthread.php?tid=415&pid=12301#pid12301
Yep, thx

There must have been something wrong with the one I had, because now it seems to work.

OK, so now the connection seem to work, but I am not able to play a file. I have found a code for this, but so far nothing happens.
What I have is; 

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

-- Set timout
socket.http.TIMEOUT = 5

reply = socket.http.request('http://admin:hoyemknx@127.0.0.1/user/sonos.lp?action=getextendedstate&uuid=RINCON_7828CAF5CEC201400&createbaseimg=false')

log(reply)

audiofile = socket.url.escape('http://127.0.0.1/user/Ringeklokke.mp3')
reply = socket.http.request('http://admin:hoyemknx@127.0.0.1/user/sonos.lp?action=say&name=Kjøkken&audiofile=' .. audiofile .. '&volume=30&duration=55')

log(reply)

The logs I get from this is;
1. * string: {"TrackIndex":1,"Playmode":"NORMAL","Crossfade":0,"Repeat":false,"PlayingTime":"0.... - So this seems OK
2. * nil 

Any ideas?


RE: SONOS app - Hippolyte - 10.02.2020

Hello everyone,

There is a big delay (like one second and a half) when we use the sonos_app.SendApiActionCommand(groupID, 'play') function, do you have any idea how we could decrease this time ?
Thank you very much for your help !


RE: SONOS app - balatis - 19.03.2020

Hi 
i have a problem with app sonos 
on place floor and room i can't write anything.
Thanks in advance


RE: SONOS app - Erwin van der Zwart - 19.03.2020

Hi,

You have to create the room and floor in Touch / Mosaic, then you can select them from drop down menu..

BR,

Erwin


RE: SONOS app - balatis - 19.03.2020

(19.03.2020, 22:14)Erwin van der Zwart Wrote: Hi,

You have to create the room and floor in Touch / Mosaic, then you can select them from drop down menu..

BR,

Erwin
Hi Erwin thanks for answer , i have  floor and room in mosaic.


RE: SONOS app - Erwin van der Zwart - 19.03.2020

Hi,

You probably created them in Mosaic 3? Try adding them in Mosaic 2, Our Touch (and our Sonos app) is currently based on 2 (new Touch based on 3 is in dev)

BR,

Erwin


RE: SONOS app - balatis - 19.03.2020

(19.03.2020, 22:27)Erwin van der Zwart Wrote: Hi,

You probably created them in Mosaic 3? Try adding them in Mosaic 2, Our Touch (and our Sonos app) is currently based on 2 (new Touch based on 3 is in dev)

BR,

Erwin
yes this was the problem....thanks


RE: SONOS app - victor.back - 11.04.2020

Hi,

I have a problem with the Sonos App, I doesn´t find any players in the groups anymore. Is it something I can do to fix this without configurate everything again?


RE: SONOS app - Trond Hoyem - 27.05.2020

(01.08.2019, 05:20)thomasoppida Wrote: Hi,

I am struggling a bit with the Sonos integration using the old api. 
I have a Homelynk with fw 2.3.0 and Sonos with 10.3 

Everything I create returns this error, but different line number. Is there something wrong with my script?



kind regards, 
Thomas Elvrum Lassen

Hi

I am struggling with this function as well. It did work earlier, but now it is no longer working properly. 

When I run the script, I want a mp3-file in the LM to play on a certain sonos player. If the player was already playing something, it should return to that after teh mp3 is done. This was working.
What is happening now is that if there is no ongoing songs, the mp3 is played and the reply from the function is 'true'. But if something is playing, I get the following error:
'Error in /www/user/sonos.lua at line 0: attempt to get length of a nil value'

The code (sorry for messy code, as I am still in test-mode):

Quote:
Code:
require('socket.http')
socket.http.timeout = 5
socket.http.request('http://127.0.0.1/user/sonos.lp?action=getsonosdata')
--socket.http.request('http://127.0.0.1/apps/data/sonos/sonos.lp?action=refreshsonosdata')
require('custom.sonos.lib')



PlayerID = 'RINCON_347E5C3B47D801400' --Kontor
--PlayerID = 'RINCON_347E5C35715E01400' --Stue
audiofile = socket.url.escape('http://192.168.39.10/user/Ringeklokke.mp3')

reply = socket.http.request('http://admin:PASSWORD@127.0.0.1/user/sonos.lp?action=say&uuid=' .. PlayerID .. '&audiofile=' .. audiofile .. '&volume=10&duration=10')

log(reply)



RE: SONOS app - Erwin van der Zwart - 27.05.2020

Hi,

You are mixing up things, you use custom.sonos.lib (new app) with sonos.lp (old app) commands..

I assume you updated the app to the new one, but did you uploaded the sonos.lp to the ftp folder? 

Sonos 'say' function is not availeble in the new app as this app is now certified by Sonos and is custom stuff is not allowed, so you cant use the new API custom.sonos.lib for this.

You should use the old app or upload sonos.lp manual and adjust your script accordingly ..

BR,

Erwin


RE: SONOS app - Trond Hoyem - 27.05.2020

(27.05.2020, 11:53)Erwin van der Zwart Wrote: Hi,

You are mixing up things, you use custom.sonos.lib (new app) with sonos.lp (old app) commands..

I assume you updated the app to the new one, but did you uploaded the sonos.lp to the ftp folder? 

Sonos 'say' function is not availeble in the new app as this app is now certified by Sonos and is custom stuff is not allowed, so you cant use the new API custom.sonos.lib for this.

You should use the old app or upload sonos.lp manual and adjust your script accordingly ..

BR,

Erwin
Yes, I have uploaded the sonos.lp manually, along with the sonos.lua.

The thing is that last time I was testing this function, it worked, and now it does not work...