-
Notifications
You must be signed in to change notification settings - Fork 8
Add migration path from existing zwave component #19
Comments
Is there a way to migrate manually? I would like to help with the project, but I don't want to set up my whole z-wave network from scratch to do so. |
Well, you will not have to setup your Z-Wave network from scratch. The config is stored on your stick. |
So the trick for migration is going to be evolving around entity registry. It does require that given a unique ID of a Z-Wave entity, we can generate the unique ID that the entity would have with the new integration. Migration will be destructive because an entity ID can only be registered to a single entry. Migrate domain
The Z-Wave integration has different unique ID implementations. For node entities they use |
@balloob what about keeping the same name ? So the new integration will be zwave instead of zwave_mqtt. That would solve part of the puzzle and the web UI will start working out of the box if we have all services in place. |
We can't, as not everyone wants to upgrade and we can't migrate by just adding an mqtt broker and setting up the ozwdaemon. |
Valid point but do you plan to keep support of multiple integrations ? Or keep it side-by-side for a while and EOL the old implementation ? Good to know the plan upfront I guess. But still back to the drawing board regarding migration. Somehow reinstating the previous ID's would be super user friendly. |
The old one hasn't received upgrades in a while and I don't see anyone picking it up. We will promote this one and hide the other one. |
It’s on my todo list to let you know what will be able to map directly between 1.4 and 1.6 and what may require some “magic” to map Into 1.6. |
@Fishwaldo will the ValueIDKey be the same when migrating from 1.4 to 1.6 ? Or is this something generated by OZW itself and not from the actual hardware/mesh ? |
identifier for device in device-registrycurrent implementation: first node_instance: if node_instance > 1:
zwave_mqtt implementation:
First step of migration would be to migrate the device_id's in the current implementation to be similar with what we use now.
BTW: Very strange to use the device name as unique_id in the current implementation. Removing/replacing nodes is properly handled so safe to rely only on the node_id. |
unique id for entitiescurrent implementation: value.object_id == primary value valueid_key zwave_mqtt implementation
So assuming the ValueIDKey status/is the same between OZW 1.4 and 1.6 this unique id for the entity is the same. No migration needed, except for attaching it to the corrected device_id |
@balloob @MartinHjelmare I worked out some details for the migration path, see my comments above. You guys are more familiar with the device and entity registry but this sounds perfectly doable, right ? Just a matter of converting the device id's upfront. The old implementation created a separate entity for the node itself with some attributes like battery_level. We do not create that entity anymore (values will be separate sensors now) so after migrating this will be a "dead" entity that we should maybe cleanup. Updated the first post with some steps needed for the migration. |
we should probably make the |
Yeah, that would be even more safe. I’m not sure how big the chance is to have the same ValueIDKey on multiple instances, let alone with matching node id |
Mostly.... with a few big corner cases.
There are probably a few others - Would there be a priority of values to migrate from certain CC's? If you have the old ValueID Key - you can break it down to what it represents: OZW 1.6 Mapping - https://github.com/OpenZWave/open-zwave/blob/9e288dfe02bbe6fa8f31ff26a067e2987c8c6367/cpp/src/value_classes/ValueID.h#L351 OZW 1.4 Mapping - https://github.com/OpenZWave/open-zwave/blob/449f89f063effb048f5dd6348d509a6c54fd942d/cpp/src/value_classes/ValueID.h#L288 |
OK, we might be in luck in that case as the old implementation did not use (or generate entities for) 2, 3 and 4. As for item 1 we'll have to test if the valueId stays the same. Thanks! BTW: Now we also have an answer to our previous questions about this ID. |
Just a quick heads up - The Build Version is now reflected in the OZWDaemon_Version in the status topic - You can use this to check the version used. I'm pointing this out - As a future version will have a change for some of the types of ValueID's exposed by certain CC - So you may want to think about how to do some conditional logic based upon the version of ozwdaemon/openzwave etc. Also - Spelling Fix was just applied for the above For your reference - Major.Minor bumps in versions on OpenZWave side reflect API and fundamental functionality changes. Minor Numbers are bug fixes/builds and should be API Stable. |
There's plenty more that needs done first, but I wanted to create an issue so it doesn't get lost...
We need to figure out some sort of migration path for users using the existing
zwave
component. Ideally we'd be able to migrate all of the entity_ids and device registry entries from the oldzwave
component to the new, so people don't have to rename/reconfigure them all.In case of normal Home Assistant including the supervisor:
In case of core-only Home Assistant:
The text was updated successfully, but these errors were encountered: