home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.54k stars 29.47k forks source link

MQTT doesn't support true power units such as VA #121622

Open PaleFlyer opened 1 month ago

PaleFlyer commented 1 month ago

The problem

I have some power monitoring smart plugs that are reporting power in VA/VAr instead of watts/kw, and power factor in Cos φ instead of %, and I get errors in the log because the smart plugs use reactive power, which is the "correct" way to measure AC power, instead of Watts, which is not the correct way to measure AC power. (Technically yes, "both" are derived from the same equitation, but reactive power is the electrical engineering way to show it.)

Really I just want the dang error to go away.

Error has been present for a while, but I'm current

What version of Home Assistant Core has the issue?

Core-2024.7.1

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

MQTT

Link to integration documentation on our website

https://www.home-assistant.io/integrations/sensor

Diagnostics information

ogger: homeassistant.components.sensor Source: components/sensor/init.py:722 integration: Sensor (documentation, issues) First occurred: 3:25:49 PM (9 occurrences) Last logged: 3:27:15 PM

Entity sensor.study_wax_warmer_energy_apparentpower (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'VA' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW']; 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.study_wax_warmer_energy_factor (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'Cos φ' which is not a valid unit for the device class ('power_factor') it is using; expected one of ['no unit of measurement', '%']; 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.livingroomwaxwarmer_energy_factor (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'Cos φ' which is not a valid unit for the device class ('power_factor') it is using; expected one of ['no unit of measurement', '%']; 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.livingroomwaxwarmer_energy_apparentpower (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'VA' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW']; 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.livingroomwaxwarmer_energy_reactivepower (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'VAr' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW']; 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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (sensor) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `sensor` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign sensor` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


sensor documentation sensor source (message by IssueLinks)

xbeaudouin commented 1 week ago

Hello this "error" does exist on 2024.8.1 as well, but from modbus as well, and some custom module like ecodevices, example:

2024-08-13 18:33:44.278 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.teleinfo_1 (<class 'custom_components.ecodevices.sensor.TeleinfoInputEdDevice'>) is using native unit of measurement 'VA' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/Aohzan/ecodevices/issues

VA or kVA are valid power unit of measurement. It should be accepted as well.