Skip to content

Add Air Quality sensor (airQuality from Comfort Cloud) - #540

Merged
sockless-coding merged 2 commits into
sockless-coding:masterfrom
kiyoharakadutoshi:add-air-quality-sensor
Nov 30, 2026
Merged

sockless-coding merged 2 commits into
sockless-coding:masterfrom
kiyoharakadutoshi:add-air-quality-sensor

Conversation

@kiyoharakadutoshi

@kiyoharakadutoshi kiyoharakadutoshi commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Adds an Air Quality sensor that exposes the airQuality value. The library (aio-panasonic-comfort-cloud) already parses it into device.parameters.air_quality, but the integration did not expose it as an entity.

The sensor is an enum. The codes come from the AirQuality enum in the Comfort Cloud app (5.1.2):

Code State
0 no sensor (no entity is created)
1 Clean
2 Sensor off (dust sensor off)
3 Dirty
4 Sensor off (IAQ sensor off)
5 Initializing
6 Excellent
7 Fair
8 Poor

The entity is only added for units that report a non-zero code at setup, so units without an air quality sensor don't get an entity. Unknown codes show as unknown.

Tested on CS-XZ24BKH-8 (Vietnam, X-Premium with dust and odour sensors): 6/7/8 match Excellent/Fair/Poor on the "Indoor Air Quality" screen in the app.

🤖 Generated with Claude Code

kiyoharakadutoshi and others added 2 commits November 27, 2026 04:05
Expose the airQuality value that aio-panasonic-comfort-cloud already
parses into device.parameters.air_quality. The sensor is only available
when the unit reports a non-zero value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Map the airQuality codes to the levels the Comfort Cloud app uses
(AirQuality enum in app 5.1.2): 1 clean, 2 dust sensor off, 3 dirty,
4 IAQ sensor off, 5 initializing, 6 excellent, 7 fair, 8 poor. 0 means
the unit has no sensor, so the entity is only created when the unit
reports a non-zero code instead of being permanently unavailable.

Drop the MEASUREMENT state class (the value is a level, not a quantity),
add state translations and icons, and cover the mapping with tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sockless-coding

Copy link
Copy Markdown
Owner

I did some tweaks to make it a bit more general

@sockless-coding
sockless-coding merged commit 7604c13 into sockless-coding:master Nov 30, 2026
2 checks passed
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.

2 participants