Dahua and Amcrest integration for cameras and doorbells

Would this work for Dahua access controller? DHI-ASI1201E

This was very Helpful. Thanks for your work!!

1 Like

@tomw this is a great integration, thank you for this!

I have an Amcrest AD110, and this doorbell has a bug that causes it to reboot at night when new RTSP streams connect to it, and the IR is on. The fix for this is to adjust the IR settings via API, however, when new RTSP streams connect to the Camera, it resets the IR settings, and therefore, the reboots start again.

I see in the Hubitat logs that my AD110 creates a log for these new connections, but not an event: "[Code:RtspSessionState, action:Pulse, index:0, data:[Device:BlueIrisIPAddress, Port:60227, SessionId:36748584, State:PLAY, Url:rtsp://ip_address/cam/realmonitor? .... "

I'm wondering if there is a way to see this particular event in the Event log of the device, versus the debug logs section? I believe this would allow me to create a custom attribute trigger to change the IR settings anytime it sees this event.

If there's another way to do this I'm open to it.

I picked up a few IP8M-2796EB-AI units and noticed the events weren't populating for human and vehicle detection when an IVS rule was NOT being used. In addition, the SmartDetectType seemed retain the last type even after motion goes inactive.

I made a few tweaks to reset the SmartDetectType as well as support for Human and Vehicle Smart Motion Types without having IVS enabled.

Everything appears to be working fine, including my AD410.

Added an attribute for direction as well. I've made these changes in a local copy only for now.

1 Like

I can confirm this did the trick!

You do need to make sure that IVMS is selected under Smart Plan.

I just added an attribute to return the channel number (0 relative) because I found that rather than having each camera defined as a device, I can just define the NVR and it will pass the motion and IVS events from the camera thru to Hubitat.

In my setup, I only care about IVS events where a human or vehicle has caused the event.

When that happens, I get a push notification, a "spoken" notification and the appropriate zone is indicated on my HomeAssistant floor plan.

I still need to do some testing, but this means that each wired camera can be accessed thru the NVR and does not need to be an actual network client.

1 Like

I added the ability to select only certain NVR channels for event processing. For a camera, you can use 0 or ALL. Still testing this on a local copy.

I also set the driver to subscribe to only some events related to motion (VideoMotion, SmartMotionHuman, SmartMotionVehicle, CrossLineDetection, CrossRegionDetection).

This reduces the amount of work the hub has to do since it ignores all of the other events.

The device is tripping on a crossed line but I can't seem to get the image part to work. Any ideas on what might be causing the timeout?

dev:1102025-01-16 02:06:25.579 PM
debug
take() failed: Read timed out
dev:1102025-01-16 02:06:24.288 PM
debug
eventStreamStatus: START: EventStream Started
dev:1102025-01-16 02:06:17.378 PM
debug
[Code:CrossLineDetection, action:Stop, index:0, data:[CfgRuleId:2, Class:Normal, CountInGroup:3, DetectLine:[[2676, 3596], [5861, 2333]], Direction:LeftToRight, EventID:10021, EventSeq:20, FrameSequence:1303617, GroupID:20, Mark:0, Name:Rule 1, Object:[Action:Appear, BelongID:0, BoundingBox:[4224, 1712, 4992, 4656], Center:[4608, 3184], Confidence:0, FrameSequence:0, ObjectID:377, ObjectType:Unknown, RelativeID:0, SerialUUID:, Source:0.0, Speed:0, SpeedTypeInternal:0], PTS:43553243430.0, Priority:0, RuleID:2, RuleId:1, Source:0.0, Track:, UTC:1737036361, UTCMS:60]]

dev:1102025-01-16 02:06:17.081 PM
debug
[Code:IntelliFrame, action:Pulse, index:0, data:[Action:Start]]
dev:1102025-01-16 02:06:15.186 PM
debug
Cross line detected: Rule 1
dev:1102025-01-16 02:06:15.181 PM
debug
[Code:CrossLineDetection, action:Start, index:0, data:[CfgRuleId:2, Class:Normal, CountInGroup:3, DetectLine:[[2676, 3596], [5861, 2333]], Direction:LeftToRight, EventID:10021, EventSeq:20, FrameSequence:1303617, GroupID:20, Mark:0, Name:Rule 1, Object:[Action:Appear, BelongID:0, BoundingBox:[4224, 1712, 4992, 4656], Center:[4608, 3184], Confidence:0, FrameSequence:0, ObjectID:377, ObjectType:Unknown, RelativeID:0, SerialUUID:, Source:0.0, Speed:0, SpeedTypeInternal:0], PTS:43553243430.0, Priority:0, RuleID:2, RuleId:1, Source:0.0, Track:, UTC:1737036361, UTCMS:60]]

Did you ever publish this update on HPM that allows for using only NVR and subscribing to the appropriate channels - vs having the discovery create devices for each camera where the Hubitat hub then reaches out to each camera directly?
My experience is that using the NVR-only (and subscribing to the channels) is much more accurate vs connecting to the cameras directly.
At least it seems that the integration via HACS in Home Assistant uses the NVR-only mode and in general, I've found to be more reliable than on Hubitat. Ultimately, I'd like to remove HA from my setup - so curious about having this functionality on Hubitat so I can test and see if things improve.

Thank you!

So, once you're able to discern which camera has an event you're interested in, this call will display that channel in full screen on the NVR display

http://user:password@ip-address-of-nvr/cgi-bin/split.cgi?action=setMode&channel=1&mode=split1&group=channelnumber (0 relative)

This call returns it to normal (for me 25 channel display). See the API for all of the options.

http://user:password@nvr-ip-address/cgi-bin/split.cgi?action=setMode&channel=1&mode=split25&group=0

In my setup, a crossline event with either human or vehicle attribute is shown in full screen and 60 seconds later the second call returns the display to normal.

All done thru Rule Machine

Hal

I am a newbie to Hubitat, and am struggling a bit to set up a RM rule to periodically do the "take" command for cameras. There's just enough delta in how RM offers choices now that I am unable to follow the example syntax above. I have a periodic trigger set u. I have chosen "Set Variable, Mode or File, Run Custom Action" => "Run Custom Action" as the action type I will create. What on earth should I choose for "Select capability of action device"? Nothing in the dropdown looks appropriate.

Not exactly sure I understand your question, but . . .
Since I wanted the "take" Custom Action when motion was detected on the camera, I chose the motion event of the "Select capability . . ."
example?


FFVU (Fellow former Vera User)

1 Like

I wondering if you can point me in the correct direction. I installed the AD410 with your driver last year and all was good. Recently, I have been getting lot's of errors. Could you please review the screenshot and let me know your thoughts?

It look like to me that one of your camera is no longer online or you have an setup with an ip address where it couldn't find the camera on that ip address.

1 Like

I thought that also but I checked my regular camera app on my phone and still accessed it that way. I also checked direct access to it via a chrome browser from my Lan.

Just curious if there is any more information with getting this driver to connect to a camera over SSL with a self-signed cert? I am seeing the following in my log after adding a camera, maybe because it can't connect with the self signed cert the camera is using?

[dev:852](https://<server>/device/list#)2025-05-04 11:18:39.445 PM

debug

initialize() failed: failed to connect

[dev:852](https://<server>/device/list#)2025-05-04 11:18:39.444 PM

error

queryDeviceInfo() failed: java.net.SocketException: Connection reset

Hello all
Was enjoying the app for 2 years in simple implementation: 'Take' on the camera > image via pushover. Worked like a charm. a couple days ago stopped working. Log shows:


Other notifications (text) via pushover with the same userKey/APItocken are fine.
I re-installed and re-configured the driver and the app - result is the same.
Could someone point me in the right direction?
Thanks

I know for sure that Image Server code did not change.
It is unlikely that Pushover API has changed (?)
Is it Hubitat interface modifies request on the way out?
@tomw any help?

First of all, thanks to @tomw for this integration!

I have a camera that will no longer record to SD, so hoping to be able to store a few images on Hubitat. I do have a dashboard and automation on motion to “take” an image and display it in a dashboard. If my event history is 11, how would I display the last 11 images? My dashboard uses the provided image server link to show the last image, but I’d like at least be able to view the last 10 images captured on motion events form that one camera. Any ideas?

I am not getting any events from my amcrest cameras. I have enabled push notifications, motion detection. What am I missing? I am using amcrest sh cameras. The app did find them and created the devices. I don't care about getting images, just motion events