Repository navigation
WWST: add Zemismart KES606 four-gang relay/scene switch - #3239
zemismart-dev wants to merge 12 commits into
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Profile category check: ✅ Passed - all profiles have a category defined. |
|
Invitation URL: |
|
zigbee-switch_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against ee1aa8d |
cjswedes
left a comment
There was a problem hiding this comment.
A refresh-only parent with four independently switchable relay/scene children. Both the existing implementation and candidate tests pass the child automation-presentation checks, while the parent fails the generic requirement for an automation action or condition. We are requesting review of that design; no exception approval is assumed.
I am not sure what to do about this; it may need an exception. My only idea is that the parent could have a switch and button capability on its main component:
- button is pressed whenever a child device button is pressed (this is inline with functionality of other zigbee button devices)
- switch controls all child devices that are in the non-scene mode, and if 1 child is on then the parent is on, otherwise it is off.
|
Thanks @cjswedes. The parent switch/button suggestion was implemented in 192595d, and the physical failed-case retests are complete:
These are targeted operational reports with documented exclusions, not a new Full Integration Test. A separate mixed-mode regression confirmed master commands skip Scene gangs and aggregate state follows eligible relay reports. All four gangs were restored to Switch; the final parent on/off regression and operator confirmation ended with all loads off. The submitted certification report's notes now reference the new evidence. I have also pushed 09a4655 for the matcher/nested-dispatch feedback and replied to all four inline comments. Focused API 19/API 21 suites each pass 140/140; lint and independent review passed. Full local zigbee-switch runs have the same pre-existing failing-case sets as the clean 192595d baseline; they are not reported as all-green. This new routing revision is locally validated only; the physical reports above remain associated with 192595d and package 2026-10-13T07:18:46.468510907. The shared-preference comment has a compatibility explanation and a request for guidance on safe mode-preference migration. No certification approval is assumed. |
|
Follow-up on the October 15 CI results: firmware 59, 60, 61 and dev passed, while 57 and 58 reported six failures. I reproduced those same six failures with the official API 14/15 runtimes: the tests expected v2 module-path dispatcher names, but the legacy loader retains each template's Fixed in 5fd6d98. Only the two test files changed. The assertions now use the appropriate loader naming convention; no tests are skipped, and the topology, lazy-loading, generic-Tuya isolation and protocol checks are preserved. No production driver or profile changes are included. Validation: API 14, 15, 19 and 21 each pass all 140 focused tests; lint and independent review pass. For the legacy SDK archives, a separate fallback directory supplies only two missing generated capability definitions from official API 21 ( The new upstream CI run is pending. The October 15 routing revision still requires physical Hub validation; the October 13 hardware reports remain evidence for 192595d, not this revision. The shared-preference migration question in the inline review remains open. |
cjswedes
left a comment
There was a problem hiding this comment.
There is more I could review due to all the extra complexity in this PR; please simplify this implementation. Your AI really overcomplicated this, and I wont approve in its current state.
|
Simplified in 8bda664 and replied to all six inline comments. The dedicated sub-driver is now 284 lines instead of 484, with standard child routing/handlers, inherited configuration/refresh and one D020-confirmed mode source. Unused fields/read/report handlers and legacy-parent migration are removed; profiles use generic names. Official SDK API 14/15/19/21 each pass all 82 focused tests. Lint, independent review and build-only packaging pass; no SDK runtime patches were used. The PR description now reflects the final implementation and its last-known aggregate-state semantics. The new revision has not been installed on the physical Hub. Clean-pair hardware validation is still required, and the October13 reports remain tied to their original commit/package. Upstream Driver Tests for this exact head all passed: 57: 4037 passed, 0 failed, 58: 4834 passed, 0 failed, 59: 5213 passed, 0 failed, 60: 5310 passed, 0 failed, 61: 5326 passed, 0 failed, dev: 5330 passed, 0 failed. Could you re-review this simplification, @cjswedes? Please let me know if further changes are needed. |
|
@cjswedes @KKlimczukS, could you help confirm the STTS validation plan before we arrange the final on-device run? The certification team has requested a complete Full Integration Test report. The currently linked 66VJTV2QBH is a targeted retest (33 passed, 0 failed, 18 user-excluded), not complete integration evidence. We will not treat the combined operational retests as a substitute for the required full flow. This device's children change between Switch and Button profiles according to their relay/scene mode, while the parent exposes both. In our previous STTS run, the parent Button case initialization expected the parent Switch to turn on. An all-Scene configuration has no eligible relay targets, so that setup could not complete initialization; a mixed configuration worked. Could you confirm:
If the certification team must decide the first point, please help route this specific coverage question to them. We will record the exact installed driver package and profile configuration for the eventual reports. |
@zemismart-dev
I'd like to take a look first. |
|
@KKlimczukS The two requested mixed-mode and complementary-mode Full Integration reports have not been generated yet. The three October 13 reports remain targeted operational evidence, not substitutes for those full sessions. October 27 update: we installed commit We are currently blocked by the Test Suite. After sign-in and reloads, the device list returns HTTP 503 from The sample has been paired back to the original test Hub and all four relays are verified Off. We will share the actual downloaded reports once the two complete sessions can run. We have not canceled or resubmitted the certification request during this attempt. |
|
@zemismart-dev |
cjswedes
left a comment
There was a problem hiding this comment.
Thank you for the simplification. This is getting much closer, but still a few things.
|
@cjswedes @KKlimczukS All five comments in review 5700717369 have been addressed and replied to individually in Local validation: official SDK APIs 14/15/19/21 each pass 82/82 focused tests; all seven Lua files in the PR pass Luacheck; profile/fingerprint checks, build-only packaging and independent source review pass. The SDK copies are unmodified. The countdown and scene-command replies include the existing raw hardware observations and their limits. The new head's six actual Driver Tests have now passed with zero failures: 57=4092, 58=4911, 59=5348, 60=5451, 61=5467, dev=5471; the CLA check also passes. Six other fork Actions still require maintainer authorization. Could you authorize those workflows and re-review this revision? The certification guidance supplied to us on November 6 is to link one Full Integration Test to the product after code review/CI are complete, then manually switch preferences/profile configurations and provide separate test-session reports for the other configurations. We will cover both child profiles on all four gangs and supply those supplementary results separately. The earlier 45/45 Full report |
cjswedes
left a comment
There was a problem hiding this comment.
I will approve once my final review comments are addressed. Thank you for iterating on this.
| supported_capabilities = { | ||
| capabilities.switch | ||
| }, |
There was a problem hiding this comment.
| supported_capabilities = { | |
| capabilities.switch | |
| }, |
This does nothing on a subdriver and should be removed.
There was a problem hiding this comment.
Removed supported_capabilities from the Tuya subdriver and its now-unused st.capabilities import in b7f7df96fa5327a34edb8309ecf1ed88408a11af.
| local TUYA_MFR_HEADER = "_TZ" | ||
| if string.sub(device:get_manufacturer(),1,3) == TUYA_MFR_HEADER and is_multi_endpoint(device) then -- if it is a tuya device, then send the magic packet | ||
| local manufacturer = device:get_manufacturer() | ||
| if manufacturer ~= nil and string.sub(manufacturer,1,3) == TUYA_MFR_HEADER and is_multi_endpoint(device) then -- if it is a tuya device, then send the magic packet |
There was a problem hiding this comment.
The nil-guard on manufacturer is unnecessary, please drop it.
There was a problem hiding this comment.
Removed the manufacturer nil-guard in b7f7df96fa5327a34edb8309ecf1ed88408a11af. The remaining matcher conditions and their order are unchanged.
| if device.network_type == device_lib.NETWORK_TYPE_ZIGBEE then | ||
| for endpoint = 1, 4 do | ||
| local child = find_child(device, endpoint) | ||
| if is_relay(device, child) and child:supports_capability(capabilities.switch) then |
There was a problem hiding this comment.
The is_relay(...) and child:supports_capability(capabilities.switch) pair is repeated in four places. A single is_relay_child(parent, child) helper that includes a short comment on the profile-lag reason for checking both would make the intent clear.
There was a problem hiding this comment.
Added is_relay_child(parent, child) in b7f7df96fa5327a34edb8309ecf1ed88408a11af and replaced the repeated combined checks, including the profile-completion path. Its short comment explains that confirmed relay mode can arrive before the child Switch profile finishes updating; both checks remain intact.
All 82 focused tests pass on the unmodified official SDK API 21 with Lua 5.3 (70 KES606, 7 generic Tuya, 5 existing Tuya multi-switch). Luacheck passes for the three changed Lua files with zero warnings/errors, and independent source review passes. Only these three final review comments were changed. This revision has not been installed or physically retested. Could you re-review it when convenient?
Type of Change
Checklist
Description of Change
Add exact-fingerprint support for the Zemismart KES-606US-L4 (
_TZ3000_hurauima / TS0726) under the existing Tuya multi-endpoint driver. The parent exposes an aggregate relay switch, a pushed button and refresh. Four endpoint children expose either switch/refresh or a pushed button.Both child profiles use the shared boolean preference
stse.changeToWirelessSwitch: true requests Scene mode and false requests relay mode. Hardware D020 readback remains the confirmed-mode source and drives profile selection. Parent commands target confirmed relay-mode children; real0xFDpresses emit the matching child and parent button events. On/Off/Toggle commands are not treated as scene presses.The existing countdown, indicator and global/per-gang power-on preferences are supported. On the tested TS0726 sample, the unscaled countdown fields produced a delayed state change; the observed timing and cancellation evidence are described in the inline review reply. This device-specific observation is not inferred from the standard OnWithTimedOff command name.
Review updates
Commit
b7f7df96fa5327a34edb8309ecf1ed88408a11afaddresses final review 5852132394: removes the ineffective Tuya subdriversupported_capabilitiesentry and unused import, removes the manufacturer nil-guard, and shares the relay-mode/profile check throughis_relay_childwith a short profile-lag comment. Only the three reviewed Lua files changed.Commit
5cbcc26634b59ba6d24e3d73b3da293a66b03716addresses review 5700717369: restores the sharedipairsiterator, removes the sparse-endpoint test, applies the suggested early KES606 matcher, adopts the shared wireless-switch preference, and narrows scene handling to observed0xFDmessages. Existing generic Tuya behavior stays covered. Upstream main352d0f993d744aa6eeb31f01ac78306cec0e29e5was merged to resolve the branch conflict.Validation
Current revision
b7f7df96fa5327a34edb8309ecf1ed88408a11af: 82/82 focused tests pass on the unmodified official SDK API 21 with Lua 5.3 (KES606 70, generic Tuya 7, existing Tuya multi-switch 5). Luacheck passes for all three changed Lua files with zero warnings/errors; diff checks and independent source review pass. This revision has not been installed or physically tested.The following validation was recorded for preceding revision
5cbcc26:Hardware and certification status
The October 28 Full Integration session
CAMVI9HG0Rpassed all 45 selected cases with no failures, skips, exclusions or errors, including onboarding and offboarding. It used earlier sourceee1aa8dand package2026-10-27T03:37:11.497994669, with L1/L2 in Switch mode and L3/L4 in Scene mode, on the exact unloaded sample. Same-package evidence also covers indicator modes, seven global/per-gang power-on cycles, all four countdowns/cancellation and real scene events on all four endpoints. Indicator observations and onsite relay confirmation are separate; loaded-contact performance is not claimed.The first complementary session
9PDO6FTEQ1remains 42 passed/3 failed because physical presses missed the manual listening windows. RetryVI3CLKKPDYwas canceled at the applicant's request (17 passed/28 skipped). Neither is presented as a completed passing complementary report. The updated source in this PR has not yet been physically retested or certified.Per the certification guidance supplied to us on November 6, after the final code is reviewed and CI passes we will run one Full Integration Test and link it to the product in Console, then manually switch child preferences/profile configurations and provide separate test sessions for the other configurations. We will cover both profiles on all four children and provide the supplementary reports separately. The existing certification request still links the October 13 targeted operational report
66VJTV2QBH(33 passed/18 excluded); no report link or certification submission has been replaced by this code update.