I see a 5s delay when I try to turn on any Z-wave light (mostly Leviton switches or plug in module). No such delay when turning off the light. I am using the zwave2js2mqtt addon. Per the logs I see the following
Light turned on
2021-12-03 11:18:11.981 INFO ZWAVE: Node 6: value updated: 38-0-targetValue 0 => 255
2021-12-03 11:18:17.031 INFO ZWAVE: Node 6: value updated: 38-0-targetValue 255 => 99 (I think this is the delay)
2021-12-03 11:18:17.035 INFO ZWAVE: Node 6: value updated: 38-0-duration 2s => 2s
2021-12-03 11:18:17.038 INFO ZWAVE: Node 6: value updated: 38-0-currentValue 0 => 99
Light turned off
2021-12-03 11:18:19.233 INFO ZWAVE: Node 6: value updated: 38-0-currentValue 99 => 0
2021-12-03 11:18:19.236 INFO ZWAVE: Node 6: value updated: 38-0-targetValue 99 => 0
2021-12-03 11:18:24.288 INFO ZWAVE: Node 6: value updated: 38-0-targetValue 0 => 0
Any ideas on how to resolve this? This is causing my voice commands (alexa) to timeout even though the light actually does turn on.
As you’ve said, the light turns on so there’s no delay. What is delayed is the manual refresh of the device state by the driver, which occurs ~5 seconds later. The problem is, your device does not report its new state automatically. This is common enough that the driver refreshes the state automatically. In order to support a variety of devices, it waits 5 seconds. Some lights can take more than 2 seconds to transition depending on their ramp rate (like my GE dimmers).
Unless something is changed in HA, for now if you want to avoid the delay, the easiest way is to just turn on the light with a specific brightness (the state is reported immediately). The more invasive solution is to replace the switches with products that report their state automatically.
Not sure it is a switch problem. Everything was working fine till last week. I decided to redo my HA installation this week and this problem showed up.
Notice a difference between your log and mine. In your log there is a 5s delay between target value and current value. My log has 2 target values 5s apart (one for 0->255 and another 0->99)
That’s because my switch uses an older version of the command class (38). targetValue has a dual purpose, it’s used by HA to set the brightness level, but some switches also will report the value they are being changed to. When a report comes in that contains that value, the targetValue will adjust. All three values, targetValue, duration and currentValue are from the same report.
The latest version of zwave-js has had some issues. You might try to upgrade to 0.31.1 of the addon, which was just released.