01.05.2019, 22:18 (This post was last modified: 01.05.2019, 22:19 by andeug.)
Daniel, is there a current permanent fix that would restore my Sonos script? Or do we have to wait until the Sonos Logic Machine application will be updated by its developer?
I was so happy with it, then suddenly it has stopped working...
(01.05.2019, 22:18)andeug Wrote: Daniel, is there a current permanent fix that would restore my Sonos script? Or do we have to wait until the Sonos Logic Machine application will be updated by its developer?
I was so happy with it, then suddenly it has stopped working...
This new Sonos APP is totally different from old one. This APP was tested and approve by the SONOS itself and they were against all the custom functionality the previous app did. You have 2 options:
1. Use new app and old libraries, just change location of them in your script.
2. Use old app, I can provide you the link. By using the old app you take a risk that it might stop working one day if sonos block old API. Nobody knows if this happen and when.
(01.05.2019, 22:18)andeug Wrote: Daniel, is there a current permanent fix that would restore my Sonos script? Or do we have to wait until the Sonos Logic Machine application will be updated by its developer?
I was so happy with it, then suddenly it has stopped working...
This new Sonos APP is totally different from old one. This APP was tested and approve by the SONOS itself and they were against all the custom functionality the previous app did. You have 2 options:
1. Use new app and old libraries, just change location of them in your script.
2. Use old app, I can provide you the link. By using the old app you take a risk that it might stop working one day if sonos block old API. Nobody knows if this happen and when.
After the new version of Sonos App, my LM5 objects (4/1/1, ...) do not work any more. Basically I cannot communicate with Sonos from the LM5 scripts, commands, etc. I read in the articles that I have to upload old sonos.lua and sonos.lp to the/user directory. Is that the right solution? If yes, I also appreciate the instruction/guide on how to do that. I've never done this and I don't even know how to FTP it. Any referral to the right direction will be highy appreciated.
Enable FTP server and set password for apps user in System config > Services > FTP Server
Connect via regular FTP client using apps user and copy both files to user directory there
Change path in your scripts to /user/sonos.lp instead of /apps/data/sonos/sonos.lp
(13.06.2019, 13:00)admin Wrote: Enable FTP server and set password for apps user in System config > Services > FTP Server
Connect via regular FTP client using apps user and copy both files to user directory there
Change path in your scripts to /user/sonos.lp instead of /apps/data/sonos/sonos.lp
One more question:The new Sonos App automatically created all the new group addresses and assigned them to each widget. However, when I change the control of one room (in Mosaic or directly on the control object), it does it for ALL the rooms at the same time, eg, if I pause a song in one room, it stops in all the rooms. Is this an issue related to Sonos or LM?
If I can't fix this I may have to switch back to the old Sonos app that you have already sent me.
One more question:The new Sonos App automatically created all the new group addresses and assigned them to each widget. However, when I change the control of one room (in Mosaic or directly on the control object), it does it for ALL the rooms at the same time, eg, if I pause a song in one room, it stops in all the rooms. Is this an issue related to Sonos or LM?
If I can't fix this I may have to switch back to the old Sonos app that you have already sent me.
Thanks,
Kam
Hm, didn't you group them by any chance? I don't have more than one player to test it. I asked app developer to check and they will do it next week.
One more question:The new Sonos App automatically created all the new group addresses and assigned them to each widget. However, when I change the control of one room (in Mosaic or directly on the control object), it does it for ALL the rooms at the same time, eg, if I pause a song in one room, it stops in all the rooms. Is this an issue related to Sonos or LM?
If I can't fix this I may have to switch back to the old Sonos app that you have already sent me.
Thanks,
Kam
Hm, didn't you group them by any chance? I don't have more than one player to test it. I asked app developer to check and they will do it next week.
I did both grouping and un-grouping with the same result. Thanks for checking with the app dev. team and I look forward to learning the response and have a nice weekend.
Kam
-- Set SONOS ip
Sonos_Kitchen_ip = '10.20.30.20'
Sonos_Living_ip = '10.20.30.30'
Sonos_Bedroom_ip = '10.20.30.40'
Sonos_Office_ip = '10.20.30.50'
-- Get event value
value = event.getvalue()
-- Set stepsize volume
Volume_Step = 5
-- Set Action
if value == 0 then
Sonos_Action = 'stop'
else
action = 'none'
end
-- Execute action on value 0
if value >= 0 and value < 1 then
local reply = socket.http.request('http://admin:passwordnotdisclosed@127.0.0.1/user/sonos.lp?action=' .. Sonos_Action .. '&ip=' .. Sonos_Kitchen_ip .. '')
end
-- Execute action on value 0
if value >= 0 and value < 1 then
local reply = socket.http.request('http://admin:passwordnotdisclosed@127.0.0.1/user/sonos.lp?action=' .. Sonos_Action .. '&ip=' .. Sonos_Living_ip .. '')
end
-- Execute action on value 0
if value >= 0 and value < 1 then
local reply = socket.http.request('http://admin:passwordnotdisclosed@127.0.0.1/user/sonos.lp?action=' .. Sonos_Action .. '&ip=' .. Sonos_Bedroom_ip .. '')
end
-- Execute action on value 0
if value >= 0 and value < 1 then
local reply = socket.http.request('http://admin:passwordnotdisclosed@127.0.0.1/user/sonos.lp?action=' .. Sonos_Action .. '&ip=' .. Sonos_Office_ip .. '')
end
I have also added sonos.lua and sonos.lp files in the same /user/ folder of my LM4. (you can find them enclosed)
Please note that my LM4's IP is 10.20.30.5 and the Sonos players have all the IP addresses mentioned in the script.
You only need sonos.lp and this API has nothing to do with the Sonos app and you can use it even without the app installed..
I wrote this API for the previous version of the Sonos app but due to the certifcation of the Sonos app we where not allowed to embed the API in it.
You can use it separate like you do now, but there needs to be a table with your players before you can execute commands like you do now.
The table was created by the previous app on startup of the app so you did not need to take care of it, but now you use it seperate from the app so you must ttigger it at least one time, my recommendation is to run the command more often for any case something changes in your Sonos setup.
These are the command(s) that you need to trigger, use one of them as you think fits the action.
Code:
-- 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://127.0.0.1/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://127.0.0.1/apps/data/sonos/sonos.lp?action=refreshsonosdata
That did the trick... I noticed in post #226 that Erwin said u only needed the Sonos.IP
He wrote "Sonos.lua is not needed, it just holds a sample how to use the sonos.lp file"