16.05.2017, 07:39
(This post was last modified: 16.05.2017, 07:41 by Erwin van der Zwart.)
Hi Roger,
You can request the state of the players in a resident script by using:
In the reply you have the needed fields to get the state of a player.
This methode is reguiring some CPU power, so currently we are working on a change to make this based on Sonos Event services, so we don't need to poll it all the time.
This change is done by one of our DEV's and not myself so i don't have a timeframe when this will be done.
BR,
Erwin
You can request the state of the players in a resident script by using:
Code:
-- Load modules
require('socket.http')
-- Set timout
socket.http.TIMEOUT = 5
reply = socket.http.request('http://127.0.0.1/apps/data/sonos/sonos.lp?action=getextendedstate&uuid=RINCON_000E5821B62C01400&createbaseimg=false')
-- or
reply = socket.http.request('http://127.0.0.1/apps/data/sonos/sonos.lp?action=getextendedstate&ip=192.168.10.31&createbaseimg=false')
-- or
reply = socket.http.request('http://127.0.0.1/apps/data/sonos/sonos.lp?action=getextendedstate&name=Woon_Kamer&createbaseimg=false') -- use _ for spaces in the name
In the reply you have the needed fields to get the state of a player.
This methode is reguiring some CPU power, so currently we are working on a change to make this based on Sonos Event services, so we don't need to poll it all the time.
This change is done by one of our DEV's and not myself so i don't have a timeframe when this will be done.
BR,
Erwin