Does anyone else see this? I run openHAB 5.2.1 with the Z-Wave JS binding against Z-Wave JS UI 11.22.3 (54 nodes), and after a host reboot a number of Things come up with zero channels. Items linked to them silently go NULL — nothing errors, nothing warns.
Yesterday I found 11 of 54 Things empty, and 113 item-channel links pointing at channels that no longer existed. Some of those Things were ONLINE at the time, so it is not simply “the node is dead”.
What I measured
Both containers start at the same moment, and the bridge connects 29 seconds later:
zwave-js-ui 17:34:40.577Z
openhab 17:34:40.587Z
bridge ONLINE 17:35:09.177Z <- 29 s after start
node70 ONLINE 17:35:09.325Z <- 148 ms after the bridge
A Z-Wave network of 54 nodes is nowhere near finished interviewing after 29 seconds.
Reading the binding source (5.2.1), this seems to line up:
ZwaveJSBridgeHandler.requestNodeDetails()returns fromlastNodeStates, a cache — it does not query Z-Wave JS.- That cache is filled in
procesStateUpdate()from one full state dump, taken when the websocket connects, and it is not refreshed afterwards. ZwaveJSNodeHandler.updateChannels()removes every existing channel that is not in the freshly generated result — and there is no check for the result being empty.internalInitialize()does guard againstnullnode details and againstDEAD, but not against “alive, zero values”.
So a node that is alive but not yet interviewed when the bridge connects produces zero channels, and the existing ones are removed.
What fixes it here
No need to delete anything:
- run a Scan for the binding (that calls
getFullState(), which refreshes the cache for all nodes, not only undiscovered ones); - disable and re-enable the empty Thing.
The channels come back and the links reattach by themselves — links survive both the channel removal and even deleting the Thing, as long as it is recreated with the same UID.
Measured, as a natural experiment: disabling/enabling a Thing before the scan gave 0 channels; the same action after the scan gave 523 channels and 8 links restored.
My questions
- Does anyone else see empty Things after a reboot, rather than after removing a node?
- Does anyone delay openHAB’s start relative to Z-Wave JS UI, and does that help?
- Is there a supported way to make the binding re-read node details without a restart?
There is an older issue that looks like the same thing — openhab-addons#18967, “Ecolink flood sensor channel list empty” — with exactly this in the debug log:
Node 4. Building channels and configuration, containing 0 values
Node 4. Generated 0 channels and 0 configDescriptions
It was closed after the reporter removed and recreated the Thing, which works because by then the interview has finished. The underlying behaviour is still there.