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

ESPHome missing support for important device_class #3405

Closed
DrCoolzic opened this issue Jun 25, 2022 · 5 comments
Closed

ESPHome missing support for important device_class #3405

DrCoolzic opened this issue Jun 25, 2022 · 5 comments

Comments

@DrCoolzic
Copy link

The problem

Currently ESPHome does not support two very important device classes: “apparent_power” and “reactive_power”. This is very annoying because currently there is no way for a sensor to report values with VA or VAR for unit_of_measurement.
If using device_class=power these units of measurement are rejected for statistical data recording …

In the Sensor Component documentation, it is mentioned that:

device_class (Optional, string): The device class for the sensor. See https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes for a list of available options.

But as mentioned two are missing: apparent_power and reactive_power

Which version of ESPHome has the issue?

2022.6.2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2022.6.7

What platform are you using?

ESP8266

Board

irrelevant

Component causing the issue

irrelevant

Example YAML snippet

- platform: teleinfo
    tag_name: "SINSTS"
    name: "linky_sinsts"
    device_class: "apparent_power"
    state_class: "measurement"
    unit_of_measurement: "VA"

Anything in the logs that might be useful for us?

sensor.teleinfo: [source /config/esphome/linky-tic.yaml:161]
  platform: teleinfo
  tag_name: SINSTS
  name: linky_sinsts
  
  Unknown value 'apparent_power', valid options are '', 'aqi', 'battery', 'carbon_dioxide', 'carbon_monoxide', 'current', 'duration', 'energy', 'gas', 'humidity', 'illuminance', 'monetary', 'nitrogen_dioxide', 'nitrogen_monoxide', 'nitrous_oxide', 'ozone', 'pm1', 'pm10', 'pm25', 'power', 'power_factor', 'pressure', 'signal_strength', 'sulphur_dioxide', 'temperature', 'timestamp', 'volatile_organic_compounds', 'voltage'.
  device_class: apparent_power
  state_class: measurement
  unit_of_measurement: VA
sensor.teleinfo: [source /config/esphome/linky-tic.yaml:168]
  platform: teleinfo
  tag_name: SINSTS1
  name: linky_sinsts1

Additional information

If trying to use power instead of apparent_power
image

we get error
image

Please refer to
Add sensor device classes for apparent and reactive power #688 home-assistant/architecture#688

and
Device class “power” should support “VA” and “VAR” units #57236 home-assistant/core#57236

for more info

@probot-esphome
Copy link

Hey there @esphome/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!
(message by CodeOwnersMention)

@DrCoolzic
Copy link
Author

Hey there anybody looking at this problem?
Badly needed for the Teleinfo component!
Thanks

@DrCoolzic
Copy link
Author

Can someone look at this problem. It should not be a big modification to add the two missing device classes :)

@jesserockz
Copy link
Member

These were added to dev in esphome/esphome#3624

@DrCoolzic
Copy link
Author

Many thanks.
Is this update available on 2022.6.3 ?

@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants