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
72.42k stars 30.31k forks source link

AirGradient PM0.3 count value is unitless #118918

Closed MallocArray closed 4 months ago

MallocArray commented 4 months ago

The problem

Most values returned by this integration have the proper unit, but the PM0.3 count value does not return a unit, only a number.

According to the spec sheets I've found, it "indicates the number of particles with diameter beyond 0.3 um in 0.1 L of air." Link below to a reference document

The ESPHome integration for the same sensor reports it as /dL and I believe it would be appropriate for this value to also be in dL

I also think that the icon for this could be the same as the other PM sensors. This one uses blur and the others use molecule

What version of Home Assistant Core has the issue?

2024.6.0

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

airgradient

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

https://www.aqmd.gov/docs/default-source/aq-spec/resources-page/plantower-pms5003-manual_v2-3.pdf

home-assistant[bot] commented 4 months ago

Hey there @airgradienthq, @joostlek, mind taking a look at this issue as it has been labeled with an integration (airgradient) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `airgradient` 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 airgradient` 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)


airgradient documentation airgradient source (message by IssueLinks)

joostlek commented 4 months ago

What would be a nice way to name the unit?

MallocArray commented 4 months ago

I'm not really familiar with the code behind HA integrations, but I believe in this section: https://github.com/home-assistant/core/blob/dev/homeassistant/components/airgradient/sensor.py#L103

It would be something like native_unit_of_measurement=UNIT_COUNT_DECILITRE

This is based on the PMS500x integration line here where it is unit_of_measurement=UNIT_COUNT_DECILITRE, but since the values don't exactly match, I'm not sure what the proper value in a homeassistant side would be https://github.com/esphome/esphome/blob/dev/esphome/components/pmsx003/sensor.py#L133C17-L133C57

joostlek commented 4 months ago

Hmm, maybe we could rename the sensor to "particles with diameter >0.3um/dL air" and make the UoM "particles". I'm still not a big fan of it, but it would look a lot better, and more important, it's correct

airgradienthq commented 4 months ago

@joostlek yes I think this is a good idea

joostlek commented 4 months ago

I now made it: Particles with diameter >0.3um with unit: particles/dL air

MallocArray commented 4 months ago

I'm not a fan of it either. Why is the rename needed, vs just leaving it PM0.3 and letting the unit be particles/dL air?

joostlek commented 4 months ago

I lack a bit of knowledge about air quality here, but would PM0.3 indicate enough about the size?

MallocArray commented 4 months ago

Achim can speak more to it, but I've become familiar with PM2.5 meaning the size of particle being measured and PM0.3 still means the same thing, the size of the particle. The confusing thing is the unit of those particles being measured since it is different for PM0.3 compared to the others, but it is what the manufacturer is doing with the hardware, so I would lean towards still calling it PM0.3 and only changing the Unit label