Home Assistant Dahua Integration questions

I have no problems with stream quality (4 Dahua cams + Dahua NVR). You can’t set anything during integration, you have to do everything in the camera’s WebGUI. The integration only fetches the stream (Main, Sub-1, Sub-2) from the camera. Not more.

my system asks for updating the Dahua Integration. I like to do that but it is showing a strange version number? Will this give any problems selecting the latest update?

This is a version from August. I’ve been running it for months without any problems.

have you found a solution for this problem? I have no problem adding camera’s, but NVR gives me the wrong username/password/url error.

Hi, no solution, same problem yet , im not able to add channel 0 . same message : wrong password, name or ip , but all that info is right . tried port 80, por 443 on https , no joy

is there a way to read the configuration for my other channels that are working fine ?

@Boostin4HP when you say enabling cross region fixed the problem. Where did you enable it? Was it on the NVR, or the home assistant integration?

I’m not Boostin4HP but: Both in the NVR and in the Dahua integration.

Can anyone post a few screen shots of how to configure this? I have IVS enabled on the 4 channels of the NVR, and defined some trip-wires for each camera in the Dahua NVR. Then in HA I have the boolean for Smart Motion Detection enabled. I’m just not seeing any alerts.

Hey is there a way to do this without installing HACS as the dahua integration is not in hassio store. can we manually configure notifications for car and people via yaml. Kind a like on hikvison you just run a code like this. Below.

  name: DriveWay
  host: !secret hikvision_ip
  port: !secret hikvision_port_driveway
  ssl: false
  username: !secret cctv_user
  password: !secret cctv_pw
  customize:
    motion:
      delay: 30
    line_crossing:
      ignored: false

Ok, surely we can use this as a way to get the data of A.I events either by downloading the SubscribeNotify.cgi file or reading it or via the URL for me, mine looks like this http://192.168.1.108/SubscribeNotify.cgi?sessionId=2ff3f81dc33459237c4ba50844e3d809

Does anyone have any good idea on how we can use this without using HACS or integration should be easy




<script>var notifyMsg = 0;function justForGabbageMessageForSafari(){var justForGabbageMessageForSafariString = 'sendSafariString';}</script><h1>subscribe Successfully!</h1><script>var uselessMsg='YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY';</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Start","Code":"CrossLineDetection","Data":{"Class":"Normal","CountInGroup":1,"DetectLine":[[1547,5638],[6116,5611],[6353,3645],[4205,3317],[2439,2662],[1820,2853],[1347,4273],[1656,5611],[1656,5611]],"Direction":"RightToLeft","EventID":10013,"GroupID":6,"LocaleTime":"2023-03-21 12:54:42","Name":"IVS-1","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[1976,416,5416,7904],"Center":[3696,4160],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":9,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949511130.0,"RuleID":2,"Track":[],"UTC":1679403282,"UTCMS":698},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Cross","Class":"Normal","CountInGroup":1,"DetectRegion":[[801,5447],[3185,1188],[7518,1625],[7681,5310],[7463,7413],[273,7549]],"Direction":"Enter","EventID":10014,"GroupID":6,"LocaleTime":"2023-03-21 12:54:42","Name":"IVS-2","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[1976,416,5416,7904],"Center":[3696,4160],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":9,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949511130.0,"RuleID":3,"Track":[],"UTC":1679403282,"UTCMS":698},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Start","Code":"CrossLineDetection","Data":{"Class":"Normal","CountInGroup":1,"DetectLine":[[1547,5638],[6116,5611],[6353,3645],[4205,3317],[2439,2662],[1820,2853],[1347,4273],[1656,5611],[1656,5611]],"Direction":"LeftToRight","EventID":10017,"GroupID":8,"LocaleTime":"2023-03-21 12:54:44","Name":"IVS-1","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[48,3304,1920,7736],"Center":[984,5520],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":9,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949513130.0,"RuleID":2,"Track":[],"UTC":1679403284,"UTCMS":698},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Stop","Code":"CrossLineDetection","Data":{"Class":"Normal","CountInGroup":1,"DetectLine":[[1547,5638],[6116,5611],[6353,3645],[4205,3317],[2439,2662],[1820,2853],[1347,4273],[1656,5611],[1656,5611]],"Direction":"RightToLeft","EventID":10013,"GroupID":6,"LocaleTime":"2023-03-21 12:54:45","Name":"IVS-1","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[1976,416,5416,7904],"Center":[3696,4160],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":9,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949511130.0,"RuleID":2,"Track":[],"UTC":1679403282,"UTCMS":698},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Stop","Code":"CrossRegionDetection","Data":{"Action":"Cross","Class":"Normal","CountInGroup":1,"DetectRegion":[[801,5447],[3185,1188],[7518,1625],[7681,5310],[7463,7413],[273,7549]],"Direction":"Enter","EventID":10014,"GroupID":6,"LocaleTime":"2023-03-21 12:54:45","Name":"IVS-2","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[1976,416,5416,7904],"Center":[3696,4160],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":9,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949511130.0,"RuleID":3,"Track":[],"UTC":1679403282,"UTCMS":698},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Stop","Code":"VideoMotion","Data":{"Id":[0],"LocaleTime":"2023-03-21 12:54:51","MachineName":"8D031DDPAG16B17","Name":"IPC","RegionName":["Region1"],"SmartMotionEnable":true,"UTC":1679374491.0},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"VideoMotion","Data":{"Id":[0],"LocaleTime":"2023-03-21 12:54:52","MachineName":"8D031DDPAG16B17","Name":"IPC","RegionName":["Region1"],"SmartMotionEnable":true,"UTC":1679374492.0},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","Class":"Normal","CountInGroup":1,"DetectRegion":[[801,5447],[3185,1188],[7518,1625],[7681,5310],[7463,7413],[273,7549]],"EventID":10019,"GroupID":8,"LocaleTime":"2023-03-21 12:54:55","Name":"IVS-2","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[2864,64,6144,8112],"Center":[4504,4088],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":13,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949524200.0,"RuleID":3,"Track":[],"UTC":1679403295,"UTCMS":775},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Start","Code":"CrossLineDetection","Data":{"Class":"Normal","CountInGroup":1,"DetectLine":[[1547,5638],[6116,5611],[6353,3645],[4205,3317],[2439,2662],[1820,2853],[1347,4273],[1656,5611],[1656,5611]],"Direction":"LeftToRight","EventID":10021,"GroupID":10,"LocaleTime":"2023-03-21 12:54:56","Name":"IVS-1","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[6072,88,8152,7880],"Center":[7112,3984],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":13,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949525270.0,"RuleID":2,"Track":[],"UTC":1679403296,"UTCMS":841},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"SmartMotionHuman","Data":{"LocaleTime":"2023-03-21 12:54:56","RegionName":["Region1"],"UTC":1679374496.0,"WindowId":[0],"object":[{"HumamID":13,"Rect":[6072,88,8160,7888]}]},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Stop","Code":"CrossRegionDetection","Data":{"Action":"Appear","Class":"Normal","CountInGroup":1,"DetectRegion":[[801,5447],[3185,1188],[7518,1625],[7681,5310],[7463,7413],[273,7549]],"EventID":10019,"GroupID":8,"LocaleTime":"2023-03-21 12:54:58","Name":"IVS-2","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[2864,64,6144,8112],"Center":[4504,4088],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":13,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949524200.0,"RuleID":3,"Track":[],"UTC":1679403295,"UTCMS":775},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Stop","Code":"CrossLineDetection","Data":{"Class":"Normal","CountInGroup":1,"DetectLine":[[1547,5638],[6116,5611],[6353,3645],[4205,3317],[2439,2662],[1820,2853],[1347,4273],[1656,5611],[1656,5611]],"Direction":"LeftToRight","EventID":10021,"GroupID":10,"LocaleTime":"2023-03-21 12:54:59","Name":"IVS-1","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[6072,88,8152,7880],"Center":[7112,3984],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":13,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949525270.0,"RuleID":2,"Track":[],"UTC":1679403296,"UTCMS":841},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Stop","Code":"SmartMotionHuman","Data":{"LocaleTime":"2023-03-21 12:55:01","RegionName":["Region1"],"UTC":1679374501.0,"WindowId":[0],"object":[{"HumamID":13,"Rect":[7112,136,8176,6560]}]},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Start","Code":"CrossLineDetection","Data":{"Class":"Normal","CountInGroup":1,"DetectLine":[[1547,5638],[6116,5611],[6353,3645],[4205,3317],[2439,2662],[1820,2853],[1347,4273],[1656,5611],[1656,5611]],"Direction":"LeftToRight","EventID":10023,"GroupID":12,"LocaleTime":"2023-03-21 12:55:01","Name":"IVS-1","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[0,2768,2096,7184],"Center":[1048,4976],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":16,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949530270.0,"RuleID":2,"Track":[],"UTC":1679403301,"UTCMS":837},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"SmartMotionHuman","Data":{"LocaleTime":"2023-03-21 12:55:02","RegionName":["Region1"],"UTC":1679374502.0,"WindowId":[0],"object":[{"HumamID":16,"Rect":[104,3792,1920,7328]}]},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","Class":"Normal","CountInGroup":1,"DetectRegion":[[801,5447],[3185,1188],[7518,1625],[7681,5310],[7463,7413],[273,7549]],"EventID":10025,"GroupID":10,"LocaleTime":"2023-03-21 12:55:02","Name":"IVS-2","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[88,3816,1848,7320],"Center":[968,5568],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":16,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949530800.0,"RuleID":3,"Track":[],"UTC":1679403302,"UTCMS":375},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Stop","Code":"CrossLineDetection","Data":{"Class":"Normal","CountInGroup":1,"DetectLine":[[1547,5638],[6116,5611],[6353,3645],[4205,3317],[2439,2662],[1820,2853],[1347,4273],[1656,5611],[1656,5611]],"Direction":"LeftToRight","EventID":10023,"GroupID":12,"LocaleTime":"2023-03-21 12:55:04","Name":"IVS-1","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[0,2768,2096,7184],"Center":[1048,4976],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":16,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949530270.0,"RuleID":2,"Track":[],"UTC":1679403301,"UTCMS":837},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":640,"method":"client.notifyEventStream","params":{"SID":517,"eventList":[{"Action":"Stop","Code":"CrossRegionDetection","Data":{"Action":"Appear","Class":"Normal","CountInGroup":1,"DetectRegion":[[801,5447],[3185,1188],[7518,1625],[7681,5310],[7463,7413],[273,7549]],"EventID":10025,"GroupID":10,"LocaleTime":"2023-03-21 12:55:04","Name":"IVS-2","Object":{"Action":"Appear","BelongID":0,"BoundingBox":[88,3816,1848,7320],"Center":[968,5568],"Confidence":0,"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"ObjectID":16,"ObjectType":"Human","RelativeID":0,"Speed":0},"PTS":42949530800.0,"RuleID":3,"Track":[],"UTC":1679403302,"UTCMS":375},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Stop","Code":"SmartMotionHuman","Data":{"LocaleTime":"2023-03-21 12:55:06","RegionName":["Region1"],"UTC":1679374506.0,"WindowId":[0],"object":[{"HumamID":16,"Rect":[104,3792,1920,7328]}]},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script></script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Stop","Code":"VideoMotion","Data":{"Id":[0],"LocaleTime":"2023-03-21 12:55:14","MachineName":"8D031DDPAG16B17","Name":"IPC","RegionName":["Region1"],"SmartMotionEnable":true,"UTC":1679374514.0},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"VideoMotion","Data":{"Id":[0],"LocaleTime":"2023-03-21 12:55:36","MachineName":"8D031DDPAG16B17","Name":"IPC","RegionName":["Region1"],"SmartMotionEnable":true,"UTC":1679374536.0},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script><script></script><script>var json={"id":636,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Stop","Code":"VideoMotion","Data":{"Id":[0],"LocaleTime":"2023-03-21 12:55:42","MachineName":"8D031DDPAG16B17","Name":"IPC","RegionName":["Region1"],"SmartMotionEnable":true,"UTC":1679374542.0},"Index":0}]},"session":"d4a911f13dfdc76faa5604c698f7dfa9"}
parent.receiveMessage(json);</script>

Also, this CGI URL should work too but for some reason not for me yet. ill post URL anyways maybe a typo or my camera does support it .

http://<IP>/cgi-bin/configManager.cgi?action=getConfig&name=Alarm[0].EventHandler
http://<IP>/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AlarmLocal
http://<IP>/cgi-bin/eventManager.cgi?action=attach&codes=AlarmLocal
http://<IP>/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion

This URL below is so close to working when connecting with the below the URL just keeps loading but when walking in front of cam it loads a black screen with a dot lol

<IP>/cgi-bin/eventManager.cgi?action=attach&codes=[CrossLineDetection,%20IntrusionDetection,%20VehicleDetection,%20HumanDetection,%20TripwireDetection]

Also this one working for line crossing
http://192.168.1.###/cgi-bin/eventManager.cgi?action=attach&codes=[CrossLineDetection]

By using this Python Code I’m hoping I will be able to send Mqtt messages directly to Hassio from the Dehua camera. at the moment i am just looking at line crossing for now to get this working. once working ill add all alarms via MQTT and python.

import requests
import paho.mqtt.client as mqtt

url = "http://192.168.1.108/cgi-bin/eventManager.cgi?action=attach&codes=[CrossLineDetection]"

# configure the MQTT client
client = mqtt.Client()
client.username_pw_set("username", "password")  # replace with your MQTT credentials
client.connect("mqtt_broker_ip", 1883)  # replace with your MQTT broker IP address

# disable SSL verification warnings
requests.packages.urllib3.disable_warnings()

# use a session to maintain the connection and cookies
session = requests.Session()

# attach to the events once
response = session.get(url, stream=True, verify=False)
print(response.content)

# periodically request the events
while True:
    response = session.get(url, stream=True, verify=False)
    for line in response.iter_lines():
        if line:
            # extract the event type and data from the response line
            event_type, event_data = line.decode().split("=", 1)
            event_data = event_data.strip()

            # check if the event is a Line Crossing Detection event
            if event_type == "CrossLineDetection":
                # publish the event as an MQTT message
                if event_data == "Start":
                    client.publish("home/line_crossing", "on")
                elif event_data == "Stop":
                    client.publish("home/line_crossing", "off")

Requesting some help, I am trying to set some dynamic custom text using the dahua.set_text_overlay service which works fine using a static string, however I want to use a sensor or template value to set the text as the value changes. My use case is to display values from my vehicle and human counters in HA.

I would like to implement an automation/button like this, but the service is not consuming the value correctly. Any suggestions on what I am doing wrong? The Jinja2 template works correctly in the developer tools.

tap_action:
  action: call-service
  service: dahua.set_custom_overlay
  target:
    entity_id:
      - camera.street_main
  data:
    group: 0
    text1: Cars {{ states('sensor.smart_motion_vehicle') }}
    text1: People {{ states('sensor.smart_motion_human') }}

Extract from documentation

Make an automation with the action being your service call

Make the triggers the state change of the entity id of the counters you’re referring to. @galaxy_explorer

Thanks for the advice but that’s not my issue :grin: the service call doesn’t seem to like my Jinja2 template

For example

Cars {{ states('sensor.smart_motion_vehicle') }}

I have 2 Amcrest cameras, both of which show up on the Dahua integration just fine. I’m hoping to trigger these to record with an event (driveway gate open) so they are already recording as someone comes down the driveway. I’ve tried a couple of things but have not been successful. Can this be done?

Also, I am also running Bluecherry DVR. Does anyone know of a way to pass a HA trigger to Bluecherry so it will turn on recording of other cameras?

And what have you already tried? Is the camera aligned towards the driveway gate? Is the driveway gate integrated into Home Assistant? Open/Close sensor? If not you must/can use a Dahua sensor like Motion or Line Detection. Something like: If Motion/Line Detection then start recording.

Automation Example:

description: "Motion Detection"
trigger:
  - type: motion
    platform: device
    device_id: your amcrest camera
    entity_id: your amcrest camera entity
    domain: binary_sensor
condition: []
action:
  - service: camera.record
    data: ...
      duration: 30
      lookback: 0
mode: single

Actually, this is very easy to implement. :slightly_smiling_face:

Another method is to use an Event Trigger which is more flexible. Subscribe/listen to the events in the Developer Tools to find which events you want to trigger on, here is an example.

trigger:
  - platform: event
    event_type: dahua_event_received
    event_data:
      name: Gate
      Code: CrossRegionDetection
      action: Start
      data:
        Name: IVS-2

It’s possible to trigger on object type (human/vehicle/face), region, IVS rule, etc.

I have everything working and tied into Ha successfully. My hope was to trick it into recording before it saw motion by an outside trigger. I tried some of the integrated Dahua commands. I’ll try your suggestion next!

I was able to get it going by turning record from automatic to on for a preset period of time. For some reason that option did not scroll down until I manually arrow down so that appears to work perfectly to pre-trigger a motion event.