Skip to content

Remove IKEA air purifier entities now provided by zha-quirks - #865

Draft
zigpy-review-bot wants to merge 1 commit into
devfrom
zigpy-bot/ikea-starkvind-quirk-entities
Draft

Remove IKEA air purifier entities now provided by zha-quirks#865
zigpy-review-bot wants to merge 1 commit into
devfrom
zigpy-bot/ikea-starkvind-quirk-entities

Conversation

@zigpy-review-bot

Copy link
Copy Markdown
Collaborator

Proposed change

Removes the IKEA STARKVIND air purifier entities that are now created by the quirk, as the coupled zigpy/zha-device-handlers#5248 ports the device to quirks v2.

Removed, all of them matched on the IKEA manufacturer specific cluster 0xFC7D:

  • ReplaceFilter (binary sensor)
  • FilterLifeTime (number)
  • IkeaFilterRunTime, IkeaDeviceRunTime (sensors)
  • ChildLock, DisableLed (switches)

IkeaFan stays here — quirks v2 has no fan platform — but its _server_cluster_config shrinks from "every attribute of the manufacturer cluster" to just fan_mode and fan_speed. The quirk entities carry the same reporting_config values for the other seven attributes, and aggregate_cluster_configs merges them, so the device still gets exactly one bind on 0xFC7D and the same nine reporting configurations with the same intervals as before.

The PM25 sensor for this device is gone from the diagnostics not because it was removed here, but because the quirk no longer adds the virtual PM25 cluster it used to be discovered on — it is now a quirk sensor reading the manufacturer specific air_quality_25pm attribute, with the same unique_id. That is the actual fix for #407: ZHA used to bind and configure reporting for measured_value on a cluster the device does not implement, which answers UNSUPPORTED_ATTRIBUTE.

The regenerated diagnostics show no entity added or removed and no unique_id changed. The only state change is the table model's PM2.5 sensor going from 0 to null, which is correct: its air_quality_25pm reads 65535 (the value is unavailable) and ZHA maps a uint16's 0xFFFF to unknown. The old mirror dropped any report of 65535 instead of passing it on, so the sensor kept whatever the virtual cluster last held — 0 in this dump, which is the symptom reported in zigpy/zha-device-handlers#4625.

Additional information

Draft until a zha-quirks release containing zigpy/zha-device-handlers#5248 exists. Merging this before that release would leave the device without those entities, and CI here can't pass either: the pin is zha-quirks>=2.0.0, so tests/test_fan.py and the two STARKVIND test_discover snapshots only pass against the new quirk. The minimum needs bumping to that release in this PR before it is merged.

The other ordering is safe: releasing the quirks side first does not duplicate anything. Device._add_pending_entities ignores a pending entity whose (platform, unique_id) is already taken, so ZHA's own classes simply keep precedence for the six duplicated ids until this lands. I verified that by regenerating the diagnostics against an unmodified dev with the new quirk installed — same twelve entities, same unique_ids, and the PM2.5 sensor already comes from the quirk (ZHA's PM25 class no longer matches, since the cluster it matched on is gone). So zigpy/zha-device-handlers#5248 fixes #407 on its own.

The STARKVIND child lock, LED, filter and run time entities are now
created by the quirk, which also provides the PM2.5 sensor directly from
the manufacturer specific cluster instead of a virtual PM25 cluster.
The fan entity stays here and keeps the bind and reporting config for
the attributes it uses.
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.

IKEA Starkvind PM2.5 sensor unsupported attribute

1 participant