Dahua Camera and Doorbell Home Assistant Integration

Overview

Home Assistant Dahua Integration

The Dahua Home Assistant integration allows you to integrate your Dahua cameras and doorbells in Home Assistant. It's also confirmed to work with some Lorex cameras.

Supports motion events, alarm events (and others), enabling/disabling motion detection, switches for infrared, illuminator (white light), security lights (red/blue flashers), sirens, doorbell button press events, and more.

Also exposes several services to enable/disable motion detection or set the text overlay on the video.

NOTE: Using the switch to turn on/off the infrared light will disable the "auto" mode. Use the service to enable auto mode again (or the camera UI).

Why not use the Amcrest integration already provided by Home Assistant? The Amcrest integration is missing features that this integration provides and I want an integration that is branded as Dahua. Amcrest are rebranded Dahua cams. With this integration living outside of HA, it can be developed faster and released more often. HA has release schedules and rigerous review processes which I'm not ready for while developing this integration. Once this integration is mature I'd like to move it into HA directly.

Installation

If you want live-streaming, make sure to add the following to your config.yaml:

ffmpeg:

See ffmpeg and stream.

HACS install

To install with HACS:

  1. Click on HACS in the Home Assistant menu
  2. Click on Integrations
  3. Click the EXPLORE & ADD REPOSITORIES button
  4. Search for Dahua
  5. Click the INSTALL THIS REPOSITORY IN HACS button
  6. Restart Home Assistant
  7. Configure the camera by going to Configurations -> Integrations -> ADD INTERATIONS button, search for Dahua and configure the camera.

Manual install

To manually install:

# Download a copy of this repository
$ wget https://github.com/rroller/dahua/archive/dahua-main.zip

# Unzip the archive
$ unzip dahua-main.zip

# Move the dahua directory into your custom_components directory in your Home Assistant install
$ mv dahua-main/custom_components/dahua <home-assistant-install-directory>/config/custom_components/

⚠️ After executing one of the above installation methods, restart Home Assistant. Also clear your browser cache before proceeding to the next step, as the integration may not be visible otherwise.

Setup

  1. Now the integration is added to HACS and available in the normal HA integration installation, so...
  2. In the HA left menu, click Configuration
  3. Click Integrations
  4. Click ADD INTEGRATION
  5. Type Dahua and select it
  6. Enter the details:
    1. Username: Your camera's username
    2. Password: Your camera's password
    3. Address: Your camera's address, typically just the IP address
    4. Port: Your camera's HTTP port. Default is 80
    5. RTSP Port: Your camera's RTSP port, default is 554. Used to live stream your camera in HA
    6. RTSP Streams: The RTSP stream you want to use (Main, Sub, or Both). If both, two camera entities will be created
    7. Events: The integration will keep a connection open to the camera to capture motion events, alarm events, etc. You can select which events you want to monitor and report in HA. If no events are selected then the connection will no be created. If you want a specific event that's not listed here open an issue and I'll add it.

Dahua Setup

Known supported cameras

This integration should word with most Dahua cameras and doorbells. It has been tested with very old and very new Dahua cameras.

Doorbells will have a binary sensor that captures the doorbell pressed event.

These devices are confirmed as working:

  • IPC-T5442T-ZE
  • IPC-HDW5831R-ZE
  • IPC-HDW2831T-ZS-S2
  • IPC-HDW3849HP-AS-PV
  • IPC-HFW4433F-ZSA
  • IPC-HFW1230S
  • IPC-HFW1435S-W
  • IPC-HFW1435S-W-S2
  • IPC-HDW4233C-A
  • IPC-HDBW1230E-S2
  • IPC-HDBW5421E-Z
  • IMOU IPC-K22A / Cube PoE-322A
  • IMOU IPC-A26Z / Ranger Pro Z
  • LNB8005-C
  • LNE8964AB
  • IPC-A26
  • DHI-VTO2202F-P
  • DHI-VTO2211G-P
  • C26EP-V2
  • Please let me know if you've tested with additional cameras

Known Issues

  • IPC-D2B20-ZS doesn't work. Needs a wrapper, 7, 8

Events

Events are streamed from the device and fired on the Home Assistant event bus.

Here's example event data:

{
    "event_type": "dahua_event_received",
    "data": {
        "name": "Cam13",
        "Code": "VideoMotion",
        "action": "Start",
        "index": "0",
        "data": {
            "Id": [
                0
            ],
            "RegionName": [
                "Region1"
            ],
            "SmartMotionEnable": false
        },
        "DeviceName": "Cam13"
    },
    "origin": "LOCAL",
    "time_fired": "2021-06-30T04:00:28.605290+00:00",
    "context": {
        "id": "199542fe3f404f2a0a81031ee495bdd1",
        "parent_id": null,
        "user_id": null
    }
}

And here's how you configure and event trigger in an automation:

platform: event
event_type: dahua_event_received
event_data:
  name: Cam13
  Code: VideoMotion
  action: Start

And that's it! You can enable debug logging (See at the end of this readme) to print out events to the Home Assisant log as they fire. That can help you understand the events. Or you can HA and open Developer Tools -> Events -> and under "Listen to events" enter dahua_event_received and then click "Start Listening" and wait for events to fire (you might need to walk in front of your cam to make motion events fire, or press a button, etc)

Services and Entities

Note for ease of use, the integration tries to determine if your device supports certain services, entities and will conditionally add them. But that's sometimes a little hard so it'll just add the entity even if your devices doesn't support. I'd rather opt into extra entities than to create a complicated flow to determine what's supported and what isn't. You can simply disable the entities you don't want. An example of this is the "door open state" for doorbells. Not all doorbells support this.

Services

Service Parameters Description
camera.enable_motion_detection Enables motion detection
camera.disable_motion_detection Disabled motion detection
dahua.set_infrared_mode target: camera.cam13_main
mode: Auto, On, Off
brightness: 0 - 100 inclusive
Sets the infrared mode. Useful to set the mode back to Auto
dahua.set_video_profile_mode target: camera.cam13_main
mode: Day, Night
Sets the video profile mode to day or night
dahua.set_channel_title target: camera.cam13_main
channel: The camera channel, e.g.: 0
text1: The text 1
text2: The text 2
Sets the channel title
dahua.set_text_overlay target: camera.cam13_main
channel: The camera channel, e.g.: 0
group: The group, used to apply multiple of text as an overly, e.g.: 1
text1: The text 1
text3: The text 3
text4: The text 4
text2: The text 2
Sets the text overlay on the video
dahua.set_custom_overlay target: camera.cam13_main
channel: The camera channel, e.g.: 0
group: The group, used to apply multiple of text as an overly, e.g.: 0
text1: The text 1
text2: The text 2
Sets the custom overlay on the video
dahua.enable_channel_title target: camera.cam13_main
channel: The camera channel, e.g.: 0
enabled: True to enable, False to disable
Enables or disables the channel title overlay on the video
dahua.enable_time_overlay target: camera.cam13_main
channel: The camera channel, e.g.: 0
enabled: True to enable, False to disable
Enables or disables the time overlay on the video
dahua.enable_text_overlay target: camera.cam13_main
channel: The camera channel, e.g.: 0
group: The group, used to apply multiple of text as an overly, e.g.: 0
enabled: True to enable, False to disable
Enables or disables the text overlay on the video
dahua.enable_custom_overlay target: camera.cam13_main
channel: The camera channel, e.g.: 0
group: The group, used to apply multiple of text as an overly, e.g.: 0
enabled: True to enable, False to disable
Enables or disables the custom overlay on the video
dahua.set_record_mode target: camera.cam13_main
mode: Auto, On, Off
Sets the record mode. On is always on recording. Off is always off. Auto based on motion settings, etc.
dahua.enable_all_ivs_rules target: camera.cam13_main
channel: The camera channel, e.g.: 0
enabled: True to enable all IVS rules, False to disable all IVS rules
Enables or disables all IVS rules
dahua.enable_ivs_rule target: camera.cam13_main
channel: The camera channel, e.g.: 0
index: The rule index
enabled`: True to enable the IVS rule, False to disable the IVS rule
Enable or disable an IVS rule

Camera

This will provide a normal HA camera entity (can take snapshots, etc)

Switches

Switch Description
Motion Enables or disables motion detection on the camera
Siren If the camera has a siren, will turn on the siren. Note, it seems sirens only stay on for 10 to 15 seconds before switching off
Disarming Linkage Newer firmwares have a "disarming" feature (not sure what it is, but some people use it). This allows one to turn it on/off. This is found in the UI by going to Event -> Disarming

Lights

Light Description
Infrared Turns on/off the infrared light. Using this switch will disable the "auto" mode. If you want to enable auto mode again then use the service to enable auto. When in auto, this switch will not report the on/off state.
Illuminator If the camera has one, turns on/off the illuminator light (white light). Using this switch will disable the "auto" mode. If you want to enable auto mode again then use the service to enable auto. When in auto, this switch will not report the on/off state.
Security If the camera has one, turns on/off the security light (red/blue flashing light). This light stays on for 10 to 15 seconds before the camera auto turns it off.

Binary Sensors

Sensor Description
Motion A sensor that turns on when the camera detects motion
Button Pressed A sensor that turns on when a doorbell button is pressed
Others A binary senor is created for evey event type selected when setting up the camera (Such as cross line, and face detection)

Local development

If you wish to work on this component, the easiest way is to follow HACS Dev Container README. In short:

  • Install Docker
  • Install Visual Studio Code
  • Install the devcontainer Visual Code plugin
  • Clone this repo and open it in Visual Studio Code
  • View -> Command Palette. Type Tasks: Run Task and select it, then click Run Home Assistant on port 9123
  • Open Home Assistant at http://localhost:9123

Debugging

Add to your configuration.yaml:

logger:
  default: info
  logs:
    custom_components.dahua: debug
Comments
  • Amcrest AD410 is supported

    Amcrest AD410 is supported

    Version of the custom_component

    0.9.2

    Configuration

    n/a

    Describe the bug

    I wanted to report that the Amcrest AD410 video doorbell appears to be supported with this integration. Some brief notes in case anyone else has this:

    • Pressing the doorbell appears to fire the alarm_local binary sensor - e.g. binary_sensor.front_doorbell_alarm_local here.
    • The camera shows up in Home Assistant and works fine, including both SD/HD streams and sound.
    • I haven't figured out how to get the "human detection" working yet; binary_sensor.front_doorbell_smart_motion_human doesn't appear to fire, but I'll play with it a bit more.

    I'm happy to do any debugging/etc. if any of the maintainers want - but I figured I'd start with the fact that it works 🎉 Thanks to everyone that's contributed!

    Debug log

    n/a

    opened by andrew-d 47
  • Smart Motion events not arriving with Dahua IP cam

    Smart Motion events not arriving with Dahua IP cam

    Hi Ronnie, thanks for your work on the integration!

    I'm having some issues receiving SMD events from my Dahua cameras.

    I'm using a Dahua IPC-HDW5442TP-ZE-2712, firmware: 2.820.15OG001.0.R,build:2021-05-25. Integration version 0.9.38. HA 2022.2.9.

    Enabled entities in HA: Screenshot from 2022-02-19 16-44-21

    When I query a camera's API directly, I see smart motion events:

    $ curl -s --digest -u admin:$DAHUA_PASSWORD \
      "http://10.0.60.2/cgi-bin/configManager.cgi?action=getConfig&name=SmartMotionDetect"
    table.SmartMotionDetect[0].Enable=true
    table.SmartMotionDetect[0].ObjectTypes.Human=true
    table.SmartMotionDetect[0].ObjectTypes.Vehicle=true
    table.SmartMotionDetect[0].Sensitivity=High
    
    $ curl -s --digest -u admin:$DAHUA_PASSWORD \
      "http://10.0.60.2/cgi-bin/eventManager.cgi?action=attach&codes=[All]&heartbeat=5"
    --myboundary
    Content-Type: text/plain
    Content-Length:127
    
    Code=VideoMotion;action=Start;index=0;data={
       "Id" : [ 0 ],
       "RegionName" : [ "Region1" ],
       "SmartMotionEnable" : true
    }
    
    --myboundary
    Content-Type: text/plain
    Content-Length:41
    
    Code=VideoMotionInfo;action=State;index=0
    
    --myboundary
    Content-Type: text/plain
    Content-Length:222
    
    Code=SmartMotionVehicle;action=Start;index=0;data={
       "RegionName" : [ "Region1" ],
       "WindowId" : [ 0 ],
       "object" : [
          {
             "Rect" : [ 5384, 4096, 6352, 4904 ],
             "VehicleID" : 18028
          }
       ]
    }
    

    Using the event listener in HA, I only get generic VideoMotion events (instead of code SmartMotionVehicle, see DAHUA_HTTP_API_V2.76 page 83):

    {
        "event_type": "dahua_event_received",
        "data": {
            "name": "Front yard",
            "Code": "VideoMotion",
            "action": "Start",
            "index": "0",
            "data": {
                "Id": [
                    0
                ],
                "RegionName": [
                    "Region1"
                ],
                "SmartMotionEnable": true
            },
            "DeviceName": "Front yard"
        },
        "origin": "LOCAL",
        "time_fired": "2022-02-19T15:56:34.971665+00:00",
        "context": {
            "id": "41827b2271a562574581382fe319943c",
            "parent_id": null,
            "user_id": null
        }
    }
    

    Debug logs:

    2022-02-19 16:56:34 DEBUG (MainThread) [custom_components.dahua] Cam Data received from channel 0: {'name': 'Front yard', 'Code': 'VideoMotion', 'action': 'Start', 'index': '0', 'data': {'Id': [0], 'RegionName': ['Region1'], 'SmartMotionEnable': True}, 'DeviceName': 'Front yard'}
    2022-02-19 16:56:37 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.068 seconds (success: True)
    2022-02-19 16:57:20 DEBUG (MainThread) [custom_components.dahua] Cam Data received from channel 0: {'name': 'Front yard', 'Code': 'VideoMotion', 'action': 'Stop', 'index': '0', 'data': {'Id': [0], 'RegionName': ['Region1'], 'SmartMotionEnable': True}, 'DeviceName': 'Front yard'}
    

    So the binary_sensor.front_yard_smart_motion_human and binary_sensor.front_yard_smart_motion_vehicle sensors remain quiet, while the generic binary_sensor.front_yard_motion_alarm_2 does respond to generic motion events.

    opened by sjaakvandenberg 21
  • Last update not working. Missing Camera device.

    Last update not working. Missing Camera device.

    v0.8.1. was working perfect.

    Updated to 0.8.3. First Reboot>> Error in log: Camera not found. 2nd Reboot>> No error, but also NO camera device!

    Removed Camera, and RE-added camera. Camera device still missing.

    Back to v0.8.1. >> All working prefectly.

    Debug log

    2021-06-26 09:26:33 DEBUG (Thread-3) [custom_components.dahua] Starting DahuaEventThread
    2021-06-26 09:26:33 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 2.410 seconds
    2021-06-26 09:27:03 DEBUG (Thread-18) [custom_components.dahua] Starting DahuaEventThread
    2021-06-26 09:27:04 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 1.756 seconds
    2021-06-26 09:27:15 DEBUG (Thread-20) [custom_components.dahua] Starting DahuaEventThread
    2021-06-26 09:27:15 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 1.775 seconds
    2021-06-26 09:27:28 ERROR (MainThread) [homeassistant.components.camera] Error requesting stream: Camera not found
    2021-06-26 09:27:36 DEBUG (Thread-23) [custom_components.dahua] Starting DahuaEventThread
    

    Also text at integration: Retrying setup Screenprint Integration Screen

    opened by TheDukeSr 20
  • AD410 no longer supported?

    AD410 no longer supported?

    This may or may not be an issue with this dahua integration directly, so bear with me as I explain what's going on here.

    I've purchased an AD410 a few days ago with the hope I'd be able to integrate it with my Home Assistant, but it turns out it's now impossible. Basically, it looks like Amcrest pushed a new firmware to the AD410 (the 1.000.0000000.7.R.210220), and my device came with it pre-loaded, which fully disables the web interface. It may or may not be a mistake as the way it's "disabled" is that the file js/merge.js referenced from the HTML does not exist and returns a 404. The doorbell otherwise works perfectly from Amcrest's Android application. As a result, one can no longer authenticate directly to it, or set a password. When trying to add the doorbell to Home Assistant through this integration, and using the default "admin"/"admin" login and password, but it doesn't work:

    image

    Is this a known issue? Are there workarounds?

    Additionally, could someone dump the javascript from an older version of the firmware so I can try side loading it in the browser and set the account? Or maybe tell me which endpoint is being used to set the password initially, and potentially bypass the whole web ui and use the doorbell directly through home assistant?

    Thank you

    opened by nicolasnoble 17
  • Add dahua access control

    Add dahua access control

    This integration will add dahua access control but not all features are supported. Some events work like the motion detection but face detection won't work. Also, I am looking for DoorStatus event but i couldn't find it.

    can you make this integration support all events of the access control my model is ASI7213X.

    there is an addon called DahuaVTO2MQTT "https://github.com/elad-bar/DahuaVTO2MQTT" it has the door status event but it can only handle one device and I have multiple devices. if you can use the same method to obtain DoorStatus event that will be great.

    opened by hasan-fardan 17
  • AD410 Smart Human Detection no longer working

    AD410 Smart Human Detection no longer working

    Prior to the latest release Smart Human Detection worked. After the update to 0.9.30 this sensor seems to have been broken. The Amcrest app is still reporting Human Detected. At the same timestamp in the HA 2 errors are present in the logs.

    Version of the custom_component

    0.9.30 -->

    Add your logs here.

    This error originated from a custom integration.

    Logger: custom_components.dahua Source: custom_components/dahua/vto.py:393 Integration: Dahua (documentation, issues) First occurred: 3:48:58 PM (6 occurrences) Last logged: 3:56:43 PM

    Failed to read data: b' \x00\x00\x00DHIP\xb2\\xf1H\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10257,"EventSeq":60,"FrameSequence":8740172,"GroupID":60,"LocaleTime":"2021-12-30 15:48:58","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[1336,1608,4280,8072],"CarrierBag":0,"Center":[2808,4840],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8740172,"Gender":0,"Glass":0,"HairStyle":0,"HasHat":0,"Helmet":0,"HumanRect":[0,0,0,0],"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"MessengerBag":0,"ObjectID":422,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351293340.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879337,"UTCMS":156},"Index":0}]},"session":1223777458}\n', error: substring not found, Line: 385 Failed to read data: b' \x00\x00\x00DHIP\x900[Y\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10259,"EventSeq":62,"FrameSequence":8741658,"GroupID":62,"LocaleTime":"2021-12-30 15:53:29","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[4416,3784,4928,5800],"CarrierBag":0,"Center":[4672,4792],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8741658,"Gender":0,"Glass":0,"HairStyle":0,"HasHat":0,"Helmet":0,"HumanRect":[0,0,0,0],"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"MessengerBag":0,"ObjectID":424,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351564250.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879607,"UTCMS":276},"Index":0}]},"session":1499148432}\n', error: substring not found, Line: 385 Failed to read data: b' \x00\x00\x00DHIP\xb2\\xf1H\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10259,"EventSeq":62,"FrameSequence":8741658,"GroupID":62,"LocaleTime":"2021-12-30 15:53:29","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[4416,3784,4928,5800],"CarrierBag":0,"Center":[4672,4792],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8741658,"Gender":0,"Glass":0,"HairStyle":0,"HasHat":0,"Helmet":0,"HumanRect":[0,0,0,0],"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"MessengerBag":0,"ObjectID":424,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351564250.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879607,"UTCMS":276},"Index":0}]},"session":1223777458}\n', error: substring not found, Line: 385 Failed to read data: b' \x00\x00\x00DHIP\x900[Y\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10263,"EventSeq":66,"FrameSequence":8742602,"GroupID":66,"LocaleTime":"2021-12-30 15:56:43","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[4496,3784,5088,5784],"CarrierBag":0,"Center":[4792,4784],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8742602,"Gender":0,"Glass":0,"HairStyle":0,"HasHat":0,"Helmet":0,"HumanRect":[0,0,0,0],"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"MessengerBag":0,"ObjectID":434,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351752040.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879795,"UTCMS":461},"Index":0}]},"session":1499148432}\n', error: substring not found, Line: 385 Failed to read data: b' \x00\x00\x00DHIP\xb2\\xf1H\x08\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{\x04\x00\x00\x00\x00\x00\x00{"id":8,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"CrossRegionDetection","Data":{"Action":"Appear","CfgRuleId":1,"Class":"Normal","CountInGroup":0,"DetectRegion":[[3102,2891],[0,1644],[0,8191],[4581,8191],[5428,4061],[4744,3334]],"EventID":10263,"EventSeq":66,"FrameSequence":8742602,"GroupID":66,"LocaleTime":"2021-12-30 15:56:43","Mark":0,"Name":"IVS-1","Object":{"Action":"Appear","Age":0,"Angle":0,"Bag":0,"BagType":0,"BoundingBox":[4496,3784,5088,5784],"CarrierBag":0,"Center":[4792,4784],"Confidence":0,"DownClothes":0,"Express":0,"FaceFlag":0,"FaceRect":[0,0,0,0],"FrameSequence":8742602,"Gender":0,"Glass":0,"HairStyle":0,"HasHat":0,"Helmet":0,"HumanRect":[0,0,0,0],"LowerBodyColor":[0,0,0,0],"MainColor":[0,0,0,0],"MessengerBag":0,"ObjectID":434,"ObjectType":"Human","Phone":0,"RelativeID":0,"SerialUUID":"","ShoulderBag":0,"Source":0.0,"Speed":0,"SpeedTypeInternal":0,"Umbrella":0,"UpClothes":0,"UpperBodyColor":[0,0,0,0],"UpperPattern":0},"PTS":44351752040.0,"Priority":0,"RuleID":1,"RuleId":1,"Source":-1.0,"Track":[],"UTC":1640879795,"UTCMS":461},"Index":0}]},"session":1223777458}\n', error: substring not found, Line: 385

    and

    This error originated from a custom integration.

    Logger: custom_components.dahua Source: custom_components/dahua/vto.py:105 Integration: Dahua (documentation, issues) First occurred: 3:48:58 PM (6 occurrences) Last logged: 3:56:43 PM

    Failed to handle message, error: 'NoneType' object has no attribute 'get', Line: 97

    Describe the bug

    Smart Human Detection no longer works on the AD410 while it is still working in the Amcrest Smartphone App. At the same timestamp that a human is present the errors above are generated.

    opened by davidbrenner1 16
  • Error service camera snapshot required width and height

    Error service camera snapshot required width and height

    Version of the custom_component

    0.9.23

    Configuration

    Describe the bug

    When using service camera snapshot I get the an error.

    Debug log

    Logger: homeassistant.helpers.script.websocket_api_script Source: components/camera/init.py:751 First occurred: 12:14:15 (1 occurrences) Last logged: 12:14:15

    websocket_api script: Error executing script. Unexpected error for call_service at pos 1: async_camera_image() missing 2 required positional arguments: 'width' and 'height' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 371, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 571, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 751, in async_handle_snapshot_service image = await camera.async_camera_image() TypeError: async_camera_image() missing 2 required positional arguments: 'width' and 'height'

    Logger: homeassistant.components.websocket_api.http.connection Source: components/camera/init.py:751 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 12:14:15 (1 occurrences) Last logged: 12:14:15

    [547612669888] Error handling message: Unknown error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 25, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 525, in handle_execute_script await script_obj.async_run(msg.get("variables"), context=context) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1219, in async_run await asyncio.shield(run.async_run()) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 353, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 371, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 571, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 751, in async_handle_snapshot_service image = await camera.async_camera_image() TypeError: async_camera_image() missing 2 required positional arguments: 'width' and 'height'

    opened by maxoss 16
  • Error

    Error "object has no attribute 'async_config_entry_first_refresh'"

    Just installed the component using HACS, configured one camera and found no entities or devices were created. The following error was in the HA log:

    Logger: homeassistant.config_entries Source: custom_components/dahua/init.py:69 First occurred: 10:42:21 AM (1 occurrences) Last logged: 10:42:21 AM

    Error setting up entry DahuaRearDeckCamera for dahua Traceback (most recent call last): File "/home/homeassistant/.local/lib/python3.7/site-packages/homeassistant/config_entries.py", line 236, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/home/homeassistant/.homeassistant/custom_components/dahua/init.py", line 69, in async_setup_entry await coordinator.async_config_entry_first_refresh() AttributeError: 'DahuaDataUpdateCoordinator' object has no attribute 'async_config_entry_first_refresh'

    I am using Home Assistant version: 2021.1.4, frontend version: 20201229.1

    opened by DDDaveBell 15
  • VTO2202F remote unlocking

    VTO2202F remote unlocking

    I have a VTO2202F doorbell which have remote unlocking, can you add this as a binary sensor? The following is what I can find with the work "lock", I am not sure if this is the debug line you are looking for. If you need more debugging, let me know. Cheers

    2021-06-22 03:11:07 DEBUG (Thread-43) [custom_components.dahua] Data received: {'id': 4, 'params': {'table': [{'AccessProtocol': 'Local', 'CloseAlwaysTime': 1, 'EntranceLockChannel': 0, 'OpenAlwaysTime': 0, 'State': 'Normal', 'TimeSchedule': [{'TimeSection': '00:00-23:59'}], 'UnlockHoldInterval': 2, 'UnlockReloadInterval': 15}, {'AccessProtocol': 'Dahua', 'CloseAlwaysTime': 1, 'EntranceLockChannel': 0, 'OpenAlwaysTime': 0, 'ProtocolType': 0, 'State': 'Normal', 'TimeSchedule': [{'TimeSection': '00:00-23:59'}], 'UnlockHoldInterval': 2, 'UnlockReloadInterval': 15}, {'AccessProtocol': 'Remote', 'Address': '0.0.0.0', 'CloseAlwaysTime': 1, 'EntranceLockChannel': 0, 'OpenAlwaysTime': 0, 'Port': 10001, 'State': 'Normal', 'TimeSchedule': [{'TimeSection': '00:00-23:59'}], 'UnlockHoldInterval': 2, 'UnlockReloadInterval': 15}]}, 'result': True, 'session': 1687891641}

    opened by HappySl0th 14
  • Cross line alarm sensor does not work with IPC-Color4K-X-2.8MM

    Cross line alarm sensor does not work with IPC-Color4K-X-2.8MM

    Version of the custom_component

    NAME = "Dahua" DOMAIN = "dahua" VERSION = "0.5.0"

    Configuration

    Camera: IPC-Color4K-X-2.8MM identical to Dahua HFW5849T1-ASE-LED. Firmware: 2.840.15OG002.0.R,build:2021-09-08 HA: core-2021.12.8

    
    No log entries found
    

    Describe the bug

    I configured a tripwire rule in the IVS of the camera. The tripwire rule triggers the alerts in the web interface of the camera as expected. I added the camera to Home Assistant with the Dahua integration. The sensor "Cross line alarm sensor" was created inside Home Assistant for this camera. When I cross the tripwire, the sensor "Cross line alarm" is not triggered in Home Assistant. I checked the events in Home Assistant and I found the events related to "CrossLineDetection". Below an example for a stop event.

    It seems that the events are correctly received from the camera, but the sensor "Cross line alarm" of the camera is not updated. Any idea why?

    "event_type": "dahua_event_received",
    "data": {
        "name": "Outdoor street",
        "Code": "CrossLineDetection",
        "action": "Stop",
        "index": "0",
        "data": {
            "Class": "Normal",
            "CountInGroup": 1,
            "DetectLine": [
                [
                    6353,
                    2139
                ],
                [
                    4551,
                    1750
                ],
                [
                    2530,
                    1686
                ],
                [
                    0,
                    2236
                ]
            ],
            "Direction": "RightToLeft",
            "EventID": 10097,
            "GroupID": 52,
            "Name": "IVS-1",
            "Object": {
                "Action": "Appear",
                "BelongID": 0,
                "BoundingBox": [
                    5192,
                    1152,
                    5656,
                    2992
                ],
                "Center": [
                    5424,
                    2072
                ],
                "Confidence": 0,
                "LowerBodyColor": [
                    0,
                    0,
                    0,
                    0
                ],
                "MainColor": [
                    0,
                    0,
                    0,
                    0
                ],
                "ObjectID": 7299,
                "ObjectType": "Human",
                "RelativeID": 0,
                "Speed": 0,
                "humanTripLineDirection": 0
            },
            "PTS": 43034387550,
            "RuleID": 4,
            "Track": [],
            "UTC": 1641559601,
            "UTCMS": 503
        },
        "DeviceName": "Outdoor street"
    },
    "origin": "LOCAL",
    "time_fired": "2022-01-07T11:46:42.412439+00:00",
    "context": {
        "id": "bc088b9640c2e0de8346f2cc062b521b",
        "parent_id": null,
        "user_id": null
    }
    

    }

    Debug log

    dahua.zip

    opened by fuchsbau123 12
  • Missing binary sensor - button pressed

    Missing binary sensor - button pressed

    I have VTO 2211G-P everything works good but I dont see binary sensor which reports when butt is pressed. In configuration I have checked option "binary sensor". Do you know what is the problem?

    opened by djxela 10
  • Turning on Motion Detection generates a 401 - Unauthorized error

    Turning on Motion Detection generates a 401 - Unauthorized error

    I successfully added the integration to my Dahua DVR with 8 cameras. I see the live streaming good. When I open the "channel 1" camera device, i have e control to turn on the Motion Detection: if i switch it on i receive an error: 401, message='Unauthorized', url=URL('http://xx.xx.xx.xx:80/cgi-bin/snapshot.cgi?channel=2') I don't know how to solve this, and also it's strange it says "channel=2", as this is the channel 1 camera.

    Any help here?

    Thank you

    opened by galtamur 0
  • AD410 not reporting button doorbell button presses

    AD410 not reporting button doorbell button presses

    I am not getting any doorbell presses from my AD410. I saw there seems to be a related issues https://github.com/rroller/dahua/issues/119 which was closed a year ago.

    In my case it was working and I suspect it stopped working when I updated to 0.9.43. I tried 0.9.44 as well but no love. I unfortunately do not remember what version I was using before that was working. HA Core version is 2022.12.8.

    I am getting a video stream from the device and that seems to be working OK.

    I cannot see any errors in the logfile that look problematic. I see these which look OK to me. 2022-12-25 10:04:32.965 INFO (Thread-3) [custom_components.dahua] Get access control configuration 2022-12-25 10:04:32.978 INFO (Thread-3) [custom_components.dahua] Get version 2022-12-25 10:04:32.993 INFO (Thread-3) [custom_components.dahua] Get serial number 2022-12-25 10:04:32.994 INFO (Thread-3) [custom_components.dahua] Get device type 2022-12-25 10:04:32.994 INFO (Thread-3) [custom_components.dahua] Attach event manager 2022-12-25 10:04:33.068 INFO (Thread-3) [custom_components.dahua] Serial Number: Z17B99015E1B9 2022-12-25 10:04:33.092 INFO (Thread-3) [custom_components.dahua] Device Type: AD410 2022-12-25 10:04:33.092 INFO (Thread-3) [custom_components.dahua] Version: 1.000.0000000.7.R, Build Date: 2021-06-10

    Can anyone confirm for me that they do have AD410 door bell presses using 0.9.44 of this integration?

    opened by pbix 3
  • Unable to view cam stream

    Unable to view cam stream

    I have an Amcrest IP2M-866W camera installed, and am unable to use the Amcrest plugin for some reason, but this Dahua plugin used to work (a few HA releases ago...though I can't pinpoint when it stopped). At the moment I am able to install and configure the integration, however the camera streams are not working from either NABU Casa or local (see below), nor are the event streams, even though they all show up as available, with state info (see below). Note that I AM able to load the RTSP stream from VLC

    That said, I'm running the Dahua ext version 0.9.44 (https://github.com/rroller/dahua) as well as:

    • Home Assistant 2022.12.8
    • Supervisor 2022.11.2
    • Operating System 9.4
    • Frontend 20221213.1
    • FFMPEG: in configuration.yaml

    Would appreciate any insights. I have created a pastebin of the DEBUG logs here: https://pastebin.com/ibBuMtHH

    image

    opened by schergr 1
  • Error while adding DVR DH-XVR5116HE-4KL-I2

    Error while adding DVR DH-XVR5116HE-4KL-I2

    Is your feature request related to a problem? Please describe. I can't configure the integration to use the DVR DH-XVR5116HE-4KL-I2. I keep receiving the error Username, Password or Address is wrong Tried with the local IP address and HTTP and HTTPS ports.

    Describe the solution you'd like Be able to use the DH-XVR5116HE-4KL-I2 with this integration.

    Describe alternatives you've considered n/a

    Additional context

    • Home Assistant Core version: 2022.12.6
    • Dahua integration version: 0.9.44 (installed using HACS)

    DVR:

    • Model: DH-XVR5116HE-4KL-I2
    • Hardware version: V1.0
    • Web version: V3.2.7.145020
    • Onvif server version: 16.12(V1.2.3.728802)
    • ONVIF version: V2.4.1
    • System version: V4.001.0000004.1, Fecha compilac.: 2021-10-20
    • Safe Baseline version: V2.1
    opened by cdeharo 0
  • Imou cruiser

    Imou cruiser

    Hi, i connected my three cruiser 4mp with my imou nvr and also scan nvr to my ios app but when i try to use micro phone of cameras i always faced an error that enable to use microphone so is there any setting in nvr to enable to use microphone orr anthing else. Kindly help me out and one question that how to use repater funtion in imou nvr to repeat signal to one camera to another

    opened by Hasham997 0
  • binary sensor missing

    binary sensor missing

    I got the same issues after reading here. i had to re-add the Amcrest ad410 doorbell, and since then its seen as a generic rtsp camera. i lost the call no answered function, and i cant open the stream as it says HTTP_UNAUTHORIZED, Server returned 401 Unauthorized (authorization failed))

    opened by Ryukenden88 0
Releases(0.9.44)
Owner
Ronnie
Ronnie
Jupyter notebooks for using & learning Keras

deep-learning-with-keras-notebooks 這個github的repository主要是個人在學習Keras的一些記錄及練習。希望在學習過程中發現到一些好的資訊與範例也可以對想要學習使用 Keras來解決問題的同好,或是對深度學習有興趣的在學學生可以有一些方便理解與上手範例

ErhWen Kuo 2.1k Dec 27, 2022
This MVP data web app uses the Streamlit framework and Facebook's Prophet forecasting package to generate a dynamic forecast from your own data.

📈 Automated Time Series Forecasting Background: This MVP data web app uses the Streamlit framework and Facebook's Prophet forecasting package to gene

Zach Renwick 42 Jan 04, 2023
Deploy a ML inference service on a budget in less than 10 lines of code.

BudgetML is perfect for practitioners who would like to quickly deploy their models to an endpoint, but not waste a lot of time, money, and effort trying to figure out how to do this end-to-end.

1.3k Dec 25, 2022
Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.

Pattern Pattern is a web mining module for Python. It has tools for: Data Mining: web services (Google, Twitter, Wikipedia), web crawler, HTML DOM par

Computational Linguistics Research Group 8.4k Jan 03, 2023
[ACL-IJCNLP 2021] "EarlyBERT: Efficient BERT Training via Early-bird Lottery Tickets"

EarlyBERT This is the official implementation for the paper in ACL-IJCNLP 2021 "EarlyBERT: Efficient BERT Training via Early-bird Lottery Tickets" by

VITA 13 May 11, 2022
Examples of how to create colorful, annotated equations in Latex using Tikz.

The file "eqn_annotate.tex" is the main latex file. This repository provides four examples of annotated equations: [example_prob.tex] A simple one ins

SyNeRCyS Research Lab 3.2k Jan 05, 2023
SNIPS: Solving Noisy Inverse Problems Stochastically

SNIPS: Solving Noisy Inverse Problems Stochastically This repo contains the official implementation for the paper SNIPS: Solving Noisy Inverse Problem

Bahjat Kawar 35 Nov 09, 2022
Plug-n-Play Reinforcement Learning in Python with OpenAI Gym and JAX

coax is built on top of JAX, but it doesn't have an explicit dependence on the jax python package. The reason is that your version of jaxlib will depend on your CUDA version.

128 Dec 27, 2022
Image-generation-baseline - MUGE Text To Image Generation Baseline

MUGE Text To Image Generation Baseline Requirements and Installation More detail

23 Oct 17, 2022
The official repository for "Score Transformer: Generating Musical Scores from Note-level Representation" (MMAsia '21)

Score Transformer This is the official repository for "Score Transformer": Score Transformer: Generating Musical Scores from Note-level Representation

22 Dec 22, 2022
OCR-D wrapper for detectron2 based segmentation models

ocrd_detectron2 OCR-D wrapper for detectron2 based segmentation models Introduction Installation Usage OCR-D processor interface ocrd-detectron2-segm

Robert Sachunsky 13 Dec 06, 2022
Imitating Deep Learning Dynamics via Locally Elastic Stochastic Differential Equations

Imitating Deep Learning Dynamics via Locally Elastic Stochastic Differential Equations This repo contains official code for the NeurIPS 2021 paper Imi

Jiayao Zhang 2 Oct 18, 2021
Official Codes for Graph Modularity:Towards Understanding the Cross-Layer Transition of Feature Representations in Deep Neural Networks.

Dynamic-Graphs-Construction Official Codes for Graph Modularity:Towards Understanding the Cross-Layer Transition of Feature Representations in Deep Ne

11 Dec 14, 2022
Deep Q-learning for playing chrome dino game

[PYTORCH] Deep Q-learning for playing Chrome Dino

Viet Nguyen 68 Dec 05, 2022
Official implementation of Long-Short Transformer in PyTorch.

Long-Short Transformer (Transformer-LS) This repository hosts the code and models for the paper: Long-Short Transformer: Efficient Transformers for La

NVIDIA Corporation 198 Dec 29, 2022
Official implementation for “Unsupervised Low-Light Image Enhancement via Histogram Equalization Prior”

Unsupervised Low-Light Image Enhancement via Histogram Equalization Prior. The code will release soon. Implementation Python3 PyTorch=1.0 NVIDIA GPU+

FengZhang 34 Dec 04, 2022
Pytorch implementation for Semantic Segmentation/Scene Parsing on MIT ADE20K dataset

Semantic Segmentation on MIT ADE20K dataset in PyTorch This is a PyTorch implementation of semantic segmentation models on MIT ADE20K scene parsing da

MIT CSAIL Computer Vision 4.5k Jan 08, 2023
This repo is customed for VisDrone.

Object Detection for VisDrone(无人机航拍图像目标检测) My environment 1、Windows10 (Linux available) 2、tensorflow = 1.12.0 3、python3.6 (anaconda) 4、cv2 5、ensemble

53 Jul 17, 2022
Replication package for the manuscript "Using Personality Detection Tools for Software Engineering Research: How Far Can We Go?" submitted to TOSEM

tosem2021-personality-rep-package Replication package for the manuscript "Using Personality Detection Tools for Software Engineering Research: How Far

Collaborative Development Group 1 Dec 13, 2021
The official implementation of You Only Compress Once: Towards Effective and Elastic BERT Compression via Exploit-Explore Stochastic Nature Gradient.

You Only Compress Once: Towards Effective and Elastic BERT Compression via Exploit-Explore Stochastic Nature Gradient (paper) @misc{zhang2021compress,

46 Dec 07, 2022