Posts: 4663
Threads: 24
Joined: Aug 2017
Reputation:
213
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.
------------------------------
Ctrl+F5
Posts: 30
Threads: 6
Joined: Nov 2019
Reputation:
0
>-- play playlist by ID
>sonos_app.SendApiActionCommand(url_group_id, 'playPlaylist', playlist_id)
How can I play, a playlist with repeat?
Posts: 4663
Threads: 24
Joined: Aug 2017
Reputation:
213
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
------------------------------
Ctrl+F5
Posts: 30
Threads: 6
Joined: Nov 2019
Reputation:
0
Posts: 4663
Threads: 24
Joined: Aug 2017
Reputation:
213
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.
------------------------------
Ctrl+F5
Posts: 185
Threads: 38
Joined: Feb 2017
Reputation:
3
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.
There are 10 kinds of people in the world; those who can read binary and those who don't
Posts: 4663
Threads: 24
Joined: Aug 2017
Reputation:
213
No such thing in the current API, You can still use old one. It was explained here how to do it.
------------------------------
Ctrl+F5
Posts: 185
Threads: 38
Joined: Feb 2017
Reputation:
3
(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')
There are 10 kinds of people in the world; those who can read binary and those who don't
Posts: 4663
Threads: 24
Joined: Aug 2017
Reputation:
213
------------------------------
Ctrl+F5
Posts: 185
Threads: 38
Joined: Feb 2017
Reputation:
3
13.01.2020, 12:02
(This post was last modified: 13.01.2020, 12:32 by Trond Hoyem.)
(13.01.2020, 11:53)Daniel. Wrote: Do you mean this?
https://forum.logicmachine.net/showthrea...1#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/showthrea...1#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?
There are 10 kinds of people in the world; those who can read binary and those who don't
Posts: 26
Threads: 2
Joined: Jul 2015
Reputation:
0
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 !
Posts: 161
Threads: 28
Joined: May 2017
Reputation:
2
19.03.2020, 22:09
(This post was last modified: 19.03.2020, 22:11 by balatis.)
Hi
i have a problem with app sonos
on place floor and room i can't write anything.
Thanks in advance
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
Hi,
You have to create the room and floor in Touch / Mosaic, then you can select them from drop down menu..
BR,
Erwin
Posts: 161
Threads: 28
Joined: May 2017
Reputation:
2
(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.
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
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
Posts: 161
Threads: 28
Joined: May 2017
Reputation:
2
(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
Posts: 92
Threads: 16
Joined: Jan 2020
Reputation:
2
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?
Posts: 185
Threads: 38
Joined: Feb 2017
Reputation:
3
(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)
There are 10 kinds of people in the world; those who can read binary and those who don't
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
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
Posts: 185
Threads: 38
Joined: Feb 2017
Reputation:
3
(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...
There are 10 kinds of people in the world; those who can read binary and those who don't
|