-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Motion sensor example for Zigbee #10684
Comments
Hi @ilker-aktuna, there is currently no PIR endpoint available in the Zigbee library. |
ok. what is the correct path for creating my own implementation ? |
Here you can find the tempSensor EP source file. If you will have any working example + sources for the EP PIR sensor, feel free to open a pull request with this addition. I will be glad to help on that to make it available for everyone :) |
ok thank you. |
There is no default config for PIR motion sensor in esp-zigbee-sdk. You may need to create your own "default config", which means declaring the clusters it should contain. To be honest it's not that simple to do a new EP type with all the stuff around. Maybe you can keep this feature request open and I will take a look into it and add the implementation in future updates. I am planning to add a Common sensor device type, where you will be able to add any clusters into it easily. So you will be able to create a single/multi sensor device. |
ok. good. |
Hi @ilker-aktuna, you can check the PR I linked. I have added the PIR motion sensor (occupancy) endpoint. |
sorry for hijacking :-)) -> could you add environmental sensors too? CO2, VOC sensor? |
In progress right now :) almost done with the CO2. |
I could get the example from the PR but I also need the updated core library to test this. |
@P-R-O-C-H-Y |
@ilker-aktuna Please follow the Manual installation part of documentation. You can use the branch you downloaded instead of cloning :) https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#windows-manual-installation |
@P-R-O-C-H-Y |
@ilker-aktuna If you go to the Arduino IDE Tools menu -> Board: ![]() |
ok. now I compiled and trying with my Hubitat hub. The device starts , then I start pairing on my Hub. On the device, I see that it is rebooting while tryign to connect to Zigbee network:
|
if I put the log level to "verbose" , I get this line before reboot:
I see in the code:
but I don'T understand why it goes into that. Hub is still in pairing mode when it does that. |
This If you want to investigate this further, you will need to sniff the Zigbee network and send us a pcap file from the WireShark. Do sou have another C6/H2 devkit available? |
@P-R-O-C-H-Y |
@ilker-aktuna please follow this comment: #10601 (comment) |
@P-R-O-C-H-Y |
@P-R-O-C-H-Y |
I followed the tutorial and did everything.
on COM19 , I have the esp32-c6 with esp_ot_rcp binary I have the key "5A:69:67:42:65:65:41:6C:6C:69:61:6E:63:65:30:39" on pre-configured keys list Wireshark protocol zigbee. then what is missing ? |
The |
I am closing this issue as it's solved by #10720. But let's continue here with the "debugging" on the Hubitat. |
@P-R-O-C-H-Y , @michapr |
If you can folks install the ESP-IDF v5.3 and build/flash it on your own by using idf.py command. The main difference I there might be is a Board you are using and idk yours, but I sm using a UART port on the H2 Espressifs devkit. Can you tell me your setup? |
I already compiled myself and flashed using idf.py before you shared the binaries. I had the same result. |
@P-R-O-C-H-Y So I got the attached traces showing the issue on my zigbee network. So the first file is capture when my hub has already paired and shows a motion sensor. Btw, do you have any idea on how I can use sniffer on esp32-c6 zero which has no UART port ? |
Is this something that is already on the horizon, or to complex for a quickshot? Im currently failing on adapting TempSensor example and registering a cluster for an object speed measuring sensor. Basically I only need one float attribute speed but had yet no luck on figuring out the co working with esp zigbee SDK. https://docs.espressif.com/projects/esp-zigbee-sdk/en/latest/esp32/user-guide/zcl_custom.html |
@P-R-O-C-H-Y |
@P-R-O-C-H-Y |
Finally I had some time to test the motion sensor example. followed by but on the hub "motion" stated does not change. Btw, my sensor also has temperature capability. (and also most of the zigbee motion sensor devices/profiles have dual function as motion & temperature) Should we have a separate device type supporting both motion and temperature ? |
Hi @ilker-aktuna, there is no issue with the Occupancy sensor when its connected to HomeAssistant. I don't have the hubitat device so Idk if I would be able to help you more on this. |
Hi @P-R-O-C-H-Y , I understand that it works perfectly with HA but I am trying to make this run on a Hubitat hub. 2 EPs on 1 device might be a problem on Hubitat side. I will try to get help from Hubitat community on that (because their support is not really taking any feedback) About the occupancy sensor; can you give me a specification on how it is designed on esp32 side ? |
The main thing is the Zigbee 3.0 Specification. So there are many defined Home Automation profiles, which defines what the device is doing. So each end device have its own type, only some few sensors are just "Simple Sensor" device type. This is how the systems recognizes the devices (also by check of the clusters). I think this is something not completely done on the Hubitat side. You can try to create an endpoint device having custom clusters with extended functionality, but I am not sure if it will work well. The occupancy is implemented as: having this cluster: |
@ilker-aktuna Good example of multiple functionality device in simple endpoint is the TemperatureSensor end device. |
@P-R-O-C-H-Y |
You can implement that in a separate cpp and header file directly in your sketch. Just don't forget to use correct includes in the files :) |
@P-R-O-C-H-Y Also, as another option, I don't understand how I should add the second cluster to the motion sensor. |
did you notice my question above ? |
Hi @ilker-aktuna, Only the Temperature sensor have the option to add a Humidity cluster, as the device type for HA is Temperature_Humidity_Sensor. SO there is the function addHumidity to add this cluster to the endpoint. For all other devices, you can just combine multiple endpoints in the sketch itself with unique numbers. As example you can check the Pressure + Flow example : arduino-esp32/libraries/Zigbee/examples/Zigbee_Pressure_Flow_Sensor/Zigbee_Pressure_Flow_Sensor.ino Line 41 in 6208239
|
@P-R-O-C-H-Y I just have a side question: |
@ilker-aktuna I am glad to hear that its now working also with the Hubitat. About the C6 and WiFi+Zigbee coexistence, please refer to this issue #10871 |
@P-R-O-C-H-Y |
I have a problem with status reporting of the motion sensor. I believe the corrdinator shouldn't need to send a read command because the device will update status when needed. |
Can you provide more info of what is your setup? Who is the coordinator and if you use any system like HA with ZHA or Z2M? |
Coordinator is Hubitat hub. |
Please can we move to our Discord server to discuss this or to discussions to not spam closed issue? |
sure what is the address ? |
Related area
Zigbee , ZHA
Hardware specification
Support for motion sensor
Is your feature request related to a problem?
I am working on a motion sensor. Is the motion sensor feature available in Zigbee stack ?
if yes, where can I find an example code ?
Describe the solution you'd like
motion sensor zigbee example
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: