-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Support for ZigbeeButton #10898
Comments
@P-R-O-C-H-Y could you please have a quick look? |
I changed the reportButton to the following, and it now works, though I'm not sure this is the optimal way:
Especially the hardcoded dst adress and endpoint... |
Hi @mvermand22 I will take a look. For sure the hardcoded Endpoint+Address cannot exist in the Button code. You can add multiple funtion call of reportButton() so you can hardcode the endpoint/address in the sketch if its needed:
Get inspired by the On/Off switch example. |
Hi @P-R-O-C-H-Y thanks for your feedback. I started from the ZigbeeDimmableLight code, as the ZigbeeSwitch has a lot of things going on to bind light bulbs, which I didn't need. ZigbeeDimmableLight does not send feedback to the Zigbee hub, ZigbeeSwitch and ZigbeeTempSensor do. ZigbeeTempSensor has a reportTemperature method which uses ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT:
But when I create a similar method to send buttonState, the attribute messages are not sent.
I need to set address_mode to ESP_ZB_APS_ADDR_MODE_16_ENDP_PRESENT:
Then it works and sends the attribute message. Full ZigbeeButton code:
cpp:
It works, but with the requirement of address_mode = ESP_ZB_APS_ADDR_MODE_16_ENDP_PRESENT, which is strange. |
Related area
Zigbee
Hardware specification
ESP32-H2, ESP32-C6
Is your feature request related to a problem?
I would like a ZigbeeButton endpoint that allows to get notified of button state change requests from the hub and is also able to report back any change in state that is imposed locally (physical button pressed).
I tried to build it myself, starting from the ZigbeeDimmableLight endpoint implementation, but I can't get the code to report a local change to the Zigbee hub. It simply does not send anything back.
Describe the solution you'd like
I created this so far:
ZigbeeButton.h
ZigbeeButton.cpp
This is my .ino file:
It compiles and the ESP32-H2 module gets notified from messages sent from the hub (handled in "setButton"), but when I call zbButton.setButtonState(true); and zbButton.reportButton(); then nothing is sent back to the hub.
Any idea what I am doing wrong?
I also added a ZigbeeTempSensor and that nicely reports back the temperature to the hub
Describe alternatives you've considered
No response
Additional context
No response
I have checked existing list of Feature requests and the Contribution Guide
The text was updated successfully, but these errors were encountered: