[dss-developer] Best way for polling state of devices
Hofmann, Christoph
christoph.hofmann at digitalstrom.com
Wed Jul 6 16:57:38 CEST 2016
Dear Aldo,
> I need to keep track of the states of the devices, and studing the JSON
> API i undestand that the only way to keep the track of the state of
> devices is asking one by one with a "HTTP GET
> /json/device/getOutputValue" in a constant polling. Im correct? or exist
> a better way to do this?
This is not a good idea and it is even not allowed to do many of these requests on the bus (see ds-basics for rules).
You could simply access the property tree and read the "lastCalledScene" for a combination of room and group. You can find it here: apartment->zones->zoneX->groups->groupY->lastCalledScene
It is also possible to subscribe for events. Then you will be informed when e.g. a scene is called in the system. See dss-json api documentation for more information.
Regs,
Christoph
--
Christoph Hofmann
Software Development
digitalSTROM GmbH
More information about the dss-developer
mailing list