Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(zigbee): Add PM2.5 endpoint support#11205

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
me-no-dev merged 3 commits intoespressif:masterfromP-R-O-C-H-Y:feat/zigbee-pm25
Apr 5, 2025

Conversation

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

Description of Change

This pull request introduces a new Zigbee PM2.5 sensor example for the Zigbee Library.

Tests scenarios

Tested using C6 and HomeAssistant ZHA (in ZHA the PM2.5 does not support decimals, so the data from sensor are rounded. Will be fixed soon on ZHA side).

Related links

Related#11036

@P-R-O-C-H-YP-R-O-C-H-Y added the Area: ZigbeeIssues and Feature Request about Zigbee labelMar 31, 2025
@P-R-O-C-H-YP-R-O-C-H-Y self-assigned thisMar 31, 2025
@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedMar 31, 2025
edited
Loading

Messages
📖🎉 Good Job! All checks are passing!

👋Hello P-R-O-C-H-Y, we appreciate your contribution to this project!


📘 Please review the project'sContributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you haveread and signed theContributor License Agreement for this project.

Click to see more instructions ...


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

DangerJS is triggered with eachpush 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 isnot a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manuallyretry these Danger checks, please navigate to theActions 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 against35b9d63

@github-actionsGitHub Actions
Copy link
Contributor

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
ESP32S30⚠️ +2520.00⚠️ +0.04000.000.00
ESP32S20⚠️ +2520.00⚠️ +0.04000.000.00
ESP32C3000.000.00000.000.00
ESP32C6000.000.00000.000.00
ESP32H2000.000.00000.000.00
ESP320⚠️ +2520.00⚠️ +0.04000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch⚠️ +2520⚠️ +2520000000⚠️ +2520
libraries/Zigbee/examples/Zigbee_Gateway⚠️ +2520⚠️ +252000----⚠️ +2520
libraries/Zigbee/examples/Zigbee_On_Off_Switch⚠️ +2520⚠️ +2520000000⚠️ +2520
libraries/Zigbee/examples/Zigbee_Range_Extender⚠️ +2520⚠️ +2520000000⚠️ +2520
libraries/Zigbee/examples/Zigbee_Thermostat⚠️ +2520⚠️ +2520000000⚠️ +2520
libraries/Zigbee/examples/Zigbee_Analog_Input_Output------0000--
libraries/Zigbee/examples/Zigbee_CarbonDioxide_Sensor------0000--
libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light------0000--
libraries/Zigbee/examples/Zigbee_Contact_Switch------0000--
libraries/Zigbee/examples/Zigbee_Dimmable_Light------0000--
libraries/Zigbee/examples/Zigbee_Illuminance_Sensor------0000--
libraries/Zigbee/examples/Zigbee_OTA_Client------0000--
libraries/Zigbee/examples/Zigbee_Occupancy_Sensor------0000--
libraries/Zigbee/examples/Zigbee_On_Off_Light------0000--
libraries/Zigbee/examples/Zigbee_PM25_Sensor------------
libraries/Zigbee/examples/Zigbee_Pressure_Flow_Sensor------0000--
libraries/Zigbee/examples/Zigbee_Scan_Networks------0000--
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy------0000--
libraries/Zigbee/examples/Zigbee_Temperature_Sensor------0000--
libraries/Zigbee/examples/Zigbee_Vibration_Sensor------0000--
libraries/Zigbee/examples/Zigbee_Wind_Speed_Sensor------0000--
libraries/Zigbee/examples/Zigbee_Window_Covering------0000--

@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedMar 31, 2025
edited
Loading

Test Results

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

Results for commit35b9d63.

♻️ This comment has been updated with latest results.

@P-R-O-C-H-YP-R-O-C-H-Y added the Status: Review neededIssue or PR is awaiting review labelMar 31, 2025
@me-no-devme-no-dev added Status: Pending MergePull Request is ready to be merged and removed Status: Review neededIssue or PR is awaiting review labelsApr 2, 2025
@me-no-devme-no-dev requested a review fromCopilotApril 3, 2025 12:14
Copy link
Contributor

@CopilotCopilotAI 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 pull request adds support for a Zigbee PM2.5 sensor by introducing a new endpoint class with its associated example and updating the Zigbee endpoint include order.

  • Introduces the ZigbeePM25Sensor class and its configuration in both header and source files.
  • Updates the main Zigbee header to include the new sensor endpoint and reorganizes related endpoints.
  • Provides an Arduino example and README for the new PM2.5 sensor.

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
libraries/Zigbee/src/ep/ZigbeePM25Sensor.hNew endpoint header defining the PM2.5 sensor configuration.
libraries/Zigbee/src/ep/ZigbeePM25Sensor.cppImplementation of the PM2.5 sensor endpoint and its methods.
libraries/Zigbee/src/Zigbee.hReordered and added include for the new PM2.5 sensor endpoint.
libraries/Zigbee/examples/Zigbee_PM25_Sensor/Zigbee_PM25_Sensor.inoExample demonstrating usage of the PM2.5 sensor endpoint.
libraries/Zigbee/examples/Zigbee_PM25_Sensor/README.mdDocumentation for the new PM2.5 sensor example.
Files not reviewed (2)
  • CMakeLists.txt: Language not supported
  • libraries/Zigbee/examples/Zigbee_PM25_Sensor/ci.json: Language not supported
Comments suppressed due to low confidence (1)

libraries/Zigbee/examples/Zigbee_PM25_Sensor/README.md:12

  • The heading 'Pressure + Flow Sensor Functions' does not match the focus on PM2.5 sensing; consider updating it to reflect the PM2.5 sensor functionality for clarity.
## Pressure + Flow Sensor Functions

Comment on lines +64 to +69
// reporting_info.u.send_info.delta.u16 = (uint16_t)(delta * 100); // Convert delta to ZCL uint16_t
reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID;
reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC;
float delta_f = delta;
memcpy(&reporting_info.u.send_info.delta.s32, &delta_f, sizeof(float));

Copy link
Preview

CopilotAIApr 3, 2025

Choose a reason for hiding this comment

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

Using memcpy to assign a float value into an integer field (s32) may lead to unintended behavior; consider applying an explicit conversion or scaling as suggested by the commented-out code to properly format the delta value.

Suggested change
//reporting_info.u.send_info.delta.u16 = (uint16_t)(delta * 100); // Convert delta to ZCL uint16_t
reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID;
reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC;
float delta_f = delta;
memcpy(&reporting_info.u.send_info.delta.s32, &delta_f,sizeof(float));
reporting_info.u.send_info.delta.u16 = (uint16_t)(delta *100);// Convert delta to ZCL uint16_t
reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID;
reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC;
//float delta_f = delta;
//memcpy(&reporting_info.u.send_info.delta.s32, &delta_f, sizeof(float));

Copilot uses AI. Check for mistakes.

@me-no-devme-no-dev merged commit23ded93 intoespressif:masterApr 5, 2025
56 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@me-no-devme-no-devme-no-dev approved these changes

@lucasssvazlucasssvazlucasssvaz approved these changes

Assignees

@P-R-O-C-H-YP-R-O-C-H-Y

Labels
Area: ZigbeeIssues and Feature Request about ZigbeeStatus: Pending MergePull Request is ready to be merged
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@P-R-O-C-H-Y@me-no-dev@lucasssvaz

[8]ページ先頭

©2009-2025 Movatter.jp