Hi there!
tldr; When setting two zwave items to same state, openhab sometimes will see one node being updated and reverted back to starting state. When this happens, SWITCH_BINARY_GET is sent to node before SWITCH_BINARY_SET. Issue is hard to reproduce with debug logs.
Thank you for your hardwork on this plugin, it works great! Butā¦ I do experience one painfull issue with itemās state updates. Sorry if this is a duplicate but this thread is so painfull to search.
I have a setup where a change in Node 24 (binary sensor), should trigger change to same state in Node 30 and Node 31. All nodes are Neo Coolcam, 24 is motion sensor and 30 & 31 are Light Switch EU 2CH.
Rules are simple turn both on when sensor says so and turn the other one, when one of nodes is locally changed. Iām having an issues with second part, from openhabās logs it look like after both items are set to state indicated by sensor, one of the them is set back to previous state - even when node it self has changed to new state and I do see light This of course triggers second part of rules and switches the other node back to starting state. In the end, openhab thinks that both nodes are in the same state (and equal to starting state), where in fact they are not.
Iāve tried to track a little bit what is going but it seems your development branch on github is not up-to-date with your releases here. What I found is that, after sending command to item, openhab marks item state to new one, being requested, then for some reason a zwave controller sends to offending node SWITCH_BINARY_GET before SWITCH_BINARY_SET. So once GETās response is received openhab will mark item back to previous state - triggering rules updates. SWITCH_BINARY_SET is sent properly, and node switches itself, but openhab is not notified.
You can find logs here, one when all went fine, with debug on zwave and trace on transaction manager. And second one with only debug but the order of messages is wrong. It looks like the number of logs is impacting this issue occurance or not. I was unable to reproduce it with TRACE on zwave transaction manager. And even with DEBUG it will sometimes not reproduce, but when Iām on INFO it will usually work in wrong way.
I do suspect that a bug is in ZWaveTransactionManager, somehow transaction identifiers are shown out of order when SWITCH_BINARY_GET is sent before SWITCH_BINARY_SET. It looks like, either queue is storing them in wrong order, or they are grabbed in wrong order from it (getMessageFromQueue() can do this if node is not awake during iteration and becomes awake midthru). I was never able to reproduce it with only single node.
P.S. Unfortunately Iām unable to bind 30 and 31 thru associations (they do sometimes work but most often not - same thing on non openhab so probably issue on switches), and Iām forced to use openhab to keep both nodes in sync.