Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The unit of measurement of some entities has changed" warning messages #1403

Closed
lechercheur123 opened this issue Nov 24, 2024 · 6 comments · Fixed by #1417
Closed

"The unit of measurement of some entities has changed" warning messages #1403

lechercheur123 opened this issue Nov 24, 2024 · 6 comments · Fixed by #1417

Comments

@lechercheur123
Copy link

lechercheur123 commented Nov 24, 2024

Hello

Describe the bug
Everytime I restart Home Assistant, I have 2 messages saying the unit of measurement of 2 entities have changed:
Capture
(Sorry it is in French. It is saying "The unit of sensor.charger2_power_reactive_import has changed" and "The unit of sensor.charger2_energy_reactive_export_register has changed"

If I click on one message, I get this:
Capture1
In English it means:

The unit has changed
The unit of "charger2 Power Reactive Import" (sensor.charger2_power_reactive_import) has been changed to "kW" which cannot be converted to the previously stored unit, "var".
If the historical statistics values ​​have the wrong unit, you can update the units of the old values. The values ​​will not be updated.
Alternatively, you can choose to delete all historical statistics values ​​and start over.
How do you want to fix this issue:
Option 1: Update the unit of historical statistics values from "var" to "kW", without conversion
Option 2: Delete old data

The same warning can be found in the logs:

2024-11-24 16:05:10.127 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.charger2_energy_reactive_import_register is changing, got multiple {'kWh', 'varh'}, generation of long term statistics will be suppressed unless the unit is stable and matches the unit of already compiled statistics (varh). Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-11-24 16:05:10.207 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.charger2_energy_reactive_export_register (kWh) cannot be converted to the unit of previously compiled statistics (varh). Generation of long term statistics will be suppressed unless the unit changes back to varh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-11-24 16:05:10.207 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.charger2_power_reactive_import (kW) cannot be converted to the unit of previously compiled statistics (var). Generation of long term statistics will be suppressed unless the unit changes back to var or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this

It is not a blocking issue, but it is annoying to have to open these messages everytime I have to reboot HA (after an update, after a configuration change...)

To Reproduce
Steps to reproduce the behavior:

  1. Restart HA

Expected behavior
Nothing

Screenshots
See above

Desktop:

  • OS: Windows (HA is on a VM on a Proxmox hypervisor)
  • Browser Firefox
  • Version 132

Additional context
I think this issue might be linked to the charger. In fact, I have two chargers connected to my HA:

  • charger, an Schneider EVlink Smart Wallbox 22kW, which is working fine with the OCPP integration. Its ID is "charger22kW"
  • charger2, a eProWallbox Move from free2move, which I think is a crappy wallbox. Its ID is 1694AB070000244

I only have the issue with "charger2" (as seen on the screenshots)

To have 2 chargers on the same HA I used two instances of the OCPP integration listening to different ports, like this:
Capture2

I guess this is the good way to do, no?

I will put the log file in attachment.
home-assistant_ocpp_2024-11-24T16-52-05.376Z.log

@onlyfornetwork
Copy link

I have the same problem,

it also occurs when the column is turned on by the integration

Wallbox Legrand Green Up 059006

@N3rdix
Copy link
Contributor

N3rdix commented Nov 29, 2024

The repair should disappear if you delete the old long-term statistics (if you don't need them from those entities).
I assume there was a reason to change the UOM of those entities, so this might be the only persistent option...

@lechercheur123
Copy link
Author

If I delete the warning saying that the unit has been changed from 'var' to 'kW', at the next reboot I have a warning saying the unit has been changed from 'kW' to 'var'...
So this isn't a long term fix

@drc38
Copy link
Collaborator

drc38 commented Nov 30, 2024

You can try updating the logic here:

def device_class(self):

with SensorDeviceClass.REACTIVE_ENERGY

@N3rdix
Copy link
Contributor

N3rdix commented Nov 30, 2024

I created a PR to fix at least the power reactive sensors, maybe you can review if it'S fine from your perspective @drc38.
There is no equivalent for reactive energy in the device classes of HA as it seems...

@drc38
Copy link
Collaborator

drc38 commented Nov 30, 2024

I created a PR to fix at least the power reactive sensors, maybe you can review if it'S fine from your perspective @drc38. There is no equivalent for reactive energy in the device classes of HA as it seems...

Yeah, looks like I was looking at a fork that did not get merged by the devs. See my suggestion on energy in your PR. It's odd they added reactive power without adding reactive energy....

It should stop the warning by not giving it a device class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants