HomeWizard device is rediscoverd after installing Home Assistant 2022.2.0b0

#74 · closed · 20 comments

View on GitHub ↗

pimw1

<!-- PLEASE USE THIS TEMPLATE, ISSUES THAT ARE UNCLEAR WILL BE CLOSED --> My HomeWizard Energy plug is rediscoverd after installing Home Assistant 2022.2.0b0. It was working fine in the last non-beta version (2021.12.10). **Environment (please complete the following information)** - Integration version: 0.12.1 - Home Assistant version: 2022.2.0b0 supervised - Python version (if known): unknown to me **To Reproduce** 1. Upgrade from your current Home Assistant version to version Home Assistant 2022.2.0b0 2. Click on 'Notifications': the notification is mentioned here **Expected behavior** Since my HomeWizard Energy Plug is already integrated, i am expecting no notification at all about HomeWizard Energy. **Screenshots** ![image](https://user-images.githubusercontent.com/74881023/151246617-1218f536-5b9f-461d-bab6-268964a71e08.png) ![image](https://user-images.githubusercontent.com/74881023/151246639-79b78f72-8a11-4d34-bf63-e38bb18146a7.png) It's already installed and my Energy Plug is just working fine. ![image](https://user-images.githubusercontent.com/74881023/151246726-5a52ec3c-e653-4a34-b1b0-f0b7699a56c4.png) **Log Output** **Additional context** *Add any other context about the problem here.*

Comments

DCSBL

You are one of the first to see the official HomeWizard Energy integration in action. Due to big changes, the custom and core version are incompatible. So you have to reconfigure or ignore the newly discovered. Please let me know if you found any issues.

pimw1

Thanks! I'll transition to the new version now and let you know the outcome. Congrats with the official integration!

pimw1

It's working awesome! ![image](https://user-images.githubusercontent.com/74881023/151250843-9d138f00-b5d4-471c-9618-afaeb8eedd54.png) And my dashboards are also populating nicely ![image](https://user-images.githubusercontent.com/74881023/151250902-021a6239-10da-4b0e-9216-2091fad94bdf.png) Thank you for this integration!

gabrielvisser

Not to hijack this issue, but is it easy to migrate from the custom component to the official integration? Will the Energy Dashboard lose data if you change the entities?

pimw1

In my case, i wrote down all entity id's, entity names and the device name before deleting the custom component. Then rebooted twice (for entity removal), added the new integration, and copy-pasted back all entity-ids, entity-names and the device name. However, i'm using TimescaleDB + Grafana, not the Energy Dashboard of Home Assistant. So i am not sure what will happen with the aggregated data that the Energy Dashboard of Home Assistant is using. What you could do, is first make a proper backup, make the switch, and see what will happen. In that way, you can always go back to the backup if needed.

DCSBL

@gvssr we could try that. We have to migrate the domain (from `homewizard_energy` to `homewizard`, is that possible? For now my advice is to ignore the newly discovered devices. I will follow up if I know more.

pimw1

Shall i close the current issue, or would you like me to keep it open for further discussion?

DCSBL

Let's leave it open until we have concluded what to do.

DCSBL

I am able to migrate the entries but it seems the that the history data is lost at that moment. Any ideas? It feels wrong to do it like this but I can't see any better way: ```c # __init__.py in homewizard_energy custom component async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up .""" await hass.config_entries.async_remove(entry.entry_id) entry.domain = "homewizard" entry.data = { 'ip_address': entry.data['host'], "migrated": True } await hass.config_entries.async_add(entry) return False ```

DCSBL

As is seems to be hard or impossible to migrate the data to the new domain, I will just leave it as is. If someone has an idea how we can migrate the history data, let me know!

DCSBL

Figured it out. If [this pr](https://github.com/home-assistant/core/pull/65594) is merged and released I will release an update for the custom integration so the migration is triggered. It **should** migrate all data and allows you to keep any automations and views.

DCSBL

Migration is approved and merged. When 2022.2.2 is released I will release a version that triggers the migration.

gabrielvisser

@DCSBL looks like 2022.2.2 is out. Is it safe to migrate? Has the integration in HACS been updated yet?

DCSBL

Wow, give me a moment. It is out for a few hours.

DCSBL

https://github.com/DCSBL/ha-homewizard-energy/releases/tag/0.13.0 # MAKE SURE TO MAKE A BACKUP This migration is tested on my setup. But I can't be sure if it works on all situations. Please let me know if you run into problems.

gabrielvisser

Should we update to 2022.2.2 first, and then install the beta? Or first the beta and then HA update? Just making sure before I take the plunge. 😬

DCSBL

Install 2022.2.2 and then update the custom integration. HACS will prevent the other way around but if you installed the custom integration manually, make sure to do it in the right order.

nicokars

How i can see, which is NEW the integrated HW? is that with the Blizard sign? also i am missing daily gas use

DCSBL

The core integration is indeed the one with the HomeWizard Energy logo.

gabrielvisser

@DCSBL migration worked perfectly. You're a legend, thank you!