09.09.2019, 11:45 (This post was last modified: 09.09.2019, 11:47 by Hippolyte.)
Hello everyone
I have been following this conversation for the last year and implementend the SE version which was working nicely.
I'd like to test this new app and more specifically the new Sonos API. Has anyone manage to control their Sonos with the new API ?
I am completely stuck with all theses :
Create authorization code -> https://developer.sonos.com/reference/au...tion-code/
Create token -> https://developer.sonos.com/reference/au...ate-token/
etc ...
I don't know what part is already done by the LM Sonos App itself and what part should I do to have a simple script doing play/pause (without using the objects automatically created but fully Sonos API) ? https://developer.sonos.com/reference/co...back/play/
Anyone could help us on that ?
Thank you very much.
10.09.2019, 21:47 (This post was last modified: 10.09.2019, 21:50 by Erwin van der Zwart.)
Hi,
The old version of the Sonos app was created by me, in that app i created a self build API that was able to receive HTTP command with arguments and those where converted to LUA commands to SOAP (UpnP).
The new version of the app is build by our development department and the decission was made to certify the app to be able to use the official Sonos API, due to this certification we where forced to drop the self build API in the app. Now you can only use the objects that are created automatically by adding them to the touch application.
There is no build in mechanisme to send HTTP commands to the app anymore in the new version.
We still can use the old .lp API by uploading it to the ftp folder, but i still need to make some adjustments as the old app performed a auto scan of Sonos devices on startup that is now missing in the .lp file, but i have no time this moment to do it.
The app runs a daemon which keeps communication with each player/group The daemon will be closed down after 120s if no update is send so we need to run such script every 60s to keep communication up and running.
Code:
123456
require('custom.sonos.lib')
groupID=sonos_app.GetStoragePlayerGroups()
fork, vinpairs(groupID) dosonos_app.SendApiActionCommand(k, 'watchPlayerGroup', os.time())
end
To control the players we need to know groupID which can be read via such command.
-- set volumesonos_app.SendApiActionCommand(url_group_id, 'setVolume', 50)
The url_group_id is in the table from the groupID but it can be read automatically when we know group name so example start/pause script would looks like that.
06.10.2019, 13:09 (This post was last modified: 06.10.2019, 13:12 by Trond Hoyem.)
(11.09.2019, 07:47)Daniel. Wrote: Hi
Here is how to use new Sonos app via script:
The app runs a daemon which keeps communication with each player/group The daemon will be closed down after 120s if no update is send so we need to run such script every 60s to keep communication up and running.
Code:
123456
require('custom.sonos.lib')
groupID=sonos_app.GetStoragePlayerGroups()
fork, vinpairs(groupID) dosonos_app.SendApiActionCommand(k, 'watchPlayerGroup', os.time())
end
Hi Daniel
Is there a command for reading the volume level? If one wants a slider for volume, it would be good to be able to update the slider if the volume is changed from somewhere else than the LM-object.
There are 10 kinds of people in the world; those who can read binary and those who don't
New app do not support those libraries. You can install old app, link below, or you can manually upload libraries from old app. All was explained here just read this thread few pages back. https://forum.logicmachine.net/showthrea...3#pid13173
Just tested this, and is still working, you cannot send a mp3 to the Sonos from a password secured location so you must disable the password of the user folder or use a different source location.
28.10.2019, 14:12 (This post was last modified: 28.10.2019, 14:14 by Igor68.)
(28.10.2019, 13:18)Эрвин ван дер Цварт Wrote: Привет,
только что проверил это и все еще работает, вы не можете отправить mp3 на Sonos из защищенного паролем места, поэтому вы должны отключить пароль пользовательской папки или использовать другое местоположение источника.
БР,
Эрвин
Эрвин, привет, правда. ) Все работает, но файл недоступен. Как отключить пароль для ftr? На вкладке вы можете только ввести другой пароль ....
Все работает, но файл недоступен. Как отключить пароль для ftr? На вкладке вы можете только ввести другой пароль ....
Erwin, hi, really. ) Everything works, but the file is not available. How to disable password for ftr? In the tab you can only enter another password ....
sorry for my English))
28.10.2019, 15:42 (This post was last modified: 28.10.2019, 15:43 by Erwin van der Zwart.)
Hi,
On the bottom of the user access tab there is a button "User access settings" uncheck the checkbox "Enable password for User directory", any source in the user folder is now reachable without the need of a password so Sonos should be able to access it.
Erwin, I can’t remove the password. I followed all your instructions, but the password remains, I can access the apps with only a password. Did a soft reset. Any other ideas?
When running http://192.168.0.10/user/Mix_Lastochka.mp3 in the browser (new session, no other sessions open) it should play the .mp3, if that works then Sonos should be able to reach it..
09.12.2019, 15:19 (This post was last modified: 09.12.2019, 15:19 by Hippolyte.)
Hello everyone,
we the previous version of the Sonos app when someone physically pressed the volume button on the Sonos it updated the value on the appropriate object on the LM.
Is it still possible with the new app ?
I know I can do a resident on groupstate = storage.get('app: se-sa:' .. groupID .. ':GroupVolume') to get the updated value yet it is not really elegant way of having the updated value if the user physically pressed the volume button
Thank you for you help.