Retrieving updates

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
PerM
Posts: 16
Joined: 21 Jun 2013 20:38

Retrieving updates

Post by PerM » 01 Jul 2013 23:52

Hello,

The documentation (http://razberry.z-wave.me/docs/zway.pdf section 7.4) states:

"The tree have same structure as the backend tree (Figure 8) with one additional root element
"updateTime" which contains the time of latest update. This "updateTime" value should be
used in the next request for changes. All timestamps (including updateTime) corresponds to
server local time."

This makes perfect sense. However, it doesn't seem to work as expected - the values from my Fibraro wall plug aren't distributed through the JSON api until i request an update of that particular value though the RaZberry UI.

The use case is as follows:

1. Retrieve /ZWaveAPI/Data/0
2. Take the updateTime from 1st call, lets say it is 12345 and make a new call: /ZWaveAPI/Data/12345
3. Received data is now "empty":
{
"updateTime": 1372711245
}
4. Continuous calls to /ZWaveAPI/Data/ yields no updates regarding the device.
5. Plug something into the Fibraro wall plug - the following immediately is logged to the /var/log/z-way-server.log:
[2013-07-01 22:36:50.162] RECEIVED: ( 01 0C 00 04 00 03 06 31 05 04 22 00 0A EA )
[2013-07-01 22:36:50.173] SENT ACK
[2013-07-01 22:36:50.176] SETDATA devices.3.data.failureCount = Empty
[2013-07-01 22:36:50.177] SETDATA devices.3.data.lastReceived = 0 (0x00000000)
[2013-07-01 22:36:50.179] SETDATA devices.3.instances.0.commandClasses.49.data.4.deviceScale = 0 (0x00000000)
[2013-07-01 22:36:50.181] SETDATA devices.3.instances.0.commandClasses.49.data.4.scale = 0 (0x00000000)
[2013-07-01 22:36:50.183] SETDATA devices.3.instances.0.commandClasses.49.data.4.val = 1.000000
[2013-07-01 22:36:50.185] SETDATA devices.3.instances.0.commandClasses.49.data.4.scaleString = "W"
[2013-07-01 22:36:50.188] SETDATA devices.3.instances.0.commandClasses.49.data.4 = Empty

6. The next call to /ZWaveAPI/Data/ does NOT return any updated values for the wall plug - this was expected.
7. Press the "update" button in the UI
8. Now the next call to /ZWaveAPI/Data/ return updated values for the wall plug.

Have I misunderstood how the updateTime works? Must devices be "polled" by invalidating the respective values?

PerM
Posts: 16
Joined: 21 Jun 2013 20:38

Some additional information:

Post by PerM » 01 Jul 2013 23:52

Some additional information:

It seems the above problem is related to command class 50 (CC 49 is working as expected). The same problem can be seen in the RaZberry UI; "Power"-sensors are updated on-the-fly, while "Electic"-sensors requires the "update" button to be pressed.

When the "update" button is pressed, the following is logged.

[2013-07-01 23:24:20.697] SETDATA devices.3.data.lastSend = 87137805 (0x05319e0d)
[2013-07-01 23:24:20.698] Job 0x13 (Meter get (v2)): success
[2013-07-01 23:24:20.698] Removing job: Meter get (v2)
[2013-07-01 23:24:20.713] RECEIVED: ( 01 10 00 04 00 03 0A 32 02 21 44 00 00 00 0A 00 00 BD )
[2013-07-01 23:24:20.717] SENT ACK
[2013-07-01 23:24:20.718] SETDATA devices.3.data.failureCount = Empty
[2013-07-01 23:24:20.719] SETDATA devices.3.data.lastReceived = 0 (0x00000000)
[2013-07-01 23:24:20.719] SETDATA devices.3.instances.0.commandClasses.50.data.0.val = 0.100000
[2013-07-01 23:24:20.720] SETDATA devices.3.instances.0.commandClasses.50.data.0.delta = 0 (0x00000000)
[2013-07-01 23:24:20.720] SETDATA devices.3.instances.0.commandClasses.50.data.0.ratetype = 1 (0x00000001)
[2013-07-01 23:24:20.721] SETDATA devices.3.instances.0.commandClasses.50.data.0 = Empty
[2013-07-01 23:24:20.778] SENDING (cb 0x06): ( 01 0A 00 13 03 03 32 01 10 25 06 E6 )

So, it seems the Fibraro device neglects to update the sub-items of command class 50 unless forced to. Anyone know if that is that intentional behaviour? Anyone else who can reproduce this?

PerM
Posts: 16
Joined: 21 Jun 2013 20:38

I mailed Fibaro about this,

Post by PerM » 01 Jul 2013 23:52

I mailed Fibaro about this, pointing them to this thread. Unfortunately the answer I got was just this:Dear Sir, Could you remind your issue? -- Pozdrawiam, Regards, Marcin JanickiNot sure what he actually means? I mailed back and asked for clearification, but no response yet.

PerM
Posts: 16
Joined: 21 Jun 2013 20:38

Well, Fibaro don't understand

Post by PerM » 01 Jul 2013 23:52

Well, Fibaro don't understand the problem according to their latest mail.

I've reproduced this with another RaZberry/Wallplug pair.

I'd appreciate if someone with indepth knowledge of the RaZberry comments on this.

Thanks.

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

You first have to issue a

Post by pz1 » 01 Jul 2013 23:52

You first have to issue a readout command of the form:
ZWaveAPI/Run/devices[N].instances.Meter.Get()
after a while you can read the updated value
ZWaveAPI/Run/devices[N].instances.Meter.data.val.value
Use S=0 for kWh; S=2 for Watts
Since 29-12-2016 I am no longer a moderator for this forum

PerM
Posts: 16
Joined: 21 Jun 2013 20:38

Yes, I know I can trigger the

Post by PerM » 01 Jul 2013 23:52

Yes, I know I can trigger the update - but why is that required for this command class and not others? CC49 is updated without a call to Get(), why not CC50 too?

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

That's the question for me

Post by pz1 » 01 Jul 2013 23:52

That's the question for me too. Indeed if I issue a SwitchBinary Set, the Get() command is automatically issued by Zway (I assume). I could not find an answer to that in the documentation
Since 29-12-2016 I am no longer a moderator for this forum

User avatar
PoltoS
Posts: 5054
Joined: 26 Jan 2011 19:36

Can you state this again,

Post by PoltoS » 01 Jul 2013 23:52

Can you state this again, please? with Meter (0x32) some dataholders are not updated?

PerM
Posts: 16
Joined: 21 Jun 2013 20:38

Yes, that is correctly

Post by PerM » 01 Jul 2013 23:52

Yes, that is correctly understood. As explained above, command class 0x32 (50 decimal) is not updated/sent to the controller unless first issuing a read command ( ...commandClasses[50].Get()).

Post Reply