rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
395 stars 80 forks source link

AD410 Control of Deterrent Light #116

Closed HeedfulCrayon closed 2 years ago

HeedfulCrayon commented 2 years ago

Is your feature request related to a problem? Please describe. Not really

Describe the solution you'd like I would like to be able to control the state of the deterrent light on the AD410 in home assistant

Describe alternatives you've considered I have considered making the webrequest myself to control it Turn On

http:///cgi cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][1].Mode=ForceOn&Lighting_V2[0][0][1].State=On

Turn Off

http:///cgi cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][1].Mode=Off

Turn On Strobe

http:///cgi cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][1].Mode=ForceOn&Lighting_V2[0][0][1].State=Flicker

Adjust Brightness

http:///cgi cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][1].MiddleLight[0].Light=<brightness level 0-100>

Get Brightness

http:///cgi cgi-bin/configManager.cgi?action=getConfig&Lighting_V2[0][0][1].MiddleLight[0].Light

rroller commented 2 years ago

I bought an AD410 so I can work on getting this soon. I'll have some free time in the next few weeks and will try to knock this out.

GaryOkie commented 2 years ago

Hey Ronnie - sure good to hear that you're getting an AD410. It's working quite well with your integration as-is (using events). There are some fine tuning needed for the sensors as you have already heard.

There is also a new "stateless" Button Entity in the latest HASS (2021.12) that would be a slightly better fit for the doorbell button than a binary sensor. We can look at that as an enhancement request if it makes sense.

Oh, and about this little light that shines downward from the doorbell being called a "deterrent light" by Amcrest - HA, that's funny.

BTW - the Amcrest SmartHome app already has the option to turn on the light or make it strobe if motion or human is detected. I'm not sure how useful adding all these services would be - especially for "deterrence". And since the light is already quite dim, determining its brightness and adjusting it through HASS is quite the edge case.

@HeedfulCrayon - how do you see these HASS services being used effectively to control such a weak light? If it were a flood light - that's a different story.

HeedfulCrayon commented 2 years ago

@GaryOkie I would prefer not to have the amcrest smart home app on my phone as it is a useless app IMO. The reason why I want to control the light is because my porch doesn't have a whole lot of lighting as is, and this would help deter someone from possibly trying to steal the doorbell. Plus the human detection turning on the light is all day. I only want to have this happen specifically during the wee hours of the morning (after I have gone to bed)

HeedfulCrayon commented 2 years ago

@rroller I wasn't entirely sure, but the ring of light around the doorbell may be able to have its color changed too. That would be awesome to have. My plan would be to have it turn red after the kids are in bed (to hopefully prevent someone from ringing it so it doesn't wake the kids up)

GaryOkie commented 2 years ago

@HeedfulCrayon - I agree that being able to change the button ring color would be a useful feature, but I sure don't think it was enabled in the AD410. ​I have read that the very similar Lorex/Dahua 2K doorbell has this feature though.

I certainly understand wanting to avoid use of the SH app. I do as well - except for the few times I need to answer the door remotely. It's essential then. You also can't avoid using the app to set up the darn thing.

Everyone has different needs, so my apologies for questioning your enhancement request to control the light. What I was really questioning is do we really need 5 more services developed?

In any case, it's up to RRoller to decide.

rroller commented 2 years ago

The security light feature is released in https://github.com/rroller/dahua/releases/tag/0.9.28 Please give it a try and let me know, thanks!

rroller commented 2 years ago

Resolving this issue now that the security light is now supported with this integration. Thanks for the idea! Please reopen if you have any issues.