Its the only band aide available for dimmers that support MultiLevelSwitch CC Version 3 or less, and BinarySwitch CC Version 1
The problem is the specifications in these versions did not say if the value returned should be the “instant” value, or the final value. Each Vendor did what they wanted and hence we have some devices that “work” and some that exhibit this behavior.
That config block forces OZW to ask a 2nd (or 3rd or 4th…) time for the value and doesn’t publish it to the application till the last 2 values retrieved from the device match (ie, have the same value).
The issue that @freshcoast reports is if you have a very long duration value for a dimmer. OZW will ask in quick succession for values, and its possible that 2 consecutive values come back the same. I will look incorporating the “duration” value into this check and delay the consecutive gets so its more likely we don’t run into that situation.
In Version 4 of MultiLevelSwitch CC and Version 2 of Binary Switch - the devices now send a “instant” value, and a “target” value - I’ve explained how this works to the integration team and asked them to use the Target Value instead of “level” but I’m not sure how many devices in reality are out there currently that meets this criteria.
This is awesome! Thank you Petro and Fishwaldo for your great work! Indeed i was arriving at that conclusion based on the similar report here:
Thanks for incorporating into upstream.
Indeed I’m running this as an add-on in Hassio. I wonder if I could just SSH into the host, bash into the add on container and edit the config XML files directly there similarly to what this PR seems to do ? https://github.com/OpenZWave/open-zwave/pull/2272/files
I suspect my verifychange xml change is not kicking in for whatever reason. Even after the refreshnodeinfo i still see the response yielding (“ChangeVerified”: false, looks suspicious):
Ok, so, i can confirm this did yield improvements. After i applied that change when i disable the device the end state ends up being disabled (this is for a 14294 dimmer device).
This is much better than before where after a disable it’d initially flip back to enabled and it’d remain as such.
It’s still not perfect though - i.e. i observe the following pattern:
I flip the switch to disabled in lovelace
The toggle flips to disabled
Soon after it flips back to enabled
And a few seconds later back to disabled. (before the change this did not happen)
I suspect this is why some folks added the “delay” setting in the old zwave configuration for light integrations.
I’m not sure if there’s anything equivalent with the new approach ?
Actually, i was able to fix that aspect as well by setting “dim rate” to 1. This likely forces the value changes to be more aggressive which makes it so that the “verifychanged” configuration yields optimal results. I’m not sure if there’s a better / cleaner fix here though?
Regardless, Seems to be working nicely now!
Thanks everyone!
@Fishwaldo want me to send a PR for this config on those 2 devices ? This ain’t perfect by default (as i had to change my dim rate) but it’s a step in the right direction for these devices.
For my 14294 the dim step and rate are the defaults, 1 and 3, and I don’t observe any flip-flopping of the UI switch. Perhaps it just depends on how quickly/slow the individual device responds or how quickly/slowly OZW queries the device.
You’ll should notice that that if you set a long dim duration (transition in HA) of something like 10 seconds, the state in HA will still be incorrect. The implementation still needs some improvements, but that’s a known issue.
I suspect this is why some folks added the “delay” setting in the old zwave configuration for light integrations.
Actually that delay is what causes the flip-flopping. It’s the exact same idea as VerifyChanged, except it’s the application (HA) that is doing the refresh but only one time after the delay. In comparison VerifyChange will poll the value very quickly until it reaches a stable value (not the target value, which is the problem above).