Page 1 of 1

Is it possible to get domoticz values other then via JSON URLs?

Posted: Friday 15 July 2016 12:32
by Timmiej93
So I had written some scripts for my RPi, which basically do this:
- Get current dimmer value for all lights (via JSON URL)
- Turn lights x, y, & z off (if on)
- If light a's dimmer level is <5%, set to 5, if <10%, set to 10, etc.

This all works fine, but does take quite some time. I'm guessing/hoping that this can be sped up by getting the values directly from the device itself, instead of going through the interwebs (script runs on the same device as domoticz, RPi with Raspbian).

So, is it possible to get the values in Domoticz from the device itself, or is getting them via the JSON URL's the only way?

Re: Is it possible to get domoticz values other then via JSON URLs?

Posted: Friday 15 July 2016 12:39
by Egregius
Getting all values using JSON shouldn't take longer than hundred milliseconds.
Something I do to speed it up (for my own custom web interface) is using roomplans so I only get the devices I need in that script.
My main script is recently changed. For that I sent all device statusses to a PHP script. In my case there's only 8 milliseconds between signal of a pir and switching the switch. You don't even notice that.

The code of that can be found at http://www.domoticz.com/forum/viewtopic ... 23&t=12343

Re: Is it possible to get domoticz values other then via JSON URLs?

Posted: Friday 15 July 2016 21:04
by Timmiej93
I just did a test, and all the latency is indeed coming from the NodOn switch. Too bad, nothing I can do about that. Thanks anyway.