ChriD / Raumserver

Raumserver - A HTTP Request Server to control the RF-Multiroom System
32 stars 11 forks source link

why are on render request not all rooms returned? #4

Closed holli73 closed 8 years ago

holli73 commented 8 years ago

hello,

i need to get the states of all rooms and i found that the (webfrontend) is using 'getrendererstate'

so i make follwoing request

curl --tcp-nodelay --max-time 5 "http://x.x.x.x:8080/raumserver/json/getrendererstate?_" |json -aM .value |json -aM .zoneName .volume .transportState .zoneUDN > /home/dss/ds/raumfeld/state.txt

this returns only:

dss@fernsehen:~/ds/raumfeld$ cat state.txt
Schlafzimmer 20 STOPPED uuid:xxx
Bad 29 PLAYING uuid:xxx
Kueche 22 STOPPED uuid:xxx

but the R in the raumserver return's all rooms - so how do i get all rooms and states?

ROOM:  wc-og (uuid:xxx)                                
ROOM:  Wohnzimmer (uuid:xxx)
ROOM:  Schlafzimmer (uuid:xxx)
ROOM:  Bad (uuid:xxx)
ROOM:  Kueche (uuid:xxx) 

thanks holli

ChriD commented 8 years ago

The "getRendererState" only returns the informations for the "virtual Renderers" (Zone renderers) Raumfeld only uses the virtual renderers for playing a stream and does not set the uri's directly to the renderers.

So in your case for the "Wohnzimmer" renderer there is no virtual renderer (so there is no zone defined for the Wohnzimmer). If you take your Controller and choose the "Wohnzimmer" then RF will create a virtual Renderer for it and it will appear in the list ´ STATE Information of non virtual renderers is in fact useless for Controlling RF (only the virtual renderers can be controlled)

You can get the "unasigned" renderers with another json request "getroomlist" or "getzonelist" But the state of these unasigned renderers, which are not linked to a virtual renderer, is not available

Why do you need the state for the unassigned renderers? If there is a good reason i may add it to the new Version (but in fact the state of unasigned renderes will always be "Stopped" with no URI and no URI METADATA except the renderer is controlled by another System than RF

holli73 commented 8 years ago

hello,

thanks for the information - the main usage of my rf devices is done through my own app and not through the rf-app - why - if have many different devices/systems (digitalstrom/1-wire/ip-relays/i2c/zigbee/rf/...) and i need to connect all of them somehow together - i use an enterprise scheduler (automic) for my complete home automation and with this system - i query all different systems and collect information in a mysql db - with a sails (node.js) app i control all this through the DB and the scheduler is executing the needed actions - so for my collector it would be good to have one request to get all - but - i can code arround - if the room is not within this list i can set them to stopped as well - this is just a nice to have and keep my code simple.

thanks holli

ChriD commented 8 years ago

If i find a nice approach i will consider it in the new kernel

ChriD commented 8 years ago

The new version will return non assigned rooms win the request if the request is called with the 'listAll' option. eg.: http://10.0.0.1:8080/raumserver/data/getRendererState?listAll=1