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 whether you accept or reject these cookies being set.

SONOS app
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.
Reply
>-- play playlist by ID
>sonos_app.SendApiActionCommand(url_group_id, 'playPlaylist', playlist_id)

How can I play, a playlist with repeat?
Reply
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
Reply
It does not work.. :-(
Reply
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.
Reply
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  Cool
Reply
No such thing in the current API, You can still use old one. It was explained here how to do it.
Reply
(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  Cool
Reply
Do you mean this?
https://forum.logicmachine.net/showthrea...1#pid12301
Reply
(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  Cool
Reply


Forum Jump: