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

TVOC sensor logs warning while using valid units #85170

Closed
xconverge opened this issue Jan 5, 2023 · 3 comments
Closed

TVOC sensor logs warning while using valid units #85170

xconverge opened this issue Jan 5, 2023 · 3 comments

Comments

@xconverge
Copy link

xconverge commented Jan 5, 2023

The problem

In my logs after upgrading to 2023.1.0 I see the following log message

Entity sensor.ccs811_total_volatile_organic_compound (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'ppb' which is not a valid unit for the device class ('volatile_organic_compounds') it is using; 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

In #84371 @frenck mentioned that µg/m³ is the only accepted unit for this class, I was wondering if there was more context for this and where I should go to resolve this.

Here is where the units are being set in esphome for this device

https://github.com/esphome/esphome/blob/dev/esphome/components/ccs811/sensor.py#L43

All googling I have done seem like ppb is valid for TVOC

https://learn.kaiterra.com/en/resources/understanding-tvoc-volatile-organic-compounds

All spec sheets I find for the ccs811 also list ppb as the units

What version of Home Assistant Core has the issue?

core-2023.1.0

What was the last working version of Home Assistant Core?

core-2022.12.9

What type of installation are you running?

Home Assistant Core

Integration causing the issue

esphome

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

@xconverge xconverge changed the title TVOC not allowing valid units TVOC sensor logs warning while using valid units Jan 5, 2023
@Blendi
Copy link

Blendi commented Jan 6, 2023

Hi there,

I have the same warning in the logs as you mentioned. Seems these errors used to happen in the background but never shown in the log file, until the last release of the Home Assistant 2023.01.

SO basically I use SGP30 sensor and I found in it's documentation that there is a possibility to convert from ppb to µg/m³ but again it is an approximate value as these are gasses and their density/volume changes on a lot of variables. So I guess I could convert to µg/m³ and call it solved. :)

I connect SGP30 TVOC sensor with ESPHome to HomeAssistant. As per ESPHome coding the measured values are in ppb units of measurements. And this sensor is automatically classified by ESPHome as "device_class: volatile_organic_compound That is totally fine and expected. I checked HomeAssistant units of measurements and I cannot see any ppb. So this unit of measurements is not defined in HomeAssistant. I would say there is a gap here for this unit of measurement ppb, between ESPhome and HomeAssistant.

#85266 (comment)

@frenck
Copy link
Member

frenck commented Jan 6, 2023

I was wondering if there was more context for this and where I should go to resolve this.

The context has always been there, device classes have always been limited to a set of units that are supported for those device classes.

https://www.home-assistant.io/integrations/sensor#device-class

The only thing changed this release, is that we added check and warnings for cases that didn't match those as documented and supported.

Here is where the units are being set in esphome for this device

esphome/esphome@dev/esphome/components/ccs811/sensor.py#L43

That is the ESPHome project, they have their own issue trackers. Please raise an issue there.

'ppb' which is not a valid unit for the device class ('volatile_organic_compounds')

That message is correct, ppb isn't supported.

As this is an upstream issue at this point, I'll go ahead and close this issue on this end.

../Frenck

@frenck frenck closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2023
@xconverge
Copy link
Author

I disagree that this is an upstream issue. All of my findings show that tvoc can have a unit of ppb and this is an issue with a too restrictive device class in HA @frenck

I simply linked the upstream code for reference

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants