28.05.2020, 06:26
(27.05.2020, 22:30)Erwin van der Zwart Wrote: 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 codeCode:-- Load modules
require('socket.http')
-- Set timout
socket.http.TIMEOUT = 5
socket.http.request('http://127.0.0.1/user/sonos.lp?action=refreshsonosdata')
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.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
Hi
OK, tried that, and then I get the following result from the storage;
Test Sonos 28.05.2020 08:24:53
* arg: 1
* nil
* arg: 2
* string: key not found or invalid type
I tried to replace the sonos.lp and do a new 'http://127.0.0.1/user/sonos.lp?action=refreshsonosdata', but still the same result. The log indicates that the sonos system is not really stored, is it not?
There are 10 kinds of people in the world; those who can read binary and those who don't