zwave-js-ui/docs/guide/migrating.md

12 lines
2.3 KiB
Markdown

# Migrating From Zwave2Mqtt
When migrating from Zwave2Mqtt there will be some breaking changes:
- `settings.json` are almost the same. You can easily export them from Z2M and import them in Z-Wave JS UI by using the `Export` and `Import` buttons in Settings tab. After importing them you only will have to edit some Z-Wave settings and all Gateway Values entries as now the value ids have changed
- `scenes.json` need to be rewritten for the same reason as valueIds have changed. We suggest to manually recreate them using the UI and trash the old one
- You cannot use the old OZW cache file but don't worry it will be automatically generated and the nodes names/locations will be restored from `nodes.json` file
- `nodes.json` can be imported but you will have to manually edit it and delete all nodes `hassDevices` as them will not work in the new implementation (alternatively instead of deleting you can manually convert them, see next steps)
- Values ids unique strings have changed, in Z2M valueIds were identified by `<nodeId>/<commandClass>/<endpoint>/<index>` now they are `<nodeId>/<commandClass>/<endpoint>/<property>/<propertyKey?>` where `property` and `propertyKey` (can be undefined) can be both numbers or strings based on the value. So essentially if you are using Home Assistant or MQTT functions all topics will change, [here](https://github.com/zwave-js/zwave-js-ui/pull/20/files#diff-4a25087ac983e835241cfb02c43c408df47b81f77546ef07c4dcfe9acf019eeeR4) you can see how we have translated some valueids of `devices.js` from the old format to the new one.
- List values are no longer handled as `strings` but as `numbers` by default. For example to change a Thermostat Mode in Z2M you used to send `Heat` or `Off` now you will need to send `1` (Heat) or `0` (Off). This will make it lot easier to handle list values
- All bitmask values are now split in separated values and are booleans. The same for RGB colors, now all colors will be handled separately, there will be a valueId to control Red (0-255), another for Green (0-255) and so on... There is an open issue on Z-Wave JS to also create a valueId with the hex color string. Also now some values are split in `targetValue` and `currentValue`, the first one is used to send commands the second one to see the actual state. This could seems tricky at first sight but there are some reasons behind this.