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 - andeug - 01.05.2019

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...


RE: SONOS app - Daniel - 02.05.2019

(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.


RE: SONOS app - Bitver - 24.05.2019

(02.05.2019, 07:07)Daniel. Wrote:
(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.

And where I can find your new Sonos app API?


RE: SONOS app - Daniel - 24.05.2019

It is not ours, it is SONOS
https://developer.sonos.com/build/direct-control/


RE: SONOS app - Kam - 13.06.2019

(24.05.2019, 09:04)Daniel. Wrote: It is not ours, it is SONOS
https://developer.sonos.com/build/direct-control/

hi again Daniel,

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.

Many thanks,

Kam


RE: SONOS app - admin - 13.06.2019

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


RE: SONOS app - Daniel - 13.06.2019

And if you don't succeed here is old app
https://boards.wetransfer.com/board/st5kq90zh7athbvz820190509072939/latest


RE: SONOS app - Kam - 13.06.2019

(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

Worked like a charm.  Many thanks.


RE: SONOS app - Kam - 14.06.2019

(13.06.2019, 13:02)Daniel. Wrote: And if you don't succeed here is old app
https://boards.wetransfer.com/board/st5kq90zh7athbvz820190509072939/latest

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


RE: SONOS app - Daniel - 14.06.2019

(14.06.2019, 09:38)Kam Wrote:
(13.06.2019, 13:02)Daniel. Wrote: And if you don't succeed here is old app
https://boards.wetransfer.com/board/st5kq90zh7athbvz820190509072939/latest

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.


RE: SONOS app - Kam - 14.06.2019

(14.06.2019, 10:21)Daniel. Wrote:
(14.06.2019, 09:38)Kam Wrote:
(13.06.2019, 13:02)Daniel. Wrote: And if you don't succeed here is old app
https://boards.wetransfer.com/board/st5kq90zh7athbvz820190509072939/latest

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


RE: SONOS app - theodosiou - 17.06.2019

Is there a way to manually define the IP address of SONOS speakers?
I have them in a different VLAN than the LM4 and the app can not find them.

Thank you for your help!


RE: SONOS app - Evens - 08.07.2019

Hi,

Is there any way to change the color of the Sonos app? The green and white does not look very good to my black visualizationSmile

BR Even Sundgot.


RE: SONOS app - andeug - 21.07.2019

I still haven't managed to figure out why the app works only via the web page after accessing my LM4

   

but it does not works while running any of the scripts that they have been working before:

   

Do you see any abnormal configuration on the below script? 

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

-- Set timout
socket.http.TIMEOUT = 5

-- 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.


RE: SONOS app - Erwin van der Zwart - 21.07.2019

Hi,

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

BR,

Erwin


RE: SONOS app - thomasoppida - 01.08.2019

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


RE: SONOS app - admin - 01.08.2019

You are missing quotes in ip address parameter. It should be ip=' .. Stue .. '&volume=


RE: SONOS app - thomasoppida - 01.08.2019

Thank you, but still returns the same error
   


RE: SONOS app - admin - 01.08.2019

You are probably missing user/sonos.lua file. Have you uploaded both files (sonos.lp and sonos.lua) to FTP?


RE: SONOS app - thomasoppida - 01.08.2019

Thank you very much :-)

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"

Thank you for your support, very appreciated. :-)