Skip to content

VOC sensor using incorrect device_class - reported in HA logs #23

@spikeygg

Description

@spikeygg

I have noticed in the Home Assistant system logs that my blueair VOC sensor shows up because the units are ppb instead of µg/m³. The log entries look like this:

Entity sensor.blueair_office_voc (<class 'custom_components.blueair.sensor.BlueairVOCSensor'>) is using native unit of measurement 'ppb' which is not a valid unit for the device class ('volatile_organic_compounds') it is using; expected one of ['µg/m³']; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

I have had this same warning on a few ESPHome devices that I created with a ccs811 sensor and I fixed those by assigning the device_class to volatile_organic_compound_parts (which allows for ppm or ppb units) instead of the default: volatile_organic_compound (which only has the µg/m³ units).

See the valid Home Assistant device_classes here: https://www.home-assistant.io/integrations/sensor/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions