Single device class for concentration #651
Replies: 1 comment
-
The reason we have these specific values as device classes is so that Home Assistant understands what the data actually is and can do things with that automatically. An example of that is that Home Assistant has a HomeKit bridge that allows iOS users to see their Home Assistant entities in the Home app on their iOS/macOS devices. The HomeKit spec explicitly defines sensor types for:
Among others. And there isn't a generic concentration sensor in their platform. Having the device class allows Home Assistant to automatically create the right mapping type (as iOS does not have a generic sensor). If that data is not exposed in a machine readable way these sort of automations become impossible and every user has to manually map the data. I believe it is acceptable to have the units field set but not the device class unless you need a device class for some reason. |
Beta Was this translation helpful? Give feedback.
-
It seems problematic to me to have multiple device classes for concentration of things such as CO2, Pm2.5, SO2, etc etc. There are tons of sensors out there that report various readings, or devices that expose many many more concentrations of elements/compounds, and to have to create a new one for each is difficult.
For example, if I wanted to create a sensor integration for a Neptune Apex (aquarium monitor) (which, yes, I do plan on doing), I would need:
Salinity PPM
Calcium PPM
Magnesium PPM
Pool sensors would presumably need something that measures chlorine or bromine, etc etc. RO sensors read in TDS (PPT), if you wander into ESPHome, you have probably 20 or so sensors we don't cover.
My proposal is that we consolidate all concentration readings, into a single "Concentration" device_class, with allowed units of
ug/m3, ppm, ppb, ppt. While this would be a large one-time rototill of a number of integrations, it would also cut down on the pile of PR's and requests to add every imaginable concentration that someone builds/buys a sensor for. Or, if for consolidation purposes, parts needs to be sectioned off from ug/m3 style concentration, we could have a concentration_parts and concentration_ugm3 or similar.
Beta Was this translation helpful? Give feedback.
All reactions