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 unit discrepency between home assistant and esphome #4012

Closed
xconverge opened this issue Jan 7, 2023 · 9 comments · Fixed by esphome/esphome#4982
Closed

TVOC unit discrepency between home assistant and esphome #4012

xconverge opened this issue Jan 7, 2023 · 9 comments · Fixed by esphome/esphome#4982

Comments

@xconverge
Copy link

The problem

Home assistant warns about an unsupported unit when using ppb for volatile organic compound

home-assistant/core#85170

The ccs811 sensor and a few others typically report ppb https://github.com/esphome/esphome/blob/dev/esphome/components/ccs811/sensor.py#L43

I can simply multiply by 4.5 and manually set the units to get out of this situation using this reference in section 2.3

https://www2.dmu.dk/atmosphericenvironment/expost/database/docs/ppm_conversion.pdf

My question is should I just do this and move on or is there a PR that more people could benefit from here

Other recent references of people who might want to see this:
home-assistant/core#85266 (comment)
home-assistant/core#85344

Which version of ESPHome has the issue?

2022.12.0

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

2023.1.0

What platform are you using?

ESP8266

Board

No response

Component causing the issue

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@xconverge
Copy link
Author

This is what I am using now as a workaround/fix, but if this issue had any traction we might want to make this part of the tvoc specific sensors or documentation

  - platform: ccs811
    eco2:
      name: "CCS811 eCO2 Value"
    tvoc:
      name: "CCS811 Total Volatile Organic Compound"
      unit_of_measurement: "µg/m³"
      filters:
        - multiply: 4.5
    address: 0x5A
    update_interval: 60s
    # https://esphome.io/components/sensor/ccs811.html#calibrating-baseline
    baseline: 0x2AC5

@Vrobenmat
Copy link

If HA is saying that µg/m3 is on the only allowable unit of measurement for VOC, then esphome should be providing that unit out of the box, no?

@xconverge
Copy link
Author

If HA is saying that µg/m3 is on the only allowable unit of measurement for VOC, then esphome should be providing that unit out of the box, no?

I am sure there are some esphome users who dont use HA though (not sure why but dont want to fully couple the 2 projects)

I think the sensors reading ppb is the most "accurate" according to the datasheets which is nice and clean from the esphome side. I think the conversion should be optional or documented (I am happy with the snippet that solves it for my case) and maybe even defaulted to on for VOC specific sensors though

@Vrobenmat
Copy link

Ah, indeed see that the sensor's native unit is ppb, makes sense to keep providing that. Bit annoying that HA only considers µg/m3 as valid - conversion seems fuzzy as an assumption is made about molecular mass. Have implemented your workaround.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 12, 2023
@ssieb
Copy link
Member

ssieb commented May 12, 2023

The device class can be changed now: home-assistant/core#92973

@jamesmyatt
Copy link

@jesserockz , Can this issue be left open until home-assistant/core#92973 has made its way into ESPHome, please?

@ssieb
Copy link
Member

ssieb commented May 12, 2023

It will, but it also needs a PR to change the sensor class of the components in esphome.

@jamesmyatt
Copy link

@ssieb . Exactly. But I didn't see it had already been unmarked stale. 👍

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

Successfully merging a pull request may close this issue.

4 participants