THERMOSTAT_SETPOINT_GET command using JSON API

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
zwarkin
Posts: 8
Joined: 10 Apr 2015 04:41

THERMOSTAT_SETPOINT_GET command using JSON API

Post 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.
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: THERMOSTAT_SETPOINT_GET command using JSON API

Post 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.
zwarkin
Posts: 8
Joined: 10 Apr 2015 04:41

Re: THERMOSTAT_SETPOINT_GET command using JSON API

Post 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?
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: THERMOSTAT_SETPOINT_GET command using JSON API

Post by pofs »

You better wait on the client side (between requests), because waiting on server side may block other requests.
zwarkin
Posts: 8
Joined: 10 Apr 2015 04:41

Re: THERMOSTAT_SETPOINT_GET command using JSON API

Post 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?
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: THERMOSTAT_SETPOINT_GET command using JSON API

Post 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.
zwarkin
Posts: 8
Joined: 10 Apr 2015 04:41

Re: THERMOSTAT_SETPOINT_GET command using JSON API

Post 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?
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: THERMOSTAT_SETPOINT_GET command using JSON API

Post by pofs »

Yes
zwarkin
Posts: 8
Joined: 10 Apr 2015 04:41

Re: THERMOSTAT_SETPOINT_GET command using JSON API

Post by zwarkin »

Thank you!
Post Reply