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
69.94k stars 29.03k forks source link

PZEM. HA 2023.7.0 "is not a valid unit for the device class ('power_factor')" #95973

Closed garry0garry closed 1 year ago

garry0garry commented 1 year ago

The problem

ESPНome v2023.6.4. config.yaml:

    power_factor:
      name: "PZEM-004T V3 in1 Power Factor"
    update_interval: 15s
Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:659
Integration: Сенсор (documentation, issues)
First occurred: 10:30:33 (4 occurrences)
Last logged: 10:30:33

Entity sensor.pzem_004t_v3_boiler_power_factor (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '' 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+esphome%22
Entity sensor.pzem_004t_v3_home_power_factor (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '' 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+esphome%22
Entity sensor.pzem_004t_v3_in2_power_factor (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '' 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+esphome%22
Entity sensor.pzem_004t_v3_in1_power_factor (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '' 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+esphome%22

What version of Home Assistant Core has the issue?

2023.7.0

What was the last working version of Home Assistant Core?

2023.6.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

frenck commented 1 year ago

The report by Home Assistant is correct; those are not valid unit of measurement for the matching device class.

As these are ESPHome sensors (that you set up yourself), please adjust your ESPHome configuration; to either use a supported unit of measurement for the provided device class, or remove the device class in case you want to keep using that unit of measurement.

../Frenck

garry0garry commented 1 year ago

https://github.com/home-assistant/core/pull/85181 https://www.home-assistant.io/integrations/sensor/

Cosine of an angle ( cos(φ) ) as a percentage (%)??? Interesting joke, but not funny. https://en.wikipedia.org/wiki/Power_factor

frenck commented 1 year ago

Sorry, but I wasn't joking.

Our architecture does not support it. Please consult our documentation for information on kept unit of measurement and device class combinations.

../Frenck