Page 1 of 1
THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 10 Apr 2015 05:38
by zwarkin
How to explicitly pull thermostat current set point value using JSON API?
When I tried:
http://hostname:8083/ZWaveAPI/Run/devic ... .val.value
the value I'm getting can be null. I would like to to initiate SetPoint Get command and then wait somehow when response will be available. Is it possible?
Thank you.
Re: THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 10 Apr 2015 15:09
by pofs
Of course, you can issue Get command:
Code: Select all
http://ip:8083/ZWaveAPI/Run/devices[2].ThermostatSetPoint.Get()
But there's no clue when the value will be reported back, because device is likely sleeping, and the value will be reported only when it wakes up. So it might take too long to wait for value.
Re: THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 10 Apr 2015 17:27
by zwarkin
ThermostatSetPoint.Get() always returns null. The device is "Frequently listening battery operated", I'm getting reply from it using Z-Wave API in about a second:
sent: 01 0A 00 13 46 03 43 02 01 05 01 E7
recv: 06
recv: 01 04 01 13 01 E8
sent: 06
recv: 01 05 00 13 01 00 E8
sent: 06
recv: 01 0B 00 04 00 46 05 43 03 01 09 44 BF <-- 0.5 - 1 second delay for this packet
sent: 06
Is it possible to wait for result during some provided timeout interval?
Re: THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 10 Apr 2015 18:18
by pofs
You better wait on the client side (between requests), because waiting on server side may block other requests.
Re: THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 10 Apr 2015 18:43
by zwarkin
I suppose the right sequence of call in this case will be:
- /ZWaveAPI/Run/devices[x].ThermostatSetPoint.Get()
- if null then wait
- get value using /ZWaveAPI/Run/devices[2].instances[0].ThermostatSetPoint.data[1].val.value
correct?
Re: THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 10 Apr 2015 18:53
by pofs
If you do it quite often, it will drain device battery pretty quickly because of frequent wake ups.
So you'd better request value first, and if it is null then do Get(), wait and request it again.
Re: THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 10 Apr 2015 19:06
by zwarkin
I assume '/ZWaveAPI/Run/devices[2].instances[0].ThermostatSetPoint.data[1].val.value' returns last received value from server's memory, where '/ZWaveAPI/Run/devices[x].ThermostatSetPoint.Get()' sends actual SetPoint Get command to the device. Is this assumption correct?
Re: THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 10 Apr 2015 19:59
by pofs
Yes
Re: THERMOSTAT_SETPOINT_GET command using JSON API
Posted: 11 Apr 2015 00:41
by zwarkin
Thank you!