zwave-js / node-zwave-js

Z-Wave driver written entirely in JavaScript/TypeScript
https://zwave-js.github.io/node-zwave-js/
MIT License
755 stars 615 forks source link

If the verification poll after changing a value returns `null`, the device is likely in transition #6268

Open bluediamond1984 opened 1 year ago

bluediamond1984 commented 1 year ago

Checklist

Deploy method

Docker

Z-Wave JS UI version

8.25.0.c77db28

ZwaveJS version

11.14.0

Describe the bug

My Fakro AMZ screen isn't holding the last state anymore. Latest working version z-wave-js-ui 8.18.1

After the state changed (open or close) the Current value of Multilevel Switch v3 holding the first 5 seconds the correct state (0 or 99) and then changes to null.

During opening or closing (around 16 seconds) the device reports null, but doesn't come back alive anymore. When opened or closed and I push the refresh button for Multilevel Switch v3, the state returns and holds.

node_2.json.txt config_entry-zwave_js-934e791c8aaee21714c1182d8f46635b.json.txt

To Reproduce

Open or close Fakro AMZ screen. Current value returns null after 5 seconds. During opening or closing (around 16 seconds) the device keeps reporting null. Pushing the refresh button withing this time period is returning null.

Expected behavior

Current value shouldn't update when opening or closing to prevent returning null when device is busy.

Additional context

I use it with Home Assistant to check if the screen is open or close, so any other automation can trigger. Now it's reporting Unknown after 5 seconds and doesn't come back alive anymore. This is related to the Current value of Multilevel Switch v3.

After opening/closing zwave 8 25 0 api before refresh

After manual refresh zwave 8 25 0 api refresh

robertsLando commented 1 year ago

/cc @AlCalzone

AlCalzone commented 1 year ago

Please make a driver log, loglevel debug and attach it here as a file (drag & drop into the text field). @bluediamond1984

bluediamond1984 commented 1 year ago

@AlCalzone, here is the log. zwavejs_2023-09-09.log

AlCalzone commented 1 year ago

Do you know if it ever reports the final status on its own? Your log doesn't look that way, although the manual indicates that it should: grafik

Can you share a screenshot of the Groups tab?

bluediamond1984 commented 1 year ago

It doesn't. When press open/close there is a brief moment of the new state and then it returns null. A push of the refresh button is always needed.

My groups from the device are empty. And the is nothing I can add. image

That got me thinking and I have now added polling for Current value with an interval of 10s. Now it's reporting the state after 20 seconds. So that part is working. image

But the state is still returning null directly after open/close action.

AlCalzone commented 1 year ago

Polling isn't ideal. Looks like the device information wasn't requested fully. Can you re-interview the device and share another driver log of that?

bluediamond1984 commented 1 year ago

Devices are re-interviewd and I have also upgraded to 11.14.2. See attachment for debug log. I have removed polling from the settings in the second try (I had forgotten to save the settings). zwavejs_2023-09-13.log

In groups nothing has changed. Polling on it's own doesn't work. The Current value has changed and isn't returning null anymore when I open/close with Binary Switch or Multilevel Switch. A manual refresh is still needed. When I change state from HA, then Current value is still returning null after 5 seconds.

AlCalzone commented 1 year ago

Ok, looks like the device in question is the old (non Z-Wave+) variant here: https://products.z-wavealliance.org/products/677?selectedFrequencyId=-1

That doesn't support associations, so you must probably poll it for changes made on the device itself. I'll look into handling the "unknown/null" state after controlling it.

AlCalzone commented 1 year ago

Info for future me:

bluediamond1984 commented 1 year ago

Thanks @AlCalzone for your support. Polling works and it is what it is. I look forward for a solution you can come up for the null state.