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
Nest Protect integration for Home Assistant. This will allow you to integrate your smoke, heat, co and occupancy status real-time in HA.

Nest Protect integration for Home Assistant Custom component for Home Assistant to interact with Nest Protect devices via an undocumented and unoffici

Mick Vleeshouwer 175 Dec 29, 2022
A facial recognition doorbell system using a Raspberry Pi

Facial Recognition Doorbell This project expands on the person-detecting doorbell system to allow it to identify faces, and announce names accordingly

rydercalmdown 22 Apr 15, 2022
Camera-caps - Examine the camera capabilities for V4l2 cameras

camera-caps This is a graphical user interface over the v4l2-ctl command line to

Jetsonhacks 25 Dec 26, 2022
Irrigation controller for Home Assistant

Irrigation Unlimited This integration is for irrigation systems large and small. It can offer some complex arrangements without large and messy script

Robert Cook 176 Jan 2, 2023
My personal Home Assistant configuration.

About This is my personal Home Assistant configuration. My guiding princile is to have full local control of all my devices. I intend everything to ru

Chris Turra 13 Jun 7, 2022
🗣️ Microsoft Edge TTS for Home Assistant, no need for app_key

Microsoft Edge TTS for Home Assistant This component is based on the TTS service of Microsoft Edge browser, no need to apply for app_key. Install Down

null 152 Dec 31, 2022
A Home Assistant custom component for Lobe. Lobe is an AI tool that can classify images.

Lobe This is a Home Assistant custom component for Lobe. Lobe is an AI tool that can classify images. This component lets you easily use an exported m

Kendell R 4 Feb 28, 2022
A voice recognition assistant similar to amazon alexa, siri and google assistant.

kenyan-Siri Build an Artificial Assistant Full tutorial (video) To watch the tutorial, click on the image below Installation For windows users (run th

Alison Parker 3 Aug 19, 2022
A project to build an AI voice assistant using Python . The Voice assistant interacts with the humans to perform basic tasks.

AI_Personal_Voice_Assistant_Using_Python A project to build an AI voice assistant using Python . The Voice assistant interacts with the humans to perf

Chumui Tripura 1 Oct 30, 2021
Voice assistant - Voice assistant with python

?? Python Voice Assistant ?? - User's greeting ?? - Writing tasks to todo-list ?

PythonToday 10 Dec 26, 2022
September-Assistant - Open-source Windows Voice Assistant

September - Windows Assistant September is an open-source Windows personal assis

The Nithin Balaji 9 Nov 22, 2022
A Planar RGB-D SLAM which utilizes Manhattan World structure to provide optimal camera pose trajectory while also providing a sparse reconstruction containing points, lines and planes, and a dense surfel-based reconstruction.

ManhattanSLAM Authors: Raza Yunus, Yanyan Li and Federico Tombari ManhattanSLAM is a real-time SLAM library for RGB-D cameras that computes the camera

null 117 Dec 28, 2022
Tools to create pixel-wise object masks, bounding box labels (2D and 3D) and 3D object model (PLY triangle mesh) for object sequences filmed with an RGB-D camera.

Tools to create pixel-wise object masks, bounding box labels (2D and 3D) and 3D object model (PLY triangle mesh) for object sequences filmed with an RGB-D camera. This project prepares training and testing data for various deep learning projects such as 6D object pose estimation projects singleshotpose, as well as object detection and instance segmentation projects.

null 305 Dec 16, 2022
Home repository for the Regularized Greedy Forest (RGF) library. It includes original implementation from the paper and multithreaded one written in C++, along with various language-specific wrappers.

Regularized Greedy Forest Regularized Greedy Forest (RGF) is a tree ensemble machine learning method described in this paper. RGF can deliver better r

RGF-team 364 Dec 28, 2022
Neural Reprojection Error: Merging Feature Learning and Camera Pose Estimation

Neural Reprojection Error: Merging Feature Learning and Camera Pose Estimation This is the official repository for our paper Neural Reprojection Error

Hugo Germain 78 Dec 1, 2022
This is the official code release for the paper Shape and Material Capture at Home

This is the official code release for the paper Shape and Material Capture at Home. The code enables you to reconstruct a 3D mesh and Cook-Torrance BRDF from one or more images captured with a flashlight or camera with flash.

null 89 Dec 10, 2022
This is the official implementation of 3D-CVF: Generating Joint Camera and LiDAR Features Using Cross-View Spatial Feature Fusion for 3D Object Detection, built on SECOND.

3D-CVF This is the official implementation of 3D-CVF: Generating Joint Camera and LiDAR Features Using Cross-View Spatial Feature Fusion for 3D Object

YecheolKim 97 Dec 20, 2022
Narya API allows you track soccer player from camera inputs, and evaluate them with an Expected Discounted Goal (EDG) Agent

Narya The Narya API allows you track soccer player from camera inputs, and evaluate them with an Expected Discounted Goal (EDG) Agent. This repository

Paul Garnier 121 Dec 30, 2022