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 Nov 6, 2025

Description of Change

This pull request introduces improved IAS Zone enrollment management for Zigbee contact switches, vibration sensors, and door/window handles. It adds new methods for requesting, restoring, and checking enrollment, and updates example code to persist enrollment status across device reboots using flash storage. Documentation is updated to reflect these changes, and some minor code improvements and keyword additions are included.

This ensures, that the device will be fully functional after reboot.

Test Scenarios

Tested using HA (ZHA) and ESP32-C6 uploaded with updated Zigbee_Contact_Switch.ino / Zigbee_Vibration_Sensor.ino

Related links

@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Nov 6, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Review needed Issue or PR is awaiting review Area: Zigbee Issues and Feature Request about Zigbee labels Nov 6, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y requested a review from Copilot November 6, 2025 11:44
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "fix: Spelling":
    • summary looks too short

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 10 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

👋 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.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- 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 d2c4c73

Copy link
Contributor

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 enhances Zigbee IAS (Intruder Alarm System) Zone sensor classes by adding enrollment management capabilities and improving return value handling. The changes enable devices to explicitly request IAS Zone enrollment after rebooting and track enrollment status.

Key changes:

  • Added requestIASZoneEnroll() method and enrolled() status checker to IAS Zone sensor classes
  • Changed report() methods to return boolean values indicating success
  • Updated transaction handling to capture and log transaction sequence numbers
  • Fixed endpoint configuration in example sketches and added enrollment request logic

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ZigbeeVibrationSensor.h Added enrollment methods and _enrolled state tracking
ZigbeeVibrationSensor.cpp Implemented enrollment request functionality and updated report method to return boolean
ZigbeeDoorWindowHandle.h Added enrollment methods and _enrolled state tracking
ZigbeeDoorWindowHandle.cpp Implemented enrollment request functionality and updated report method
ZigbeeContactSwitch.h Added enrollment methods and _enrolled state tracking
ZigbeeContactSwitch.cpp Implemented enrollment request functionality, fixed error handling to use ZCL status types
Zigbee_Vibration_Sensor.ino Changed endpoint number and added enrollment request with status polling
Zigbee_Contact_Switch.ino Changed endpoint number and added enrollment request with status polling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

P-R-O-C-H-Y and others added 2 commits November 6, 2025 12:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@P-R-O-C-H-Y P-R-O-C-H-Y added Status: In Progress ⚠️ Issue is in progress and removed Status: Review needed Issue or PR is awaiting review labels Nov 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Test Results

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

Results for commit d2c4c73.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 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‼️ +2K0.00⚠️ +0.34000.000.00
ESP32S30⚠️ +1680.00⚠️ +0.03000.000.00
ESP32S20⚠️ +1680.00⚠️ +0.03000.000.00
ESP32C3000.000.00000.000.00
ESP32C60‼️ +2K0.00⚠️ +0.38000.000.00
ESP32H20‼️ +10K0.00‼️ +1.830⚠️ +320.00⚠️ +0.11
ESP320⚠️ +1680.00⚠️ +0.03000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/Zigbee/examples/Zigbee_Analog_Input_Output00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_Binary_Input_Output00------0000--
libraries/Zigbee/examples/Zigbee_CarbonDioxide_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light00------0000--
libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_Contact_Switch‼️ +2K0------‼️ +2K0‼️ +10K⚠️ +32--
libraries/Zigbee/examples/Zigbee_Dimmable_Light00------0000--
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor_MultiPhase00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_Electrical_DC_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Fan_Control00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_Gateway00⚠️ +1680⚠️ +168000----⚠️ +1680
libraries/Zigbee/examples/Zigbee_Illuminance_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Multistate_Input_Output00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_OTA_Client00------0000--
libraries/Zigbee/examples/Zigbee_Occupancy_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_On_Off_Light00------0000--
libraries/Zigbee/examples/Zigbee_On_Off_MultiSwitch00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_On_Off_Switch00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_PM25_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Power_Outlet00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_Pressure_Flow_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Range_Extender00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_Scan_Networks00------0000--
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy00------0000--
libraries/Zigbee/examples/Zigbee_Temperature_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Thermostat00⚠️ +1680⚠️ +1680000000⚠️ +1680
libraries/Zigbee/examples/Zigbee_Vibration_Sensor‼️ +2K0------‼️ +2K0‼️ +10K⚠️ +32--
libraries/Zigbee/examples/Zigbee_Wind_Speed_Sensor00------0000--

@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Review needed Issue or PR is awaiting review and removed Status: In Progress ⚠️ Issue is in progress labels Nov 6, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y requested a review from Copilot November 6, 2025 19:41
Copy link
Contributor

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@P-R-O-C-H-Y P-R-O-C-H-Y changed the title feat(zibgee): Add requestIASZoneEnroll + error check fixes feat(zibgee): Add IASZone enroll request and restore + error check fixes Nov 7, 2025
@me-no-dev me-no-dev added Status: Pending Merge Pull Request is ready to be merged and removed Status: Review needed Issue or PR is awaiting review labels Nov 7, 2025
@me-no-dev me-no-dev merged commit 167fb6c into master Nov 7, 2025
55 checks passed
@me-no-dev me-no-dev deleted the feat/zigbee-ias-re-enroll branch November 7, 2025 09:45
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: Pending Merge Pull Request is ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants