Dahua and Amcrest integration for cameras and doorbells

Tested with my IP4M-1041W and with User group with view only capability.
Works fine.
Takes snapshots in the device screen just fine.
I needed to reboot the Hubitat to test as far as I can tell. Wasn't doing that earlier this morning.

Works like a champ.

Now I need to update my IP5M to log as my view user and get admin passwords out of the Hubitat.

I am a real Hubitat fan and the user support and development community makes it superior.
Great device you've created.

SK!

1 Like

I was not able to get IP5M exterior camera to work with user account for live view only.
Tried a couple of times with a reboot like I did for the IP4M interior camera and it just would not take a snapshot file or connect as far as I could tell.
When the admin account was set up and the Hubitat rebooted, it takes snapshots and works as it should.
Back to using the admin account for the device.

One issue I will test later on the IP4M interior camera is that it is only powered when the Hubitat SM is in away mode. I have it on a Zigbee outlet. Don't need recordings when home and with it set for away only only, it acts as a alarm detection device.
With this setup, the device is unavailable when the Hubitat powers up.
Don't know how the device code will work in this situation.
May be a few days before I get into a situation to test this setup.

SK!

My code will attempt to reconnect repeatedly, a little bit less frequently if it fails, until up to a 10 minute delay in retrying. So, the event stream to the virtual device should recover in 10 minutes or less after you boot up the camera.

Was there anything in the Logs view in Hubitat from when this was failing?

I do not have debug on for either device.
10 minutes to discover the device after it powers up is reasonable.

In case it helps, here is the version information for IP4M outside camera.
Software VersionV2.820.00AC001.0.R, Build Date: 2022-08-31
WEB VersionV3.2.1.1254246
ONVIF Version21.12(V3.1.0.1237257)

Below is the log for the log for the IP4M outside camera at the time I was trying to connect with reboots using the the user with view only login. Hope it helps.

dev:5322023-02-01 11:41:50.378debugtake() failed: status code: 403, reason phrase: Forbidden
dev:5322023-02-01 11:40:16.261errorqueryDeviceInfo() failed: groovyx.net.http.HttpResponseException: status code: 403, reason phrase: Forbidden
dev:5322023-02-01 11:38:25.239debugtake() failed: status code: 403, reason phrase: Forbidden
dev:5322023-02-01 11:38:19.430errorqueryDeviceInfo() failed: groovyx.net.http.HttpResponseException: status code: 403, reason phrase: Forbidden
dev:5322023-02-01 11:38:02.436errorqueryDeviceInfo() failed: groovyx.net.http.HttpResponseException: status code: 403, reason phrase: Forbidden
dev:5322023-02-01 11:36:58.278errorqueryDeviceInfo() failed: groovyx.net.http.HttpResponseException: status code: 403, reason phrase: Forbidden
dev:5322023-02-01 11:36:48.961debugtake() failed: status code: 403, reason phrase: Forbidden
dev:5322023-02-01 11:36:28.790debugtake() failed: status code: 403, reason phrase: Forbidden
dev:5322023-02-01 11:36:26.087errorqueryDeviceInfo() failed: groovyx.net.http.HttpResponseException: status code: 403, reason phrase: Forbidden

All in all, this is a minor issue. And it is in the camera not your device code.

SK!

1 Like

I am sorry I been so busy with work lately and I didn't get a chance to check the forum until now.

Yes, I have use multiple account in the past but I never tried it via API also I stopped using multiple account when I had so many issue after upgrading firmwares etc.

I am one of those where Dahua would send firmware early before it get released to the public and often firmware upgrade with multiple account setup require us hard resetting hardware and then adding it back in.

So I was like screw it i am sticking with one account from now on lol ........

Sorry, I can't help you with this one but I could test it if given the steps to try.

Any thoughts on why most of my cameras would show "null" for motion events? I've got everything on one subnet, and all cameras were detected pretty much immediately. I can take snapshots with no issue, but no motion events are coming through for all but 3 cameras.

I'm using Amcrest for the cameras and NVR; most are 5 years old and it's a mix of bullet cams and dome cams. I know the motion works, since I can see motion events and recordings on the NVR, I'm just not getting anything passed through to Hubitat for most cams. I do have 3 cameras passing events, but only those 3 (one is the 1st bullet cam I put up, another a PTZ, and the last a pretty new dome). Nothing showing in Hubitat logs when motion events are triggered for any of the other cameras, but the cameras are showing up and the device information pulls successfully.

Restarted the hub, cameras, and NVR, but no dice, so I'm a little stumped.

PM me the Logs from when you trigger motion events on those cameras. Maybe the event payload is different on the older ones for some reason.

Where are you seeing the null value?

@tomw, this is so picayune I’m almost embarrassed to mention it….

If I change the label of the button child device, it reverts back to the original auto-generated label. Any way to prevent this?

Yes, I just released v0.9.3 with this behavior improved.

The name and label will be set the first time when the child device is created. But subsequent button presses should leave the names untouched.

Will you please let me know if this works as expected for you?

2 Likes

It updated no problem. Let's see if it sticks. Will let you know.

EDIT: So far, so good. The label has stuck.

2 Likes

HPM notified me of the update. When I try to install it, I get...

An error occurred while installing the package: Failed to upgrade app https://raw.githubusercontent.com/tomwpublic/hubitat_dahua/main/cameraDiscoveryApp.

Be sure the package is not in use with devices.

So I unplugged the network cable to it from my POE switch and tried again. A second camera using the device is off line.
Same result.
Do I have to remove the two devices using HPM to update it?
Just want to know if that will fix the error before I bother doing it. It is just a little extra effort to do so.

Thanks,
Steve
[hope this question isn't hijacking the thread.]

That is odd. You should not have to delete the devices or app.

Can you try a repair in HPM? I was just able to install cleanly and also repair the app.

Did you ever install the cameraDiscoveryApp manually (since it is optional in HPM)? If so, you could also try a match up in HPM.

Wow, Never noticed the Repair option in HPM before.
Yes. That is all it took. Updated it and it operates fine. Did a take and it took!
Amazed all the time how stable and clean Hubitat runs.
Thanks for the driver.
Next time I have a package issue, I know what to try first!
SK!

2 Likes

This camera is on my to buy with tax refund list 🥹🥹

:stuck_out_tongue:

Currently I have a WYZE cam running to Tiny Cam Pro on an always plugged in the Android phone. This creates a web link to the video which i can then create a tile for an action tiles and get video feed on my dashboard. I then have a Ring camera right next to said Wyze cam for motion alerts. Absolute madness but it works pretty well.

Are you telling me I can take one of my Armrest POE cameras and this app and basically take care of what I'm trying to accomplish with the two cameras? This would be amazing if I was able to get it to work. I can get POE down at the gate. Currently have a WAP serving a Shelly wifi relay to trigger the gate via dashboard. I bought a second C7 and was going to run ethernet down there and hub mesh to get some zigbee and Z-Wave coverage so I will have POE down there.

Scenario: 500'+ driveway through the woods down to a driveway gate at the road. Camera keeps an eye on the driveway gate and package box. The Ring camera is just set up for alerts for when motion comes by.



You can most likely use my integration for the motion detection. Assuming your camera supports it.

I don't do anything with the video streams in my integration, but if the Amcrest camera has a URL to connect to a stream that ActionTiles can support then you could just link to that.

@techbill, do you have any suggestions on how to do that?

Right now I am using just the motion alert to let me know if movements detected then I used an app to view and check it.

I am not sure if Action tile supports rtsp streaming but if it does then most Amcrest should be able to stream directly to dashboard.

1 Like

I don’t use Hubitat dashboard. I use Apple Homekit as my dashboard so I have not tried rtsp streaming on it yet.

I might experiment some to see if it will work but doing a search on this forum should give you an answer on this.

I also have this same exact problem. What was the fix?

@CAL.hub @tomw

Is your configuration the same as @denwood described here? Dahua and Amcrest integration for cameras and doorbells - #74 by denwood

If so, you'll have to find a way to put your cameras on the same network as Habitat, since this integration relies on being able to connect directly between Hubitat and each camera.