-
Notifications
You must be signed in to change notification settings - Fork 1
Migrating from v1.x.x to v2.x.x
Direct migration between the two versions is not supported. To upgrade, you will need to first remove the old plugin and its configuration, then install and configure the new version. This process requires a hard restart of Homebridge, which is more than just using the "Restart" button in the UI.
The migration from version 1.x.x to version 2.x.x of the Homebridge Winix Purifiers plugin is not just a simple update; it involves a fundamental change in the underlying architecture of the plugin. This section aims to shed light on why this transition, albeit complex, is essential for enhanced functionality and user experience.
The original version of the plugin was built on the Accessory plugin architecture. While functional, this architecture had its limitations, particularly in flexibility and scalability. Each device had to be manually configured and added to Homebridge, and any changes or additions of devices required editing the configuration file and restarting Homebridge.
The new version 2.x.x transitions to the Dynamic Platform Plugin architecture. This architectural shift brings significant improvements:
-
Dynamic Discovery and Addition of Devices: With the dynamic platform plugin architecture, the plugin can now automatically discover and add Winix air purifiers to Homebridge without needing to manually edit the configuration file or restart Homebridge. This means that as soon as you add a new purifier to your Winix account, it can be automatically reflected in your Homebridge setup.
-
Enhanced Scalability: This architecture makes it easier to manage multiple devices, as the platform can dynamically handle device additions, removals, and updates. It's particularly beneficial for users with multiple air purifiers, simplifying the overall management and integration process.
The transition to a dynamic platform plugin architecture necessitates a clean slate due to the differences in how the two architectures manage devices and configurations. This is why the migration process involves uninstalling the old plugin, including its configuration, and setting up the new version from scratch. While this process may seem cumbersome initially, the long-term benefits of a more flexible, scalable, and stable integration make it a worthwhile effort.
Follow the Homebridge Backup and Restore instructions to take a backup of your current settings and plugins. It is always important to take a backup before performing large changes or migrations.
If there are any issues during this migration, you can always follow the guide to restore from your backup you just took.
Instead of manually editing the config.json
file to remove the old plugin's configuration, it's recommended to uninstall the plugin through the Homebridge UI. This method is more straightforward and helps prevent potential configuration errors.
- Go to the Plugins section in the Homebridge UI.
- Find the
homebridge-winix-purifiers
plugin. - Click the three dots menu and select Uninstall.
- Ensure that the "Remove Plugin Config?" option is checked. This will clean up the old plugin configuration from your system.
After uninstalling the old plugin and before installing the new version, a hard restart of the Homebridge service is necessary to ensure that all changes are correctly applied. A hard restart is crucial in this migration process because it ensures that all components of Homebridge, including any residual configurations or processes from the old plugin, are completely reset. This process can be easily done through the Homebridge UI with the following steps:
- In the Homebridge UI, locate the three-dots menu in the top right corner.
- From the dropdown menu, select Power Options.
- In the Power Options menu, choose "Restart HB Service & UI". This action will restart both the Homebridge service and the UI, ensuring that all backend processes are fully refreshed.
In older versions of Homebridge, the Power Options might not be in the three-dots menu. If this occurs, you can still perform a hard restart by accessing a more hidden setting:
- In the Homebridge UI, locate the three-dots menu in the top right corner.
- From the dropdown menu, select Settings.
- Scroll to the bottom of the Settings page to find the Actions section.
- Select Force Service Restart. This function forces the Homebridge service to restart, similar to the "Restart HB Service & UI" option but accessible through a different path.
After successfully uninstalling the old plugin and performing a hard restart, you can proceed to install the new version of the plugin:
- Go to the Plugins section in the Homebridge UI.
- Search for
homebridge-winix-purifiers
. - Click Install next to the plugin to install the latest version.
With the new plugin version installed, you'll need to configure it to connect to your Winix purifiers. Please follow the steps in the README to properly setup your new plugin version