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

MQTT kWh Battery measurement messages for a Battery - But HA doesn't accept it for a device_class = battery #116705

Open
yoba-ch opened this issue May 3, 2024 · 0 comments

Comments

@yoba-ch
Copy link

yoba-ch commented May 3, 2024

The problem

Hello,
I've a MQTT message from my Huawei Inverter as of "[Energy storage unit1] Current-day charge capacity" in kWh.

Should I use something else as a device_class or is it possible to have this implemented in Core HA?

Thank you.
Alex.

What version of Home Assistant Core has the issue?

core-2024.4.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

none

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

- name: "Battery_current_day_discharge_capacity"
      unit_of_measurement: "kWh"
      device_class: battery
      state_class: total_increasing
      state_topic: "home/cave/onduleur/state"
      value_template: "{{ value_json.Battery_day_discharge_capacity| float /100 }}"
      qos: 2

Anything in the logs that might be useful for us?

Enregistreur: homeassistant.components.sensor
Source: components/sensor/__init__.py:737
intégration: Capteur (documentation, problèmes)
S'est produit pour la première fois: 27 avril 2024 à 22:36:19 (78 occurrences)
Dernier enregistrement: 14:44:00

Entity sensor.battery_current_day_discharge_capacity (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kWh' which is not a valid unit for the device class ('battery') it is using; expected one of ['%']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
Entity sensor.battery_current_day_charge_capacity (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kWh' which is not a valid unit for the device class ('battery') it is using; expected one of ['%']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22

Additional information

No response

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