-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
OZW light transition values are no longer compatible when using OpenZWave addon v0.5.2 #38068
Comments
The problem can be worked around by setting Toggling the switch on/off in the UI will still be affected. |
ozw documentation |
Hey there @cgarwood, @marcelveldt, @MartinHjelmare, mind taking a look at this issue as its been labeled with an integration ( |
Just FYI - Give me a bit to fix up a few things here, and I'll post when we have settled on the "factory default" value |
Good find, @kpine! This explains why my lights all of a sudden are taking several minutes to respond... |
Another observation, because of the value change the cache version was updated. Looks like the cache load does not gracefully handle incremental changes and discards the entire cache. This is basically the same as losing the cache file and it needs to be rebuilt. Mains-powered devices will be found automatically. For battery devices this means waking them up manually, or waiting for them to eventually wake up (if they do). Some users rely on the naming feature of OZW, and will notice those names are lost.
|
Oops, good catch, that will cause a lot of headache. |
No choice unfortunately - I've had to change the Duration ValueID to a Int (from a byte) and if loading from a cache that has the old encoding, it would crash OZW. |
So anything larger than 7620 will setup OZW to use the device default duration - OZW will actually report it as 4294967295. This is pushed upstream and is pending a few tests from people to confirm all good. |
That's too bad. Some users (including me) have lot's of battery powered nodes. Most of them do not wake up at all or very sporadic. Going to the trouble of manually refreshing them is a bit of a pain. Let alone the fact that they do not know about the fact this is needed after an update. These kind of breaking change (if really not unavoidable) should be communicated. We can do that in the add-on release notes for example. |
These cache invalidation are few and far between. Last time I did it was 1.4 -> 1.6 transition. So 1 1/2 years since then. But yeah - Need better coordination between upstream and HA addon |
Aeotec Dimmer ZW-111 is also exhibiting dimming issues after update. I can still toggle the switch entity with out an issue, but dimming in its entirety is broken, including toggling on and off using the dimmer entity as well as % dimming. |
Is it possible to transition the cache manually ourselves or is that too complex to explain? |
You can copy the |
@foxy82 Should be possible. Could probably be scripted via Python or using something like xmlstarlet. The challenge will be for addon users because the cache file is not easy to access. If you are using Docker standalone you can test it quite easily. It might be easier to approach it the other way, let OZW upgrade the cache file. The mains-powered devices will be detected correctly (with loss of names) and the battery devices will be missing. Shut down OZW and copy the missing nodes from the previous version of the cache file into the newly upgraded one, and fix any names that were lost, if you use those. These will mostly be battery devices, and likely not be impacted by the changes (but you'll have to double check). Using a diff tool would be the way to go. I think these are the changes between 4 and 5: The config version changed from 4 to 5, <Driver xmlns="https://github.com/OpenZWave/open-zwave" version="4" revision="109" home_id="0xc85ce84b" node_id="1" api_capabilities="8" controller_capabilities="28" poll_interval="30000" poll_interval_between="false"> <Driver xmlns="https://github.com/OpenZWave/open-zwave" version="5" revision="110" home_id="0xc85ce84b" node_id="1" api_capabilities="8" controller_capabilities="28" poll_interval="30000" poll_interval_between="false"> The MULTILEVEL command class byte (ignore the Help): <Value type="byte" genre="system" instance="1" index="5" label="Dimming Duration" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="255">
<Help>Duration taken when changing the Level of a Device (Values above 15240 use the devices default duration)</Help>
</Value> int: <Value type="int" genre="system" instance="1" index="5" label="Dimming Duration" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0">
<Help>Duration taken when changing the Level of a Device (Values above 15240 use the devices default duration)</Help>
</Value>
|
@Fishwaldo This doesn't seem to be true. If you set 7621 it is reported as 7621. It's a signed integer so you also can't even set anything above 2147483647. If you set 2147483647 it reports 2147483647. Not sure it matters, since all those numbers result in the factory default, but is that a surprise? Do you have a recommended number that should be used to set the factory default? 7621? The max value? -1? |
What release will this be included in? |
PR has been tagged for 0.113.2: #38254 |
* Dimming duration fix Fixes #38068 - allows dimming duration to 7620 (default of 7621) * Forgot to commit my test updates * Added backwards compatibility with pre-150+ builds Added tests for backwards compatibility * Upped the build number cut off * Add check for major.minor version as well * Fix major.minor detection * Adjust variable name * Adjust version checking logic * Math is hard * Rename files, adjust test names * Update doc string
Since this didn't make it in to 0.113.2 (#38254 (comment)), is there any chance of rolling back the ozw version in the addon until it's fixed in HA core? This issue has broken a bunch of my lighting. (Not sure if that means it should be reopened or not.) Thanks! |
Just noting that dropping in the dev branch of the ozw component into custom_components seems to be working fine as a workaround for me until the fix is released. (Thanks to the folks on Discord!) |
Can you tell med more how to do the workaround? |
Just copy the |
I have used an other method to work around this issue. I have detailed the method here: OpenZWave/qt-openzwave#137 (comment) |
The problem
The OpenZWave addon v0.5.2 was updated to use the latest version of open-zwave. The latest open-zwave code has changed the API for dim duration values, so the light integration needs to be updated as well.
Environment
Problem-relevant
configuration.yaml
N/A
Traceback/Error logs
N/A
Additional information
A recent commit in open-zwave changed the type of the dim duration value for dimmer switches.
Previously it was a byte value that was encoded by the application into the z-wave values. Now the value is seconds, and open-zwave encodes it to the correct z-wave value.
The value type change affects the factory transition value (255) and any transition values > 127. For example, when
light.turn_on
is used w/o a brightness, ozw encodes that as255
, which means factory default. With the new API that means 255 seconds.The factory default value is not well defined. I think there are still bugs in this area of code, so it is unknown if any other changes will follow. In the current implementation, the integration could choose any value > 15240 to indicate factory default.
The text was updated successfully, but these errors were encountered: