Skip to content

No unit of measure for absolute humidity sensors #148197

@Algol655

Description

@Algol655

The problem

Hello.
Absolute humidity sensors with "device_class":"humidity" and "unit_of_meas":"g/m³" fail because the unit of measure g/m³ is considered invalid for "device_class":"humidity".
I think this is a mistake, because absolute humidity is one of the main ways to measure air humidity, and I also think it is appropriate to keep the device_class humidity for absolute humidity measurement.
So I propose to add the unit of measure g/m³ to the device_class humidity.

What version of Home Assistant Core has the issue?

2025.7.1

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

MQTT

Link to integration documentation on our website

https://www.home-assistant.io/integrations/mqtt

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

2025-07-05 08:24:55.598 ERROR (MainThread) [homeassistant.components.mqtt.entity] Error 'The unit of measurement `g/m³` is not valid together with device class `humidity`' when processing MQTT discovery message topic: 'homeassistant/sensor/0280E10000F6-hum_abs/config', message: '{'state_class': 'measurement', 'device': {'identifiers': ['0280E10000F6'], 'connections': [['mac', '0280E10000F6']], 'manufacturer': 'ALGOL', 'model': 'Sensus191', 'via_device': 'OpenMQTTGateway_ESP32_OLM_POE', 'name': 'PEMS'}, 'state_topic': '+/+/BTtoMQTT/0280E10000F6', 'value_template': '{{value_json.hum_abs|is_defined}}', 'unique_id': '0280E10000F6-hum_abs', 'unit_of_measurement': 'g/m³', 'name': 'Sensus191-hum_abs', 'device_class': 'humidity'}'

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions