JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.13k stars 89 forks source link

Feature Request: Person detection #204

Closed lesbass closed 1 year ago

lesbass commented 2 years ago

Is your feature request related to a problem? Please describe. With the latest firmware updates, my C210 is able to tell if a motion is caused by a person or not. Using the official App, I can identify the motion caused by a person from the generic motions (things)

Describe the solution you'd like I would like to have a secondo binary sensor for people motion detection

Describe alternatives you've considered I went through the code but could not identify where to start to understand how to possibly add this feature

JurajNyiri commented 2 years ago

If possible, this will first need to be discovered and added to pytapo library.

Until that happens, this is impossible to implement here.

vingerha commented 2 years ago

My 2 cents, Tapo already offers this (yes...at a price) but there are other free 3rd party solutions that can support this too and probably much better as this is what they were built and supported for, e.g. DOODS/Frigate/Deepstack

slhad commented 1 year ago

My 2 cents, Tapo already offers this (yes...at a price) but there are other free 3rd party solutions that can support this too and probably much better as this is what they were built and supported for, e.g. DOODS/Frigate/Deepstack

I have tried Doods configured with tensorflow and pytorch, results were .... mostly random, and It was for identifying a baby (label "person") in a bed with nightvision, detection was working 3 times out of 5, with tensorflow, anything else was totaly random.

As I don't want (and don't know yet) how to train a model for tensorflow to have trustworthy results, I am willing to at least give a chance to Tapo for trying with their tool that will not run on my cpu and take a 30s analysis for each picture and maybe more reliant because less generalistic than Doods models

vingerha commented 1 year ago

The question here is...will the Tapo integration be any better if doods/tensorflow (I am using deepstack btw) are not good enough. Why repeat the work someone else already did with high effort and further maintenance. Not saying that it is not possible, just doubting effort vs. gain

slhad commented 1 year ago

I will try deepstack ! Still having less cpu consumed by doods or other 3rd party solutions if the results are similar, I will take it.

Having it working with the Tapo integration is simpler for people wanting to test it out in HA without requiring the extra installation/container for deepstack/doods

vingerha commented 1 year ago

I am not sure if it is really simpler. One would still need to add the AI software and configure it to ones needs, it would just be part of the Tapo integration and make that a lot heavier on CPU so I do not see a gain there...but I admit to also not know the various alternatives out there. Maybe a 'person' detection is a lot simpler than I imagine

slhad commented 1 year ago

Maybe I am wrong but seeing from the option of the Tapo app on Android, there is no need to add AI software and configure it, it just Camera options setup to allow Tapo "AI" to work on images and send notifications, please excuse me for the French screenshots,

(Edit: Screenshots to big, don't know how to reduce them)

Screenshot_20221213-155646_Tapo -> Screenshot_20221213-155654_Tapo -> Screenshot_20221213-155757_Tapo

vingerha commented 1 year ago

aha... I thought this was part of the cloud offering.... so taking back my comments ....good to know this and then YES, would be great if this is an option too.

lesbass commented 1 year ago

Yes, I confirm that on my C210 it's a free option, while on the C200 it's a paid option. Don't know why, but it would be nice to have access to that data on my C210, if it is possible.

vingerha commented 1 year ago

I have a c310...I can switch it on and it indeed detects me-as-a-person but to receive 'rich' notifications ...then the paying starts. I would already be happy to know that a person was detected. Tools like deepstack allows to play round a bit more and detect 'me' or my kids. It also detects cat (although sometimes mistaken for dog). My learning: donot make it overcomplex...so this Tapo trick may indeed be good :)

slhad commented 1 year ago

I have a C200 and don't have the Tapo Care thing (paid) and have activated the option but don't have alerts enabled as I use H.A with the camera feed and Doods for now but had seen that for some reason some options have to be enabled to work with the integration.

So maybe C200 as it for free for France ? And as I was wrinting, I see from @vingerha that the 'rich' notifications are the pay part. Would be happy with just person detection boolean as I am monitoring a bed with it :D

lesbass commented 1 year ago

my use case is: I have a small office room with a Neato vacuum cleaner and I would like the vacuum to run every night only if a person has been detected in the room during the day (or every few days if no one is around). So, in my case, a generic person detection sensor would be enough :)

lrlunin commented 1 year ago

Yes, I confirm that on my C210 it's a free option, while on the C200 it's a paid option. Don't know why, but it would be nice to have access to that data on my C210, if it is possible.

Hi, I have just bought C200 in Germany and have the "person detection" feature for free. It works pretty well!

So to have this feature in HA we still need to implement this in pytapo, right?

JurajNyiri commented 1 year ago

Closing as duplicate of https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/304 .