Looking for feedback and testing of my Dahua Home Assistant integration (via HACS)

Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
lol @Holbs

Looking at the UI, what exactly would you want to set with HA? Just Day/Night?

1624033143080.png

And are there ever more profiles other than Day/Night?
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
OK, here's how to call the API if you cURL it (with digest authentication).... now I just need to build this into the Home Assistant integration rroller/dahua

Bash:
# Profile Management, set Day/Night Video Mode
# 0 = Day, 1 = Night

# Get VideoMode
http://IP_ADDRESS/cgi-bin/configManager.cgi?action=getConfig&name=VideoInMode
> table.VideoInMode[0].Config[0]=0

# Set Day VideoMode
http://IP_ADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0

# Set Night VideoMode
http://IP_ADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
OK this is now added to the HA integration 0.5.2. The new service name is called dahua.set_video_profile_mode

Here's an example of how to use it with the UI service explorer in YAML mode where "mode" can be either "Day" or "Night"
YAML:
service: dahua.set_video_profile_mode
data:
  mode: Day
target:
  entity_id: camera.cam4_main


Here's how to use it in the UI within an automation or using the service explorer in the developer tools:

Screen Shot 2021-06-18 at 11.07.40 AM.png
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
haven't touched my HA in 8 months. Still have to install HACS and NEATO. But this is giving me great incentive to get off my butt and get cracking!
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
@wittaj may answer this better than I. I have the Dahua SD4 series PTZ. Always meant to be used with Dahua spotter cameras, but never got around to it just yet. #17 on my to-do list. Since this integration deals with Dahua IP cameras... I wonder if it would be easier to control sending motion / IVS triggered alerts commands from specific spotter cameras to the PTZ so that the PTZ can zoom right in, if this was included in this HA Dahua integration. Or maybe the default method is just as simple.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,868
Reaction score
48,503
Location
USA
@Holbs - You can certainly call up certain presets by API. Question would be would HA or BI be quicker in the response?

I think either way would work, but I would think that HA could give way more functionality? HA is like item 3,456 on my To do list LOL, but one of the things that I could see HA being able to do is if the PTZ has been already spotted and is tracking that it wouldn't interrupt it with another spotter? Maybe better integration with other HA items?
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
@Holbs - You can certainly call up certain presets by API. Question would be would HA or BI be quicker in the response?

I think either way would work, but I would think that HA could give way more functionality? HA is like item 3,456 on my To do list LOL, but one of the things that I could see HA being able to do is if the PTZ has been already spotted and is tracking that it wouldn't interrupt it with another spotter? Maybe better integration with other HA items?
yea... what I like about home automation (HA in this respect) is that IF something happens, THEN all of this happens because of it. I just can't think of too much of what could happen if the spotter cams trigger the PTZ to zoom in... flush my toilet, perhaps? :)
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,868
Reaction score
48,503
Location
USA
LOL, other than flushing the toilet, the main reason for the spotter cam is to get your PTZ pointing to the right spot.

So if your PTZ is looking left and someone comes from the right, you want the PTZ to swing around right and then start tracking them.

It can also help give the PTZ a head start in zooming in.

So my PTZ is set up on the wide zoom to see a bigger picture, so it can track across the street and that sort of thing, but anything on my side of the street, the spotter camera will nudge my PTZ to a comparable field of view the spotter cam sees so the tracking and zooming start a little earlier.

And if you have something in the way that the PTZ keeps locking in on (like a tree or lamp post at night), the spotter cam can help you get past that.
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
LOL, other than flushing the toilet, the main reason for the spotter cam is to get your PTZ pointing to the right spot.

So if your PTZ is looking left and someone comes from the right, you want the PTZ to swing around right and then start tracking them.

It can also help give the PTZ a head start in zooming in.

So my PTZ is set up on the wide zoom to see a bigger picture, so it can track across the street and that sort of thing, but anything on my side of the street, the spotter camera will nudge my PTZ to a comparable field of view the spotter cam sees so the tracking and zooming start a little earlier.

And if you have something in the way that the PTZ keeps locking in on (like a tree or lamp post at night), the spotter cam can help you get past that.
so now the question is... is there any benefit to include the commands via HA instead of BI, with this integration? You are right in that speed of response is important. But if near the same speed, what else would HA do above and beyond from Blue Iris? That's the magic question I can not yet figure out.
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
I’m biased towards home asssistant. It just opens a world of possibilities. For example I turn on my outside lights at night when there’s motion.
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
I’m biased towards home asssistant. It just opens a world of possibilities. For example I turn on my outside lights at night when there’s motion.
I shall be doing just that. Right now (due to tire slashing concerns), I have my LED lights on all night. Wouldn't mind having some of the more powerful glaring lights off at night, trying out this integration so that at 3am, if a Dahua camera HUMAN AI triggers a human, HA turns on all front outdoor lights, change Dahua camera profiles for the added light glare/contrast/gamma, flip the PTZ into the area to track the motion..... and what next? Flush my toilet :)
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,868
Reaction score
48,503
Location
USA
so now the question is... is there any benefit to include the commands via HA instead of BI, with this integration? You are right in that speed of response is important. But if near the same speed, what else would HA do above and beyond from Blue Iris? That's the magic question I can not yet figure out.
I think the If/then is a real potential and something why it is on my list LOL.

An example that has bit me a few times lol:
  • I am outside and see someone walking into the subdivision and my PTZ picks them up and starts tracking.
  • They look shady so I move close to my open garage in case I need a tool.
  • I just triggered a spotter cam and the PTZ goes off the shady character and onto me LOL.
With an If/then that could say if the PTZ is already in a spotter cam state to continue with that tracking would have stopped it from now tracking me LOL.

But then again, there will be a situation where that If/then could miss something.

Once DS gets figured out where I can run a custom model and Faces, I could probably eliminate that by telling the spotter not to trigger if I am the only face in the image.

But that flexibility that @runraid mentions has a lot more possibilities.
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
Just a heads up, with version 0.6.0 of the HA integration it will now create a binary sensor for all event types selected during setup. So you'll have one for CrossLineDetection, VideoMotion, SmartMotionHuman, etc if you selected them.
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
Just a heads up, with version 0.6.0 of the HA integration it will now create a binary sensor for all event types selected during setup. So you'll have one for CrossLineDetection, VideoMotion, SmartMotionHuman, etc if you selected them.
those words... CrossLineDetection and SmartMotionHuman... are those Dahua selected words or your's? I'd rather see Human_AI_Motion or Vehicle_AI_Motion or IVS_Motion.
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
Those are defined by dahua. Those are the event names. In HA you can override it
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
Those are defined by dahua. Those are the event names. In HA you can override it
I'll make that effort to finally migrate from deprecated Z-wave to the new JSmqtt Z-wave and install HACS then try out this integration. No security events since Jan 14th so could be good time to let guard down...a little! Just a little...
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
Just another note, I just updated the integration to 0.7.0 which adds support for Dahua doorbells (VTO). It'll add a binary sensor to Home Assistant that triggers when the doorbell button is pressed.
 

runraid

Getting the hang of it
Joined
May 22, 2020
Messages
155
Reaction score
83
Location
Seattle
If any of you had issues renaming the entities, I've fixed that bug in 0.7.1 :)
 
Top