rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
382 stars 73 forks source link

Add support for L46N floodlights and possibly the Lorex equivalent #313

Closed cchamilt closed 9 months ago

cchamilt commented 9 months ago

Hi, Lightingv2 doesn't trigger the floodlights in the later Dahua model L46N. After some exploration and comparison to DMSS call status, it appears that the manual floodlight trigger is only available through the coaxial API. This also requires the table.FloodlightMode.mode to be set to manual or at least not motion detection to stay on. I tried to add it along side the Amcrest work assuming it still works for the older model.

rroller commented 9 months ago

I just looked at your profile, we are in the same city :D

rroller commented 9 months ago

Released in https://github.com/rroller/dahua/releases/tag/0.9.50

josetann commented 9 months ago

Any possibility to add in support for "V261LC" ? I reported earlier how I got it to work, looks like you went the long (correct) way around, but maybe just adding V261LC would work with your fix?

My prior post: https://github.com/rroller/dahua/issues/263

cchamilt commented 9 months ago

Hi, I added in detection with m.startswith("V261LC"), but I didn't assign it the Coaxial API and kept the original LightingV2 calls. It may need the Coaxial API as well. I guess it might be a firmware version specific change.

josetann commented 9 months ago

Hi, I added in detection with m.startswith("V261LC"), but I didn't assign it the Coaxial API and kept the original LightingV2 calls. It may need the Coaxial API as well. I guess it might be a firmware version specific change.

Ah, I must have skipped that particular commit. I bit the bullet and it was there as expected. Except it didn't work. When I tried to turn on or off the light, this error pops up (I had to type it out, it's possible there's a typo in there somewhere):

Failed to call service light/turn_on. 400,message='Bad Request',url=URL(http://192.168.1.78:80/cgi-bin/configManager.cgi?action=setConfig&FloodLightMode.Mode=2')

Does it look like an error in the code, or is it handled differently than the ASH26 (because in prior versions that I hacked in support, I just threw that in the same line as the ASH26 and it worked)?

cchamilt commented 9 months ago

Hmm, the floodlight mode should be exclusive to the newer floodlights.

cchamilt commented 9 months ago

It appears that the V261LC supports the Coaxial API but not the floodlightmode. So they will need separated out as different floodlight types and the logic split by that instead of Coaxial API support.

cchamilt commented 9 months ago

OK, I separated out the floodlightmode logic more clearly for the 4x floodlights. So it shouldn't effect you now. Please check the new PR I just made.