esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
413 stars 26 forks source link

Binary sensor: Motion detected by camera #651

Open antonio-fiol opened 4 years ago

antonio-fiol commented 4 years ago

Describe the problem you have/What new integration you would like

I would like to be able to act (in HA) upon anything moving in front of the camera.

Please describe your use case for this integration and alternatives you've tried:

I have checked the ESPHome and HA documentation and did not find anything that helps: the camera implementation in HA is really limited, and besides I don't think this belongs outside the ESP32. I have seen some people exploring the concept: https://eloquentarduino.github.io/2020/01/motion-detection-with-esp32-cam-only-arduino-version/ I have seen someone comment on the binary sensor being there: https://www.reddit.com/r/homeassistant/comments/bf1zrw/my_experience_with_esphome_on_home_assistant/elfrfrk/ ...but I can't find any way to enable such a binary sensor neither in ESPHome or HA.

Additional context

I am aware that other (advanced) processing features such as face detection or QR reading have been discarded in #341 , but firstly motion detection was not covered in that request, and secondly motion detection seems (naively) a less complex problem to deal with, and one that would justify (to avoid using bandwidth when not needed) the local processing.

Technical challenge: Would it be possible to do motion detection on the encoded MJPEG stream without fully decoding it?

sergeolkhovik commented 4 years ago

I checked the first link - looks really interesting. I tried to build custom solution with ESP32 and PIR sensor, and it was really unstable. PIR generated many false events, so I decided to postpone that idea.

antonio-fiol commented 4 years ago

Oh, I was definitely not talking about using a PIR, but just using the image data. PIR requires extra hardware and it seems that with the image alone it would be doable.

On Wed, Mar 25, 2020 at 10:39 AM sergeolkhovik notifications@github.com wrote:

I checked the first link - looks really interesting. I tried to build custom solution with ESP32 and PIR sensor, and it was really unstable. PIR generated many false events, so I decided to postpone that idea.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/esphome/feature-requests/issues/651#issuecomment-603740669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFR224NCYIPWFKJZH5RJWTDRJHGOXANCNFSM4LTIPRUQ .

sergeolkhovik commented 4 years ago

Exactly, with PIR I didn't get right result, and would like to have exactly single camera implementation.

jeroenterheerdt commented 3 years ago

has anyone ever looked into this? I found this online https://smartsolutions4home.com/ss4h-sd-smart-doorbell/ and it does everything I need to get rid of my Ring, except for the motion detection...

sokolsok commented 3 years ago

You can use the camera itself as a motion detector. I haven't checked but it should work

fkoteam commented 2 years ago

it would be great. a new algoritm: https://eloquentarduino.github.io/2020/05/easier-faster-pure-video-esp32-cam-motion-detection/