Skip to content

Conversation

P-R-O-C-H-Y
Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y commented Jul 18, 2025

Description of Change

This pull request adds support for Multistate input/output endpoint. Key changes include the implementation of a new ZigbeeMultistate class, updates to the example project to demonstrate its usage, and modifications to related configuration and documentation files.

Tests scenarios

Tested using C6 with provided Multistage Input/Output example using HA (Multistate clusters are not yet supported there, so it was just manual reading of the attributes).

Related links

@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Jul 18, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Blocked upstream 🛑 PR is waiting on upstream changes to be merged first Area: Zigbee Issues and Feature Request about Zigbee labels Jul 18, 2025
Copy link
Contributor

github-actions bot commented Jul 18, 2025

Messages
📖 This PR seems to be quite large (total lines of code: 1325), you might consider splitting it into smaller PRs

👋 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 ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 5bd2ed1

Copy link
Contributor

github-actions bot commented Jul 18, 2025

Test Results

 76 files   76 suites   15m 5s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit 5bd2ed1.

♻️ This comment has been updated with latest results.

@P-R-O-C-H-Y P-R-O-C-H-Y removed the Status: Blocked upstream 🛑 PR is waiting on upstream changes to be merged first label Sep 4, 2025
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32C50‼️ +9K0.00‼️ +1.320⚠️ +8480.00‼️ +2.60
ESP32S30‼️ +2K0.00⚠️ +0.17💚 -160⚠️ +40💚 -0.42⚠️ +0.11
ESP32S20⚠️ +17040.00⚠️ +0.14💚 -120⚠️ +64💚 -0.38⚠️ +0.20
ESP32C30‼️ +3K0.00⚠️ +0.20💚 -120⚠️ +64💚 -0.42⚠️ +0.23
ESP32C60‼️ +3K0.00⚠️ +0.540⚠️ +2360.00⚠️ +0.83
ESP32H20‼️ +3K0.00⚠️ +0.510⚠️ +2240.00⚠️ +0.79
ESP320⚠️ +16240.00⚠️ +0.13💚 -104⚠️ +80💚 -0.28⚠️ +0.22
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/Zigbee/examples/Zigbee_Analog_Input_Output‼️ +8K⚠️ +832⚠️ +736⚠️ +24⚠️ +388⚠️ +64⚠️ +330⚠️ +64‼️ +3K⚠️ +236‼️ +3K⚠️ +224⚠️ +404⚠️ +80
libraries/Zigbee/examples/Zigbee_Binary_Input‼️ +8K⚠️ +824------‼️ +3K⚠️ +228‼️ +2K⚠️ +224--
libraries/Zigbee/examples/Zigbee_CarbonDioxide_Sensor‼️ +7K⚠️ +832------‼️ +3K⚠️ +228‼️ +2K⚠️ +224--
libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light‼️ +8K⚠️ +640------‼️ +3K⚠️ +52‼️ +3K⚠️ +32--
libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch‼️ +8K⚠️ +816⚠️ +708⚠️ +40⚠️ +348⚠️ +64⚠️ +54⚠️ +64‼️ +3K⚠️ +228‼️ +3K⚠️ +224⚠️ +360⚠️ +80
libraries/Zigbee/examples/Zigbee_Contact_Switch‼️ +8K⚠️ +816------‼️ +3K⚠️ +228‼️ +3K⚠️ +224--
libraries/Zigbee/examples/Zigbee_Dimmable_Light‼️ +8K⚠️ +640------‼️ +3K⚠️ +52‼️ +3K⚠️ +32--
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor‼️ +8K⚠️ +840⚠️ +752⚠️ +24⚠️ +420⚠️ +64⚠️ +412⚠️ +64‼️ +3K⚠️ +228‼️ +3K⚠️ +216⚠️ +424⚠️ +80
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor_MultiPhase‼️ +8K⚠️ +840⚠️ +768⚠️ +24⚠️ +416⚠️ +64⚠️ +412⚠️ +64‼️ +3K⚠️ +228‼️ +3K⚠️ +216⚠️ +428⚠️ +80
libraries/Zigbee/examples/Zigbee_Electrical_DC_Sensor‼️ +8K⚠️ +832------‼️ +3K⚠️ +228‼️ +3K⚠️ +216--
libraries/Zigbee/examples/Zigbee_Fan_Control‼️ +8K⚠️ +848⚠️ +776⚠️ +40⚠️ +424⚠️ +64⚠️ +104⚠️ +64‼️ +3K⚠️ +236‼️ +3K⚠️ +216⚠️ +416⚠️ +64
libraries/Zigbee/examples/Zigbee_Gateway‼️ +9K⚠️ +788‼️ +2K0⚠️ +1704⚠️ +32‼️ +3K⚠️ +48----⚠️ +1624⚠️ +36
libraries/Zigbee/examples/Zigbee_Illuminance_Sensor‼️ +8K⚠️ +848------‼️ +3K⚠️ +236‼️ +3K⚠️ +216--
libraries/Zigbee/examples/Zigbee_Multistate_Input_Output--------------
libraries/Zigbee/examples/Zigbee_OTA_Client‼️ +8K⚠️ +648------‼️ +3K⚠️ +52‼️ +3K⚠️ +32--
libraries/Zigbee/examples/Zigbee_Occupancy_Sensor‼️ +7K⚠️ +832------‼️ +3K⚠️ +228‼️ +2K⚠️ +224--
libraries/Zigbee/examples/Zigbee_On_Off_Light‼️ +8K⚠️ +640------‼️ +3K⚠️ +52‼️ +3K⚠️ +32--
libraries/Zigbee/examples/Zigbee_On_Off_MultiSwitch‼️ +8K⚠️ +640⚠️ +1120💚 -144⚠️ +712💚 -120⚠️ +524💚 -120‼️ +3K⚠️ +52‼️ +3K⚠️ +32⚠️ +720💚 -104
libraries/Zigbee/examples/Zigbee_On_Off_Switch‼️ +8K⚠️ +640⚠️ +1120💚 -160⚠️ +736💚 -120⚠️ +516💚 -120‼️ +3K⚠️ +44‼️ +3K⚠️ +40⚠️ +732💚 -104
libraries/Zigbee/examples/Zigbee_PM25_Sensor‼️ +7K⚠️ +832------‼️ +3K⚠️ +228‼️ +2K⚠️ +224--
libraries/Zigbee/examples/Zigbee_Power_Outlet‼️ +8K⚠️ +672⚠️ +1152💚 -144⚠️ +772💚 -120⚠️ +562💚 -112‼️ +3K⚠️ +60‼️ +3K⚠️ +40⚠️ +752💚 -104
libraries/Zigbee/examples/Zigbee_Pressure_Flow_Sensor‼️ +7K⚠️ +816------‼️ +3K⚠️ +228‼️ +2K⚠️ +224--
libraries/Zigbee/examples/Zigbee_Range_Extender‼️ +8K⚠️ +832⚠️ +760⚠️ +40⚠️ +392⚠️ +64⚠️ +100⚠️ +64‼️ +3K⚠️ +236‼️ +3K⚠️ +216⚠️ +336⚠️ +80
libraries/Zigbee/examples/Zigbee_Scan_Networks‼️ +8K⚠️ +832------‼️ +3K⚠️ +236‼️ +3K⚠️ +216--
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy‼️ +8K⚠️ +832------‼️ +3K⚠️ +228‼️ +2K⚠️ +224--
libraries/Zigbee/examples/Zigbee_Temperature_Sensor‼️ +8K⚠️ +816------‼️ +3K⚠️ +232‼️ +2K⚠️ +216--
libraries/Zigbee/examples/Zigbee_Thermostat‼️ +8K⚠️ +824⚠️ +748⚠️ +24⚠️ +372⚠️ +64⚠️ +66⚠️ +64‼️ +3K⚠️ +216‼️ +3K⚠️ +224⚠️ +368⚠️ +80
libraries/Zigbee/examples/Zigbee_Vibration_Sensor‼️ +8K⚠️ +816------‼️ +3K⚠️ +228‼️ +3K⚠️ +224--
libraries/Zigbee/examples/Zigbee_Wind_Speed_Sensor‼️ +7K⚠️ +848------‼️ +3K⚠️ +236‼️ +2K⚠️ +216--

@P-R-O-C-H-Y P-R-O-C-H-Y added the Status: Review needed Issue or PR is awaiting review label Sep 4, 2025
Currently, this example supports the following targets.

| Supported Targets | ESP32-C6 | ESP32-H2 |
| ----------------- | -------- | -------- |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should update all those to also include C5 or maybe find a better way to define what chips are supported

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update all examples before we release 3.3.1. Good point

@me-no-dev me-no-dev requested a review from Copilot September 4, 2025 14:55
Copy link
Contributor

@Copilot Copilot AI left a 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 Zigbee multistate input/output endpoints by implementing a new ZigbeeMultistate class. The implementation includes predefined application types following Zigbee specification standards and provides functionality for both input sensors and output actuators with discrete state values.

Key changes:

  • Implementation of complete ZigbeeMultistate class with input/output cluster support
  • Addition of comprehensive example demonstrating both standard and custom multistate devices
  • Integration of new class into the Zigbee library build system and documentation

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
libraries/Zigbee/src/ep/ZigbeeMultistate.h Header file defining the ZigbeeMultistate class with predefined application types and public API
libraries/Zigbee/src/ep/ZigbeeMultistate.cpp Implementation of multistate input/output functionality with cluster management and state control
libraries/Zigbee/src/Zigbee.h Adds include for the new ZigbeeMultistate header file
libraries/Zigbee/keywords.txt Adds Arduino IDE syntax highlighting for all ZigbeeMultistate methods and constants
libraries/Zigbee/examples/Zigbee_Multistate_Input_Output/ci.json CI configuration for the multistate example
libraries/Zigbee/examples/Zigbee_Multistate_Input_Output/Zigbee_Multistate_Input_Output.ino Complete example demonstrating standard and custom multistate device usage
libraries/Zigbee/examples/Zigbee_Multistate_Input_Output/README.md Documentation for the multistate example with setup and usage instructions
docs/en/zigbee/ep_multistate.rst Comprehensive API documentation for the ZigbeeMultistate class
CMakeLists.txt Adds ZigbeeMultistate.cpp to the build system

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Zigbee Issues and Feature Request about Zigbee Status: Review needed Issue or PR is awaiting review
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants