ha-ideenergy icon indicating copy to clipboard operation
ha-ideenergy copied to clipboard

Compatibility issues with Home Assistant >= 2024

Open hartmood opened this issue 1 year ago • 13 comments

Describe the bug Logger: homeassistant.const Source: helpers/deprecation.py:204 First occurred: 09:41:26 (2 occurrences) Last logged: 09:41:26

TEMP_CELSIUS was used from ideenergy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/ldotlopez/ha-ideenergy/issues TEMP_FAHRENHEIT was used from ideenergy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.FAHRENHEIT instead, please create a bug report at https://github.com/ldotlopez/ha-ideenergy/issues

Environment

  • HomeAssistant version [e.g. 2024.1]

Additional context Logger: homeassistant.loader Source: loader.py:822 First occurred: 09:41:26 (1 occurrences) Last logged: 09:41:26

Unexpected exception importing component custom_components.ideenergy Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 822, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/config/custom_components/ideenergy/init.py", line 43, in from .datacoordinator import DataSetType, IDeCoordinator File "/config/custom_components/ideenergy/datacoordinator.py", line 37, in from .entity import IDeEntity File "/config/custom_components/ideenergy/entity.py", line 29, in from homeassistant_historical_sensor.recorderutil import ( File "/usr/local/lib/python3.11/site-packages/homeassistant_historical_sensor/init.py", line 39, in raise SystemError(msg) SystemError: Running HomeAssistant 2024.1.0b0, Minimum required version >=2023.6.0

hartmood avatar Dec 28 '23 08:12 hartmood

@ldotlopez Thanks for fixing. How do I receive the update? There is no HACS update available.

hartmood avatar Dec 29 '23 11:12 hartmood

@hartmood I pushed a new release some minutes ago. This release also pulls major versions from ideenergy and historical-sensors, it may break (hopefully not) some setups, backup before upgrade

ldotlopez avatar Dec 29 '23 11:12 ldotlopez

It seems to work. Thank you.

hartmood avatar Dec 29 '23 12:12 hartmood

@ldotlopez I activated the historical sensors, but even after 72 hours, no data is shown. Do I have to deactivate the standard sensors to make the historical sensors work?

hartmood avatar Jan 01 '24 14:01 hartmood

Found this in my log file

File "/usr/local/lib/python3.11/site-packages/homeassistant_historical_sensor/patches.py", line 76, in _build_attributes extra_state_attributes = self.device_state_attributes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'HistoricalPowerDemand' object has no attribute 'device_state_attributes' 2024-01-02 01:18:28.541 ERROR (MainThread)

hartmood avatar Jan 02 '24 00:01 hartmood

@hartmood Can you test the 'main' version? It should pull a new version of historical-sensors and, hopefully, fix the problem

ldotlopez avatar Jan 02 '24 11:01 ldotlopez

@ldotlopez I would love to test the 'main' version. But which one exactly is it? I installed the version from 4 days ago. Should it be 2.1.0, then? Happy New Year, by the way, and thanks for supporting me.

hartmood avatar Jan 02 '24 14:01 hartmood

@hartmood If you're using HACS go to the integration page → click the 'three dots' → "Download again" In the dropdown you should see the "main" version, which is the latest unreleased code directly from git. Needless to say, it is important to make a backup beforehand.

@ldotlopez I would love to test the 'main' version. But which one exactly is it? I installed the version from 4 days ago. Should it be 2.1.0, then? Happy New Year, by the way, and thanks for supporting me.

You're more than welcome, you're testing a pre-release version of HomeAssistant and helping me to be ready to the next release. Thanks to you too.

ldotlopez avatar Jan 02 '24 14:01 ldotlopez

@ldotlopez I went straight to "main" (thanks for the help; I've struggled with OpenHab for many years, and I'm still missing a few tricks in hass), but since then, I haven't received any data for the three historical sensors. I had also wrongly assumed that I wasn't getting any data, but that wasn't the case. Only "unknown" is displayed in the dashboard for these three sensors, and data is then available in the chart. Yesterday, I went back from "main" to 2.1.0. Unfortunately, there is still no more data, the chart stops exactly at the time when I switched to "main".

I am happy to continue testing (although I work for a software company, my programming skills are unfortunately extremely limited).

hartmood avatar Jan 04 '24 11:01 hartmood

I just released the v2.1.1 version that solves, at least for me, the problem.

ldotlopez avatar Jan 05 '24 13:01 ldotlopez

Just to confirm that after upgrading to versión 2.1.1 the problem got solved for me too

javillor avatar Jan 06 '24 17:01 javillor

@ldotlopez I switched at the beginning of the year from 2.1.0 to "mains" and then a couple of hours after release to 2.1.1. This is my status:

  • Accumulated Consumption: Worked the whole time; the last data is shown in the lovelace standard dashboard
  • Historical Consumption: All data for the whole year is shown. No data or "unknown" is shown in the Lovelace standard dashboard
  • Historical Generation: No data at all. "unknown" in Lovelace standard dashboard
  • Historical Power Demand: Stopped on the 2nd of January when I switched to mains and did not come back with 2.1.1. "Unknown" is shown in the dashboard.
  • Instant Power Demand: Worked the whole time; the last data is shown in the lovelace standard dashboard

Bildschirmfoto 2024-01-08 um 12 30 01

hartmood avatar Jan 08 '24 11:01 hartmood

This issue still there in main

TEMP_CELSIUS was used from ideenergy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+ideenergy%22 TEMP_FAHRENHEIT was used from ideenergy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.FAHRENHEIT instead, please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+ideenergy%22 Traceback (most recent call last): File "", line 189, in _run_module_as_main File "", line 148, in _get_module_details File "", line 112, in _get_module_details File "/home/homeassistant/.homeassistant/custom_components/ideenergy/init.py", line 43, in from .datacoordinator import DataSetType, IDeCoordinator File "/home/homeassistant/.homeassistant/custom_components/ideenergy/datacoordinator.py", line 37, in from .entity import IDeEntity File "/home/homeassistant/.homeassistant/custom_components/ideenergy/entity.py", line 29, in from homeassistant_historical_sensor.recorderutil import ( File "/home/homeassistant/lib/python3.12/site-packages/homeassistant_historical_sensor/init.py", line 44, in raise SystemError(msg) SystemError: Running HomeAssistant 2024.2.2, Minimum required version >=2023.6.0