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 sensor.charger_energy_reactive_import_register has changed #1431

Open
mathoudebine opened this issue Dec 17, 2024 · 0 comments
Open

Comments

@mathoudebine
Copy link

Describe the bug
After a restart of HomeAssistant server, the following message is displayed in Settings > System > Repairs:

The unit of sensor.charger_energy_reactive_import_register has changed

The unit of 'Energy Reactive Import Register' (sensor.charger_energy_reactive_import_register) changed to 'kWh' which can't be converted to the previously stored unit, 'varh'.
If the historic statistic values have a wrong unit, you can update the units of the old values. The values will not be updated.
Otherwise you can choose to delete all historic statistic values, and start over.

image

To Reproduce
Steps to reproduce the behavior:

  1. Add a OCPP 1.6 chargepoint that offers Energy Reactive Import Register values (I suspect it may be the same with Energy Reactive Export Register or Energy Reactive Import/Export Interval)
  2. Restart HomeAssistant or temporarily lose connection to the charger e.g. network disconnection
  3. The repair message appears and the sensor unit is incorrect:
    image

Expected behavior
Units for Energy Reactive ... sensors do not change and stay in varh like indicated in the OCPP 1.6 documentation:
image
image

Additional context
It may be caused by this code but not sure:

def native_unit_of_measurement(self):
"""Return the native unit of measurement."""
value = self.central_system.get_ha_unit(self.cp_id, self.metric)
if value is not None:
self._attr_native_unit_of_measurement = value
else:
self._attr_native_unit_of_measurement = DEFAULT_CLASS_UNITS_HA.get(
self.device_class
)
return self._attr_native_unit_of_measurement

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

No branches or pull requests

1 participant