Convert Schneider outlet to quirks v2, add missing controls - #4521
Convert Schneider outlet to quirks v2, add missing controls#4521uvNikita wants to merge 8 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4521 +/- ##
=======================================
Coverage 92.40% 92.41%
=======================================
Files 416 416
Lines 14314 14327 +13
=======================================
+ Hits 13227 13240 +13
Misses 1087 1087 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@nnae06 I don't have this device, so great that you can check it. I pushed fix for Local control mode that hopefully should resolve the issue. As for Indicator luminance level, not sure what else I can do there. Everything looks good to me according to the specification. |
|
The error seem to indicate that this attribute (0x0050) doesn't exist on your device, so I guess spec doc is incorrect, or has a mistake in it. Can you post signature of this device? To do that, go to "Manage Zigbee Device" -> "Signature" |
|
Actually, it doesn't look like signature will give us a list of attributes. Not sure if there is a way to get the list of attributes from manufacturer specific cluster. @TheJulianJES Let me know if you have some pointers, if not, I can remove se_local_control_mode attribute from the PR. |
|
{ |
|
Zigbee2Mqtt also doesn't have LocalControl attribute. Also their luminance level is enum, but spec says that it's uint8: |
|
I have now been running this code for a few months without any problems. Everything works flawlessly, the indication on the socket can be adjusted with animation. """Schneider Electric (Wiser) Outlet Quirks.""" from typing import Final from zigpy import types as t from zhaquirks.schneiderelectric import SE_MANUF_NAME, SEBasic class SEIndicatorMode(t.enum8): class SEOutletConfiguration(CustomCluster): class SEMeteringCluster(CustomCluster, Metering): ( |
|
Rebased on top of the current dev, migrated to new |
Updated for the v2 conversion and added controls in zigpy/zha-device-handlers#4521.
Updated for the v2 conversion and added controls in zigpy/zha-device-handlers#4521.
|
Updated to work with the recent quirks/ZHA refactor (#5113). |
zigpy-review-bot
left a comment
There was a problem hiding this comment.
Approving — clean v1→v2 migration, and the new controls check out against the vendor spec.
Verified against the attached spec PDF. All three 0xFC04 attribute types match exactly: IndicatorLuminanceLevel (0x0000) is uint8, IndicatorMode (0x0002) is uint8, and LocalControl (0x0050) is enum8. So the asymmetric zcl_type=DataTypeId.uint8 on se_indicator_mode but not on se_local_control_mode is correct — it faithfully reproduces the spec rather than being an oversight. The enum value sets match too, including the inverted luminance scale (0 = 100%, 5 = 0%).
Zigbee2MQTT independently corroborates the indicator mode: its manuSpecificSchneiderFanSwitchConfiguration (also cluster 0xFC04) defines ledIndication at 0x0002 as UINT8 with reverse_with_load: 0, consistent_with_load: 1, always_off: 2, always_on: 3 — the same ordering as SEIndicatorMode.
No entity breakage for existing users. I regenerated both ZHA diagnostics snapshots (schneider-electric-socket-outlet-1/2-0x020612ff.json) against this branch. The delta is purely additive — three new entities on endpoint 6 (se_indicator_luminance_level number, se_indicator_mode and se_local_control_mode selects) — with every pre-existing entity, including the StartUpOnOff select and all metering/electrical sensors, unchanged. ZHA core has no Schneider cluster handler for 0xFC04, so there is no native-vs-quirk entity collision and no duplicate entities. The snapshots will need regenerating in zigpy/zha after the next zha-quirks release.
git merge dev applies cleanly and the full test suite passes.
| cluster_id=SEOutletConfiguration.cluster_id, | ||
| endpoint_id=6, | ||
| min_value=0, | ||
| max_value=5, |
There was a problem hiding this comment.
Optional: the scale here is inverted (0 = brightest, 5 = off), which is a little unintuitive as a bare number in the UI. Z2M exposes the same attribute as a named lookup ("100", "80", … "0" percent). Since a number entity was the explicitly requested shape in the earlier review round, this is fine as-is — just noting that an enum with percentage-named members would be self-documenting if you ever want to revisit. The comment on the attribute definition already covers the mapping.
There was a problem hiding this comment.
That's not great. We'd need an attribute_converter for number entities:



Proposed change
Fixes: #4503
Part of: #1705
Additional information
Spec docs:
ZB Spec - Socket Outlets - 200522.pdf
Device diagnostics
Checklist
pre-commitchecks pass / the code has been formatted using Black