Skip to content

[SYS] Add HASS_UNIT_PPM to availableHASSUnits array#2279

Open
bafulton wants to merge 1 commit into1technophile:developmentfrom
bafulton:add-ppm-unit
Open

[SYS] Add HASS_UNIT_PPM to availableHASSUnits array#2279
bafulton wants to merge 1 commit into1technophile:developmentfrom
bafulton:add-ppm-unit

Conversation

@bafulton
Copy link

@bafulton bafulton commented Jan 27, 2026

Description

HASS_UNIT_PPM is defined in config_mqttDiscovery.h but was missing from the availableHASSUnits validation array in mqttDiscovery.cpp.

This caused unit_of_measurement to be silently dropped for CO2 sensors during MQTT discovery, resulting in Home Assistant warnings:

Entity sensor.xxx_co2 is using native unit of measurement 'None' which is not a valid unit for the device class ('carbon_dioxide') it is using; expected one of ['ppm']

This fixes the unit_of_measurement for CO2 sensors like the Govee H5140 (added in theengs/decoder#684).

Checklist

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO

HASS_UNIT_PPM is defined in config_mqttDiscovery.h but was missing from
the availableHASSUnits validation array in mqttDiscovery.cpp. This caused
unit_of_measurement to be silently dropped for CO2 sensors (like the
Govee H5140) during MQTT discovery, resulting in Home Assistant warnings
about invalid units.
@bafulton bafulton changed the title Add HASS_UNIT_PPM to availableHASSUnits array [SYS] Add HASS_UNIT_PPM to availableHASSUnits array Jan 27, 2026
bafulton added a commit to bafulton/homelab that referenced this pull request Jan 27, 2026
Temporary fix for missing unit_of_measurement on Govee H5140 CO2 sensor.
Workaround until 1technophile/OpenMQTTGateway#2279 is merged and released.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bafulton added a commit to bafulton/homelab that referenced this pull request Jan 27, 2026
Use customize to set unit_of_measurement for Govee H5140 CO2 sensor.
HA still logs a validation warning but the unit displays correctly.

Workaround until 1technophile/OpenMQTTGateway#2279 is merged and released.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant