27.05.2020, 22:30
(This post was last modified: 27.05.2020, 22:50 by Erwin van der Zwart.)
Hi,
The old Sonos app triggered on startup a command to find the players and stored the result in the storage, now that you use the sonos.lp separate from the app you need to execute this command at least once before using the sonos.lp and you need to run it whenever a change in your Sonos setup occurs.
I guess the reason that it suddenly stopped is that you used it before with the old app (so the players table was already created) and the players have got a new IP address or something that not match the one in the players table.
You can create or renew the players table by calling this
You can check the players table content by the storage viewer app or run this code
I noticed in your last post that you also uploaded sonos.lua to the ftp, this is not needed, sonos.lp is the only file you need to use the API from the old Sonos app, next to that a additional .mp3 file to use for the "say" or "sayall" command.
Keep in mind that sonos.lp is 100% build on the UpnP protocol that Sonos is using and they recently opened up the Sonos API where the new certified Sonos app is build on. It might happen one day that Sonos drops the UpnP part in the product and sonos.lp is not usable anymore, but for now i have no indication that Sonos is dropping the UpnP methode.
BR,
Erwin
The old Sonos app triggered on startup a command to find the players and stored the result in the storage, now that you use the sonos.lp separate from the app you need to execute this command at least once before using the sonos.lp and you need to run it whenever a change in your Sonos setup occurs.
I guess the reason that it suddenly stopped is that you used it before with the old app (so the players table was already created) and the players have got a new IP address or something that not match the one in the players table.
You can create or renew the players table by calling this
Code:
-- Load modules
require('socket.http')
-- Set timout
socket.http.TIMEOUT = 5
socket.http.request('http://127.0.0.1/user/sonos.lp?action=refreshsonosdata')
Code:
log(storage.get('SONOS_PLAYERS'))
Keep in mind that sonos.lp is 100% build on the UpnP protocol that Sonos is using and they recently opened up the Sonos API where the new certified Sonos app is build on. It might happen one day that Sonos drops the UpnP part in the product and sonos.lp is not usable anymore, but for now i have no indication that Sonos is dropping the UpnP methode.
BR,
Erwin