Some Aeotec window sensor state changes ignored in CacheLoad

I’m new to Home Assistant and have a number of new Aeotec 2nd edition Zwave window sensors. I understand from both discussion here and the docs that battery powered devices like these are expected to stay in the CacheLoad state after HA is restarted. However, when in this state it seems that sensor changes will still be updated in HA.

For me when these devices are in CacheLoad some sensor changes are ignored. Specifically the alarm level (triggered when the sensor is removed from its housing) is updated even when in CacheLoad. However, changes to the actual switch state (window open/closed) are ignored. Both events trigger the LED on the sensor and messages are sent (see logs below) regardless of HA state.

If I wake the sensor directly using the button on the inside, HA update past CacheLoad to show the sensor in sleeping state. Subsequent changes to the open/close sensor state then work until HA is next restarted and everything is back in CacheLoad.

Here are the OZW_Logs from the sensor opening and closing while in CacheLoad state:

2019-01-26 10:59:32.282 Detail, Node010, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x0a, 0x03, 0x20, 0x01, 0xff, 0x25
2019-01-26 10:59:32.282 Detail,
2019-01-26 10:59:32.282 Info, Node010, Received Basic set from node 10: level=255. Treating it as a Basic report.
2019-01-26 10:59:52.351 Detail, Node010, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x0a, 0x03, 0x20, 0x01, 0x00, 0xda
2019-01-26 10:59:52.351 Detail,
2019-01-26 10:59:52.351 Info, Node010, Received Basic set from node 10: level=0. Treating it as a Basic report.

And here are the logs once the sensor has been woken once with its button and transitioned to sleeping:

2019-01-26 11:20:16.296 Detail, Node010, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x0a, 0x03, 0x20, 0x01, 0xff, 0x25
2019-01-26 11:20:16.296 Detail,
2019-01-26 11:20:16.296 Info, Node010, Received Basic set from node 10: level=255. Treating it as a Basic report.
2019-01-26 11:20:16.296 Detail,
2019-01-26 11:20:16.296 Detail, Node010, Queuing (WakeUp) SensorBinaryCmd_Get (Node=10): 0x01, 0x09, 0x00, 0x13, 0x0a, 0x02, 0x30, 0x02, 0x25, 0x4a, 0xb0
2019-01-26 11:20:16.296 Detail, Node010, Refreshed Value: old value=false, new value=true, type=bool
2019-01-26 11:20:16.296 Detail, Node010, Changes to this value are not verified
2019-01-26 11:20:16.296 Detail, Node010, Notification: ValueChanged
2019-01-26 11:20:40.541 Detail, Node010, Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x0a, 0x03, 0x20, 0x01, 0x00, 0xda
2019-01-26 11:20:40.542 Detail,
2019-01-26 11:20:40.542 Info, Node010, Received Basic set from node 10: level=0. Treating it as a Basic report.
2019-01-26 11:20:40.542 Detail,
2019-01-26 11:20:40.542 Detail, Node010, Queuing (WakeUp) SensorBinaryCmd_Get (Node=10): 0x01, 0x09, 0x00, 0x13, 0x0a, 0x02, 0x30, 0x02, 0x25, 0x4b, 0xb1
2019-01-26 11:20:40.542 Detail, Node010, Refreshed Value: old value=true, new value=false, type=bool
2019-01-26 11:20:40.542 Detail, Node010, Changes to this value are not verified
2019-01-26 11:20:40.542 Detail, Node010, Notification: ValueChanged

Note that in the later example I waited 20 minutes after using the sensor button, so I don’t believe this is a difference where the sensor was already awake. I see the same effect after hours of waiting.

Is this expected? Since the initial message in both cases are the same it seems like HA is eating the report in some cases?

Axxel

I’m going to guess this is relevant:

I suspect this is the second item in the “potential issues” list.

It seems odd to me that the mappings are not cached, as they change rarely. Is there no a way to force that? Alternatively, the recommendations section specifically calls out that applications can interpret the basic command. Is there a way to get HA to do that?

To follow up for future searchers, this is apparently a limitation of OpenZWave. While I’m not a Z-Wave expert, not using the cached data still seems odd to me, so I’ve started a HA bug report to discuss:

Attached to the report is a simple patch that fixes the issue I saw, now my window sensors stay up to date even after restarting HA.

Note that as of this writing HA is using a forked version of OpenZWave, which is why I filed the issue there instead of with OpenZWave. I don’t know the background of that decision, but assume any fix needs to happen in the fork.

Did you try configuring your device to send the Sensor Binary report instead of Basic set? Wouldn’t that avoid this problem entirely without a patch?

Maybe? Changing the node reports was my project for next weekend. The other approach was to adjust the wakeup to get the devices out of CacheLoad. I had planned to try both.

That said, I think the general point of the patch is still valuable. The idea that OZW drops Basic Reports in CacheLoad is not obvious since one can join the device and have it work with the default config (via the basic report mapping) until HA is restarted.