-
Notifications
You must be signed in to change notification settings - Fork 7.6k
feat(zigbee): Add AC DC ElectricalMeasurement support #11384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(zigbee): Add AC DC ElectricalMeasurement support #11384
Conversation
👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 12m 45s ⏱️ Results for commit a42cb64. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Electrical Measurement (both DC and AC, single- and multi-phase) in the Zigbee library, along with example sketches, configuration files, and documentation updates.
- Introduces
ZigbeeElectricalMeasurement
endpoint class with DC and AC measurement APIs - Registers the new endpoint in core headers/CMakeLists and provides three fully documented examples (DC, AC single-phase, AC multi-phase)
- Supplies CI configs and README updates for each example
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
libraries/Zigbee/src/ep/ZigbeeElectricalMeasurement.h | Defines new endpoint class and measurement enums/APIs |
libraries/Zigbee/src/Zigbee.h | Includes new ElectricalMeasurement endpoint header |
CMakeLists.txt | Adds implementation source to build |
libraries/Zigbee/examples/Zigbee_Electrical_DC_Sensor/* | DC example sketch, CI config, and README |
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor/* | AC single-phase example sketch, CI config, and README |
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor_MultiPhase/* | AC multi-phase example sketch, CI config, and README |
Comments suppressed due to low confidence (2)
libraries/Zigbee/src/ep/ZigbeeElectricalMeasurement.h:1
- Update the class-level comment to reference ElectricalMeasurement rather than Pressure sensor to accurately describe the new endpoint.
/* Class of Zigbee Pressure sensor endpoint inherited from common EP class */
libraries/Zigbee/src/ep/ZigbeeElectricalMeasurement.h:98
- [nitpick] The field name
measure_type
is ambiguous; consider renaming tomeasurement_types_bitmask
ormeasured_types
for clarity.
uint32_t measure_type = 0x0000;
Description of Change
This pull request introduces a new Zigbee Electrical measurement endpoint support, containing support for both DC and AC(single or multi phase).
Added 3 new examples showing how the Electrical Measurement can be configured and used.
Tests scenarios
Tested using the new examples flashed on ESP32-C6 and connecting to a coordinator running on HomeAssistant ZHA.
NOTE: DC measurement is currently not supported by HA ZHA - pending PR here: zigpy/zha#453
Screenshot of AC multiphase example in HA

Related links
Closes #11277