Skip to content
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

feat(Zigbee): Adding Zigbee Wind speed sensor endpoint #10455

Merged
merged 25 commits into from
Mar 12, 2025

Conversation

lboue
Copy link
Contributor

@lboue lboue commented Oct 13, 2024

Description of Change

This PR add a new Zigbee endpoint - Wind speed sensor.

However, in the HA (ZHA integration) the wind speed cluster is not supported yet without a need for custom quirk.
For easiest approach on how to handle the data within HA, check the README.md file.

Tests scenarios

Tested using C6 and HomeAssistant (ZHA).

Related links

esp-zigbee-sdk: Add HA standard wind speed sensor device default config value #451

Copy link
Contributor

github-actions bot commented Oct 13, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "Create ZigbeeWindSpeedSensor.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "Create ZigbeeWindSpeedSensor.h":
    • summary looks empty
    • type/action looks empty
  • the commit message "Create ZigbeeWindSpeedSensor.ino":
    • summary looks empty
    • type/action looks empty
  • the commit message "Create ci.json":
    • summary looks empty
    • type/action looks empty
  • the commit message "Rename ZigbeeWindSpeedSensor.ino to Zigbee_Wind_Speed_Sensor.ino":
    • summary looks empty
    • type/action looks empty
  • the commit message "Rename ci.json to ci.json":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update CMakeLists.txt":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update README.md":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update Zigbee.h":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update ZigbeeWindSpeedSensor.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update ZigbeeWindSpeedSensor.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update ZigbeeWindSpeedSensor.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update ZigbeeWindSpeedSensor.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update ZigbeeWindSpeedSensor.ino":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update ZigbeeWindSpeedSensor.ino":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update Zigbee_Wind_Speed_Sensor.ino":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update Zigbee_Wind_Speed_Sensor.ino":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update Zigbee_Wind_Speed_Sensor.ino":
    • summary looks empty
    • type/action looks empty
  • the commit message "add missing sdkconfig include":
    • summary looks empty
    • type/action looks empty
  • the commit message "add readme":
    • summary looks empty
    • type/action looks empty
  • the commit message "update example":
    • summary looks empty
    • type/action looks empty

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

⚠️

The source branch "WindSpeedSensor" incorrect format:

  • contains uppercase letters. This can cause troubles on case-insensitive file systems (macOS).
    Please rename your branch.

👋 Hello lboue, 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 da5080d

Copy link
Contributor

github-actions bot commented Oct 13, 2024

Test Results

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

Results for commit da5080d.

♻️ This comment has been updated with latest results.

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

P-R-O-C-H-Y commented Oct 14, 2024

@lboue If you need any help let me know. We can also open a private chat on any platform :)
I am really happy to see adding new endpoint!

@lboue
Copy link
Contributor Author

lboue commented Oct 14, 2024

@P-R-O-C-H-Y Can I write to you on Discord?

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

P-R-O-C-H-Y commented Oct 14, 2024

@P-R-O-C-H-Y Can I write to you on Discord?

@lboue Sure, find me under #prochyesp

@lboue
Copy link
Contributor Author

lboue commented Oct 15, 2024

@P-R-O-C-H-Y Can I write to you on Discord?

@lboue Sure, find me under #prochyesp

In which discord server?

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

P-R-O-C-H-Y commented Oct 15, 2024

@P-R-O-C-H-Y Can I write to you on Discord?

@lboue Sure, find me under #prochyesp

In which discord server?

No need for discord server, just PM me on Discord.

Use ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID device id
@VojtechBartoska VojtechBartoska changed the title Zigbee Wind speed sensor example feat(Zigbee): Zigbee Wind speed sensor example Nov 4, 2024
@VojtechBartoska VojtechBartoska changed the title feat(Zigbee): Zigbee Wind speed sensor example feat(Zigbee): Adding Zigbee Wind speed sensor example Nov 4, 2024
@P-R-O-C-H-Y P-R-O-C-H-Y changed the title feat(Zigbee): Adding Zigbee Wind speed sensor example feat(Zigbee): Adding Zigbee Wind speed sensor endpoint Mar 11, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y added Area: Zigbee Issues and Feature Request about Zigbee and removed Type: Example Issue is related to specific example. labels Mar 11, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y marked this pull request as ready for review March 11, 2025 10:21
@P-R-O-C-H-Y
Copy link
Member

@lboue Can you give it a try :) I did update it to latest version of master + done all necessary changes in order to have it supported.

@lboue
Copy link
Contributor Author

lboue commented Mar 11, 2025

Hello @P-R-O-C-H-Y. Thank you for your work.
I did a test by replacing the code of the Zigbee library with that of this PR and I get the following error:

Linking everything together...
"C:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-rv32\\2411/bin/riscv32-esp-elf-g++" "-Wl,--Map=C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7/Zigbee_Wind_Speed_Sensor.ino.map" "-LC:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/lib" "-LC:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/ld" "-LC:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/qio_qspi" -Wl,--wrap=esp_panic_handler "@C:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/flags/ld_flags" "@C:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/flags/ld_scripts" -Wl,--start-group "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\sketch\\Zigbee_Wind_Speed_Sensor.ino.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ZigbeeCore.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ZigbeeEP.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ZigbeeHandlers.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeAnalog.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeCarbonDioxideSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeColorDimmableLight.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeColorDimmerSwitch.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeContactSwitch.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeDimmableLight.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeDoorWindowHandle.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeFlowSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeGateway.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeLight.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeOccupancySensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeePressureSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeRangeExtender.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeSwitch.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeTempSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeThermostat.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeVibrationSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeWindSpeedSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeWindowCovering.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\core\\variant.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\core\\core.a" -lesp_zb_api.ed -lzboss_stack.ed -lzboss_port.native "@C:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/flags/ld_libs" -Wl,--end-group -Wl,-EL -o "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7/Zigbee_Wind_Speed_Sensor.ino.elf"
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `windspeed_sensor_value_update(void*)':
C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:48:(.text._ZL29windspeed_sensor_value_updatePv+0x14): undefined reference to `ZigbeeWindSpeedSensor::setWindSpeed(float)'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `setup()':
C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:67:(.text._Z5setupv+0x60): undefined reference to `ZigbeeWindSpeedSensor::setMinMaxValue(float, float)'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:70:(.text._Z5setupv+0x78): undefined reference to `ZigbeeWindSpeedSensor::setTolerance(float)'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `setup()':
C:\Users\ludov\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-bcb3c32d-v1\esp32c6/include/freertos/FreeRTOS-Kernel/include/freertos/task.h:394:(.text._Z5setupv+0x13e): undefined reference to `ZigbeeWindSpeedSensor::setReporting(unsigned short, unsigned short, float)'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `loop()':
C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:87:(.text._Z4loopv+0x34): undefined reference to `ZigbeeWindSpeedSensor::reportWindSpeed()'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `_GLOBAL__sub_I_zbWindSpeedSensor':
C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:113:(.text.startup._GLOBAL__sub_I_zbWindSpeedSensor+0x10): undefined reference to `ZigbeeWindSpeedSensor::ZigbeeWindSpeedSensor(unsigned char)'
collect2.exe: error: ld returned 1 exit status

Using library Zigbee at version 3.2.0 in folder: C:\Users\ludov\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0-RC1\libraries\Zigbee 
exit status 1

Compilation error: exit status 1

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

Hello @P-R-O-C-H-Y. Thank you for your work. I did a test by replacing the code of the Zigbee library with that of this PR and I get the following error:

Linking everything together...
"C:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-rv32\\2411/bin/riscv32-esp-elf-g++" "-Wl,--Map=C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7/Zigbee_Wind_Speed_Sensor.ino.map" "-LC:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/lib" "-LC:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/ld" "-LC:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/qio_qspi" -Wl,--wrap=esp_panic_handler "@C:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/flags/ld_flags" "@C:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/flags/ld_scripts" -Wl,--start-group "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\sketch\\Zigbee_Wind_Speed_Sensor.ino.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ZigbeeCore.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ZigbeeEP.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ZigbeeHandlers.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeAnalog.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeCarbonDioxideSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeColorDimmableLight.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeColorDimmerSwitch.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeContactSwitch.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeDimmableLight.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeDoorWindowHandle.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeFlowSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeGateway.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeLight.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeOccupancySensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeePressureSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeRangeExtender.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeSwitch.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeTempSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeThermostat.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeVibrationSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeWindSpeedSensor.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\libraries\\Zigbee\\ep\\ZigbeeWindowCovering.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\core\\variant.cpp.o" "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7\\core\\core.a" -lesp_zb_api.ed -lzboss_stack.ed -lzboss_port.native "@C:\\Users\\ludov\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.4-bcb3c32d-v1\\esp32c6/flags/ld_libs" -Wl,--end-group -Wl,-EL -o "C:\\Users\\ludov\\AppData\\Local\\Temp\\arduino\\sketches\\495D0AE124B6DE1A18788577EECFA7F7/Zigbee_Wind_Speed_Sensor.ino.elf"
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `windspeed_sensor_value_update(void*)':
C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:48:(.text._ZL29windspeed_sensor_value_updatePv+0x14): undefined reference to `ZigbeeWindSpeedSensor::setWindSpeed(float)'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `setup()':
C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:67:(.text._Z5setupv+0x60): undefined reference to `ZigbeeWindSpeedSensor::setMinMaxValue(float, float)'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:70:(.text._Z5setupv+0x78): undefined reference to `ZigbeeWindSpeedSensor::setTolerance(float)'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `setup()':
C:\Users\ludov\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-bcb3c32d-v1\esp32c6/include/freertos/FreeRTOS-Kernel/include/freertos/task.h:394:(.text._Z5setupv+0x13e): undefined reference to `ZigbeeWindSpeedSensor::setReporting(unsigned short, unsigned short, float)'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `loop()':
C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:87:(.text._Z4loopv+0x34): undefined reference to `ZigbeeWindSpeedSensor::reportWindSpeed()'
C:/Users/ludov/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2411/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\ludov\AppData\Local\Temp\arduino\sketches\495D0AE124B6DE1A18788577EECFA7F7\sketch\Zigbee_Wind_Speed_Sensor.ino.cpp.o: in function `_GLOBAL__sub_I_zbWindSpeedSensor':
C:\Users\ludov\Documents\GitHub\arduino-esp32\libraries\Zigbee\examples\Zigbee_Wind_Speed_Sensor/Zigbee_Wind_Speed_Sensor.ino:113:(.text.startup._GLOBAL__sub_I_zbWindSpeedSensor+0x10): undefined reference to `ZigbeeWindSpeedSensor::ZigbeeWindSpeedSensor(unsigned char)'
collect2.exe: error: ld returned 1 exit status

Using library Zigbee at version 3.2.0 in folder: C:\Users\ludov\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0-RC1\libraries\Zigbee 
exit status 1

Compilation error: exit status 1

@lboue Fixed :)

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
Zigbee/examples/Zigbee_Color_Dimmer_Switch⚠️ +2520⚠️ +2520000000⚠️ +2520
Zigbee/examples/Zigbee_Gateway⚠️ +2520⚠️ +252000----⚠️ +2520
Zigbee/examples/Zigbee_On_Off_Switch⚠️ +2520⚠️ +2520000000⚠️ +2520
Zigbee/examples/Zigbee_Range_Extender⚠️ +2520⚠️ +2520000000⚠️ +2520
Zigbee/examples/Zigbee_Thermostat⚠️ +2520⚠️ +2520000000⚠️ +2520
Zigbee/examples/Zigbee_Analog_Input_Output------0000--
Zigbee/examples/Zigbee_CarbonDioxide_Sensor------0000--
Zigbee/examples/Zigbee_Color_Dimmable_Light------0000--
Zigbee/examples/Zigbee_Contact_Switch------0000--
Zigbee/examples/Zigbee_Dimmable_Light------0000--
Zigbee/examples/Zigbee_OTA_Client------0000--
Zigbee/examples/Zigbee_Occupancy_Sensor------0000--
Zigbee/examples/Zigbee_On_Off_Light------0000--
Zigbee/examples/Zigbee_Pressure_Flow_Sensor------0000--
Zigbee/examples/Zigbee_Scan_Networks------0000--
Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy------0000--
Zigbee/examples/Zigbee_Temperature_Sensor------0000--
Zigbee/examples/Zigbee_Vibration_Sensor------0000--
Zigbee/examples/Zigbee_Wind_Speed_Sensor------------
Zigbee/examples/Zigbee_Window_Covering------0000--

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

@lboue Bad thing is that ZHA in HomeAssistant does not recognize this cluster, so the data are not visible.
Don't know about the Z2M. What is the "platform" or integration you are using or willing to?

@lboue
Copy link
Contributor Author

lboue commented Mar 11, 2025

Thanks, it works now:

14:48:32.992 -> ============ After Setup End =============
14:48:33.985 -> [  3563][D][ZigbeeWindSpeedSensor.cpp:73] setWindSpeed(): Setting windspeed to 2900
14:48:35.008 -> [  4563][D][ZigbeeWindSpeedSensor.cpp:73] setWindSpeed(): Setting windspeed to 2900
14:48:35.998 -> [  5563][D][ZigbeeWindSpeedSensor.cpp:73] setWindSpeed(): Setting windspeed to 2900
14:48:36.983 -> [  6563][D][ZigbeeWindSpeedSensor.cpp:73] setWindSpeed(): Setting windspeed to 2900

You can validate.

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

I have also made it to work in ZHA, with the HomeAssistant Automatization. Which reads the Sensor Attribute and stores it in a variable. And that variable(entity) can be used in charts or anywhere in dashboard :)

@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 Mar 11, 2025
Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

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

LGTM, all tested.
In HA (zha integration), you need to create automation to read the attribute and store the value. As ZHA does not support wind speed by default.

@P-R-O-C-H-Y P-R-O-C-H-Y requested a review from me-no-dev March 11, 2025 14:09
@P-R-O-C-H-Y P-R-O-C-H-Y added this to the 3.2.0 milestone Mar 11, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Pending Merge Pull Request is ready to be merged and removed Status: Review needed Issue or PR is awaiting review labels Mar 12, 2025
@me-no-dev me-no-dev merged commit 07d6a5a into espressif:master Mar 12, 2025
56 checks passed
@lboue lboue deleted the WindSpeedSensor branch March 17, 2025 16:28
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.

4 participants