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

Motion sensor example for Zigee #10684

Open
1 task done
ilker-aktuna opened this issue Dec 4, 2024 · 14 comments · May be fixed by #10720
Open
1 task done

Motion sensor example for Zigee #10684

ilker-aktuna opened this issue Dec 4, 2024 · 14 comments · May be fixed by #10720
Assignees
Labels
Status: In Progress Issue is in progress Type: Feature request Feature request for Arduino ESP32

Comments

@ilker-aktuna
Copy link

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

  • I confirm I have checked existing list of Feature requests and Contribution Guide.
@ilker-aktuna ilker-aktuna added the Type: Feature request Feature request for Arduino ESP32 label Dec 4, 2024
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Dec 5, 2024
@P-R-O-C-H-Y
Copy link
Member

Hi @ilker-aktuna, there is currently no PIR endpoint available in the Zigbee library.
The occupancy cluster (PIR) is available in esp-zigbee-sdk, so if you want you can create your own implementation of this endpoint type. There is currently no plan to add it. But I will have this in the list of feature requests for the Zigbee library.

@ilker-aktuna
Copy link
Author

ok. what is the correct path for creating my own implementation ?
For example, there is the temp. sensor example. Where can I find the code for temperature sensor ? maybe I can clone it and change the cluster IDs etc.

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

Here you can find the tempSensor EP source file.
https://github.com/espressif/arduino-esp32/blob/release/v3.1.x/libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp

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

@ilker-aktuna
Copy link
Author

ok thank you.
Which source should I look to find options like "ESP_ZB_DEFAULT_TEMPERATURE_SENSOR_CONFIG" or "ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT" ?

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

P-R-O-C-H-Y commented Dec 6, 2024

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.

@ilker-aktuna
Copy link
Author

ok. good.
In fact, if I had time, I would like to learn and add a new EP type as a contribution but I won't have time to learn soon.
I'll be waiting. But if I do something, I'll inform here.

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

Hi @ilker-aktuna, you can check the PR I linked. I have added the PIR motion sensor (occupancy) endpoint.
Feel free to test. I have been testing using C6 + HC-SR501 PIR module connecting to HomeAssistant.

@michapr
Copy link

michapr commented Dec 12, 2024

sorry for hijacking :-)) -> could you add environmental sensors too? CO2, VOC sensor?
(don't want to open new issue....)

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

In progress right now :) almost done with the CO2.

@ilker-aktuna
Copy link
Author

ilker-aktuna commented Dec 12, 2024

Hi @ilker-aktuna, you can check the PR I linked. I have added the PIR motion sensor (occupancy) endpoint. Feel free to test. I have been testing using C6 + HC-SR501 PIR module connecting to HomeAssistant.

I could get the example from the PR but I also need the updated core library to test this.
how can I get the merged code for the library ?

@ilker-aktuna
Copy link
Author

@P-R-O-C-H-Y
I have downloaded the branch with PR but I can't find any way to update the esp32-core on my Windows pc.
is that even possible ?

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

@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

@ilker-aktuna
Copy link
Author

ilker-aktuna commented Dec 13, 2024

@P-R-O-C-H-Y
ok I unzipped the folder to the Arduino/hardware/espressif/esp32 folder and then used the "get.exe" under tool folder.
but on my PC , under Sketchbook Directory there was no "hardware" folder.
So now I believe I have 2 installations of arduino-esp32 on my PC (one is the default one which is accessible through "boards manager", the other one is your branch which I installed manually)
How shall I use the one that I manually installed ?

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

@ilker-aktuna If you go to the Arduino IDE Tools menu -> Board:
You can see 2 options for ESP32 Arduino. The one with (in sketchbook) is the manual installed core.
So you can see in the image, I am using the manually installed core for developing :)

Screenshot 2024-12-14 at 0 22 58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress Issue is in progress Type: Feature request Feature request for Arduino ESP32
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants