New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leviton DZMX1 dimmer needs a delay before automagic refresh after being manually tapped #1695
Comments
|
I think I could come up with a 1-line PR for a fixed-duration delay. ...I wouldn't want to introduce a regression. If I have legacy devices that do not require the delay and they happily notify me of status changes within 10's of ms with the current code, and then after an update there is a weird inexplicable 1s delay, I would be confused at first and then peeved. Looking back at #398 (the issue that led to this code in the first place), I wonder if @RoboPhred's switch requires a delayed refresh or not. I'd guess "no", otherwise he/she would have reported that the value still wasn't getting updated.
(But with that alone, the |
Hm you got a point there. I'm not sure how frequently this will come up, but I guess we could add a compat flag |
I can take a stab at adding this. Any hints/clues as to where to start (a filename, a keyword --- some crate or barrel to form the basis of my cargo cult) would be appreciated. |
There are a few parts to this.
|
See zwave-js#1695. Some devices (e.g., Leviton DZMX1) will not only surreptitiously signal a locally-caused state change via a spontaneous NIF, they also require the update request to be delayed in order to handle it successfully. This compat option allows for specifying such a delay in milliseconds.
Empirical testing with a Leviton DZMX1 (firmware version 0.7) revealed that it would respond with "busy, try later" messages for delays less than ~940ms. So, set this value to 1000ms. Fixes zwave-js#1695.
Describe the bug
When the physical button on the Levition DZMX1 dimmer switch is tapped, the device emits an ApplicationUpdateRequest. zwave-js correctly interprets this as a state-change notification (logging "
Node does not send unsolicited updates, refreshing actuator and sensor values...
") and immediately performs arefreshValues()
on the node, sending aMultilevelSwitchCCGet
command. But, the device immediately responds with an "Application Status" command indicating "busy, try again later", which is dropped as unimplemented by zwave-js. Ten seconds later, the outstanding Get command times out.The consequences of all this is:
I figure the "busy, try again later" response from the device was a technique to avoid violating the old Lutron patent. A
refreshValues()
on the node does succeed if it is delayed at least 950ms after receiving the ApplicationUpdateRequest. So, it looks like Leviton implemented "Well, let's just require a 1 second delay, so that no one can possibly call this an 'instant update'."To handle this, I propose inserting a device-specific delay before
refreshValues()
is called in this blocknode-zwave-js/packages/zwave-js/src/lib/node/Node.ts
Lines 1505 to 1512 in 6cc6466
(Another possibility would be to implement handling the "Application Status, busy, try again later" message, and automatically retrying the request. But... even that would require knowing how long to wait before the retry, hence a device-specific parameter.)
Device information
Which device(s) is/are affected (make/model)? Leviton DZMX1
What are the node IDs? Node 2
Last Known Working Configuration
Installation information
How did you install
node-zwave-js
?zwavejs2mqtt
(latest) docker imagezwavejs2mqtt
(dev) docker imagenpm install @zwave-js/server
)node-zwave-js
branch:zwavejs2mqtt
branch:refreshValues()
)To Reproduce
Steps to reproduce the behavior:
Additional context
none
Logfile:
This logfile is from stock zwave-js (without any delays hacked in). The timeline is:
zwave-175924.log
The text was updated successfully, but these errors were encountered: