Child devices: allowlist candidates that need diagnostics

Open
#1,074 14 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

The work starts from device diagnostics, not code: post a dump from one candidate (SIN-4-2-20_PRO, C-ZB-SM205-2G, ubisys S2, lumi.ctrl_ln1.aq1 or lumi.switch.b2nacn02) and read the matching quirk file it names, such as zhaquirks/nodon/switch.py. Import the dump into tests/data/devices/ and check that each split endpoint is a real output and that the whole-device settings stay on the main device. Done means the imported device passes the existing device tests and is added to the allowlist.

Written by the indexing model from the issue text.

Description

device specific help wanted
Context

zigpy/zha#947 (merged) splits allowlisted multi-channel devices into child devices, one "Channel N" per output endpoint, and zigpy/zha#1070 and zigpy/zha#1073 (both merged) add more devices. A device is only allowlisted after its diagnostics show the split is right: every split endpoint is a real output, and the settings that belong to the whole device stay on the main device.

The devices below look like good candidates from their quirks and Zigbee2MQTT's converters, but there are no diagnostics for them in tests/data/devices/ yet.

Candidates
  • NodOn SIN-4-2-20 / SIN-4-2-20_PRO (v2 quirk nodon/switch.py): relays on endpoints 1 and 2 (Zigbee2MQTT l1/l2). The relay (a light in ZHA) and its switch_type setting are on both endpoints, so both would move to each channel. Diagnostics of a SIN-4-2-20 were posted in https://github.com/zigpy/zha/issues/1074#issuecomment-7157238400 and confirm this split; zigpy/zha#1101 (open) allowlists the SIN-4-2-20 and imports them. None of a SIN-4-2-20_PRO yet.
  • Candeo C-ZB-SM205-2G (v2 quirk candeo/wall_modules.py): relays on endpoints 1 and 2. Zigbee2MQTT exposes one meter for both (multiEndpointSkip), which would stay on the main device if it is only on one endpoint. Diagnostics were posted in https://github.com/zigpy/zha/issues/1074#issuecomment-7223089702 and confirm this split: one light, with its start-up setting, per channel, while the meter, the external switch type setting (both only on endpoint 11), identify and the firmware update stay on the main device. zigpy/zha#1104 (open) allowlists it and imports them.
  • ubisys S2 (5502) / S2-R (5602) (v2 quirk ubisys/switch_s2.py): relays on endpoints 1 and 2, meter on endpoint 5. The quirk's per-relay "detached" settings are all on endpoint 1, so they would stay on the main device unless the quirk assigns them (tracked in zigpy/zha-device-handlers#5800). zigpy/zha-device-handlers#5846 (open) defines the two channels in the quirk itself, each with its relay, its input and that input's settings. Child devices a quirk defines replace the allowlist split, so once it is merged the S2 needs no allowlist entry. S2 diagnostics would still confirm the layout, which that PR checked only on a device built from the S1 snapshot.
  • Aqara lumi.switch.n2aeu1 (H1 EU double rocker with neutral, v1 quirk xiaomi/aqara/switch_h1_double.py): relays on endpoints 1 and 2 (Zigbee2MQTT left/right), the sibling of the already allowlisted lumi.switch.l2aeu1. Diagnostics were posted in https://github.com/zigpy/zha/issues/1074#issuecomment-7165857036 and confirm this split: one switch per channel, while the meter and the device temperature, which are only on endpoint 1, stay on the main device. zigpy/zha#1101 (open) allowlists it and imports them.
  • Aqara lumi.ctrl_ln2.aq1 (QBKG12LM, v1 quirk xiaomi/aqara/ctrl_ln.py): relays on endpoints 1 and 2 (Zigbee2MQTT left/right), buttons on endpoints 5 to 7. Only the 2-gang model: the quirk is shared with the 1-gang lumi.ctrl_ln1.aq1, which would need its own check. Diagnostics of a lumi.ctrl_ln2.aq1 were posted in https://github.com/zigpy/zha/issues/1074#issuecomment-7171859386 and confirm this split: one switch per channel, while the meter and the device temperature, which are only on endpoint 1, and the button events of endpoints 5 to 7 stay on the main device. zigpy/zha#1101 (open) allowlists the lumi.ctrl_ln2.aq1 and imports them. None of a lumi.ctrl_ln1.aq1 yet.
  • Aqara lumi.switch.b2nacn02 (D1 double rocker with neutral, QBKG24LM): the same endpoints as lumi.ctrl_ln2.aq1, relays on endpoints 1 and 2. No quirk for it ships yet; zigpy/zha-device-handlers#5738 adds one, based on the ctrl_ln quirk. Diagnostics (with a custom quirk of the same layout) were posted in https://github.com/zigpy/zha/issues/1074#issuecomment-7171811927 and confirm this split: one switch per channel, while the meter and the device temperature stay on the main device. zigpy/zha#1101 (open) allowlists it; the dump is imported once the quirk of zigpy/zha-device-handlers#5738 is merged, since it was taken with a custom quirk.
What's needed

Device diagnostics of any of these (device page in Home Assistant, ⋮, "Download diagnostics"), posted here. With a dump, the device can be imported into tests/data/devices/, checked, and added to the allowlist.

Dominant language
Python
Stars
96
Forks
84
Avg merge
2d 4h
Merged PRs (30d)
30

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zigpy/zha

All issues in zigpy/zha

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.