core: OZW light transition values are no longer compatible when using OpenZWave addon v0.5.2
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
- Home Assistant Core release with the issue: All OZW versions, with OpenZWave addon v0.5.2. Standalone docker users with build-150 are not affected. Build-150 and later have the same problem.
- Last working Home Assistant Core release (if known): N/A
- Operating environment (OS/Container/Supervised/Core): N/A
- Integration causing this issue: ozw
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/ozw/
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 as 255
, 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.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 23 (9 by maintainers)
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
PR has been tagged for 0.113.2: https://github.com/home-assistant/core/pull/38254
Just copy the
ozw
folder fromdev
branch into yourscustom_components
folder and restart HA. It will be picked up instead of the system version. Remember to remove it once the commit will be cherry picked (probably in version 0.114).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!)
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
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.
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.
Good find, @kpine! This explains why my lights all of a sudden are taking several minutes to respond…