dahua | Dahua Camera and Doorbell Home Assistant Integration

 by   rroller Python Version: 0.9.46 License: MIT

kandi X-RAY | dahua Summary

kandi X-RAY | dahua Summary

dahua is a Python library typically used in Internet of Things (IoT), Raspberry Pi, Xiaomi applications. dahua has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

The Dahua Home Assistant integration allows you to integrate your Dahua cameras, doorbells, NVRs, DVRs in Home Assistant. It's also confirmed to work with some Lorex cameras and Amcrest devices. 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.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              dahua has a low active ecosystem.
              It has 259 star(s) with 48 fork(s). There are 18 watchers for this library.
              There were 2 major release(s) in the last 12 months.
              There are 112 open issues and 128 have been closed. On average issues are closed in 58 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of dahua is 0.9.46

            kandi-Quality Quality

              dahua has no bugs reported.

            kandi-Security Security

              dahua has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              dahua is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              dahua releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed dahua and discovered the below as its top functions. This is intended to give you an instant insight into dahua implemented functionality, and help decide if they suit your requirements.
            • Update data
            • Start the event listener
            • Start the Vto event listener
            • Determine if the model is a doorbell
            • Called when an event is received
            • Parse event stream
            • Translate event code to SmartMotionHuman
            • Get the camera name
            • Initialize a VTO connection
            • Set custom overlay on channel
            • Log out
            • Set the text overlay on a channel
            • Return device information
            • Return whether the event is on
            • Set channel title
            • Return current light
            • Set video in day
            • Sends a keep alive signal
            • Login to the server
            • Performs an integration step
            • Start the event loop
            • Show a user
            • Set record mode
            • Set video profile mode
            • Handle data received
            • View name
            Get all kandi verified functions for this library.

            dahua Key Features

            No Key Features are available at this moment for dahua.

            dahua Examples and Code Snippets

            No Code Snippets are available at this moment for dahua.

            Community Discussions

            QUESTION

            Delphi Indy TIdHttp and multipart/x-mixed-replace with Text and jpeg image
            Asked 2021-Mar-23 at 19:38

            I´m using a Dahua Facial terminal and it has a API like (CGI style) and a SDK. i asked some questions about dll convertions, but now i´m trying to use de API too.

            The API to monitoring the events handled by Facial is

            http://192.168.1.201/cgi-bin/snapManager.cgi?action=attachFileProc&Flags[0]=Event&Events=[AccessControl]

            Is a multipart/x-mixed-replace response how return a first bondary as text/plain with the event data and a bondary with a image/jpeg with the snapshot of the event.

            Using the info online about Indy and some useful posts made by Lebeau i cad read the text data using idHttp.IoHanlder.ReadLn(IndyTextEncoding_UTF8)

            I tryed to read the next bondary (image) with idHttp.IOHandler.ReadByte, ReadBytes, ReadStream but not sucess.

            Here is the response using idHttp.IoHandler.ReadLn

            ...

            ANSWER

            Answered 2021-Mar-21 at 06:33

            What you are asking for can be done with TIdHTTP, but it takes some extra work. Details are in the following blog article on Indy's website:

            https://www.indyproject.org/2014/03/05/new-tidhttp-honoreadmultipartmime-flag/

            In a nutshell, you need to enable the hoNoReadMultipartMIME flag in the TIdHTTP.HTTPOptions property, so that TIdHTTP.Get() won't try to read the MIME data from the TIdHTTP.IOHandler after receiving the HTTP headers. That will allow you to read the MIME data yourself. You can use Indy's TIdMessageDecoderMIME class to help with that reading. There is a code example provided in the blog article.

            Source https://stackoverflow.com/questions/66728692

            QUESTION

            CPP to Delphi Convertion
            Asked 2021-Mar-18 at 18:54

            **

            SOLVED

            **

            Thanks to the Rob for bringing light to my problem.

            Create a global var on component unit fDict Implement 3 methods, one to add, one to remove and one to retrive; making the main class create , clear and destroy the global var to avoid memory leaks making the connectin function of TDispositivo to feed the fDict making the callback to retrive and move on. making the disconnect function of TDispositivo to remove the reference in fDict keeping it updated

            **

            EDIT

            **

            I found my crash error, i´m implementing the dll inside a component class and try to declare the callback procedures inside the class using

            TSnapRev = procedure(XXXXX) of object stdcall;

            ... private procedure callbacksnapshot(XXXXX); stdcall; ...

            CLIENT_SetSnapRevCallBack(callbackSnapshot,FSDKUSer);

            the callbacksnapshot was triggered but raising a accesse violation after.

            O realize the order of variables returned was always misplaced, then i change my approuch moving the callbacksnapshot procedure out of the class and changing type declaration like this:

            Type TSnapRev = procedure(XXXXX); stdcall;

            TDispositivo = class private end;

            procedure callbacksnapshot(XXXXX); stdcall;

            ... CLIENT_SetSnapRevCallBack(@callbackSnapshot,FSDKUSer); ...

            now the callback triggeing, the order of variables are right and no access violation after, BUT, i need to invoke some functions (events, etc) from my TDispositivo instance or from the owner of TDispositivo instance, in a outside procedure i can´t.

            How can i do this into my class ?

            i had tryed declare a variable FSDKSnap : TRevSap (when TRevSap is a type of object) but got the same erros or miplaced vars and access violations

            **

            ORIGINAL

            **

            Keep working on my Dahua dll convertion to Delphi. Now i'm stuck in a callback, actually in a definition of the type used.

            There is the cpp code in header

            ...

            ANSWER

            Answered 2021-Mar-17 at 18:09

            I suspect your LLoginId shoud be an Int64 .. LLONG is going to be defined in the compiler dialect / system includes for your source platform. (See: long long in C/C++)

            Your errors indicate that the parameters are holding garbage (see below) which would happen if they are out of sequence - which probably means that you have the wrong parameter sizes (hence LLoginId not reading all of the value from the stack, all variables that follow it will be corrupted).

            You can try making LLogin Int64, or if you want to invesitigate further you can try the following:

            It seems that you are successfully calling the callback routine, but that the variables you receive in the routine are incorrect. (You say that you have revLen only 10, and the access violation errors indicate that pBuf is probably pointing at garbage).

            You have declared the routine as stdcall which should be correct, and parameters will be passed on the stack in the normal "C" convention.

            If you break on the entry to the routine and look in CPU view you should see that the variables are read from the stack, and determine that each one is set correctly. You should be able to put the address of pBuf into the memory window and determine if it is pointing at JPEG data from the JPEG ssignature.

            You can also look at the memory dump of the stack to check what has been passed to you and see if you can identify where the variables you need really are.

            Source https://stackoverflow.com/questions/66677950

            QUESTION

            How to create Rewrite rule to redirect POST request from two addresses to "http://localhost/anpr/" in Microsoft IIS 10?
            Asked 2021-Mar-09 at 07:22

            I would like to redirect two POST request form Dahua ANPR camera to one script in Microsoft IIS. I would like to redirect POST request from "http://localhost/NotificationInfo/KeepAlive" and "http://localhost/NotificationInfo/TollgateInfo" to "http://localhost/anpr/". I have created rules in the main configuration file "C:\inetpub\wwwroot\web.config":

            ...

            ANSWER

            Answered 2021-Mar-09 at 07:22

            There are some problems with your url, you can try the following rule:

            Source https://stackoverflow.com/questions/66532382

            QUESTION

            c++ to delphi convert
            Asked 2021-Feb-23 at 00:17

            Now I'm trying to get the picture from my Dahua Terminal, and the code becomes a little trick.

            In C++ sample code, I have:

            ...

            ANSWER

            Answered 2021-Feb-22 at 17:00

            But in the sample code, ...pfacePhoto[i] = new char[100*1024] in my limited knowledge of C++ means the PAnsiChar receiving a Delphi array [0..(100*1024)-1] of AnsiChar.

            Since pFacePhoto[i] is a PAnsiChar, can I create a new array of AnsiChar and point to it?

            Yes, that is exactly what you need to do. You need to allocate an array of 100*1024 number of AnsiChar elements, and then point pFacePhoto[i] to the 1st element of that array.

            There are different ways you can do that, for instance by using GetMem():

            Source https://stackoverflow.com/questions/66318815

            QUESTION

            c++ pointer to struct new array to delphi to a DLL function
            Asked 2021-Feb-21 at 18:51

            Sorry about my Yoda English, i will try my best.

            I'm trying to use a Dahua SDK .dlls in my Delphi App but i can´t undertand how to do some convertions from one dll function.

            To give some context to my problem, i will try to explain what i´m trying to do.

            I need to call a find function from a dll to list all cardusers from a terminal, so the SDK provide a DLL with C++ header and a sample app to explain how to use it on Visual c++;

            My first problem is i´m using Delphi and i need to translate the header from DLL and convert the C++ codes to Delphi;

            The Find function from DLL is described bellow:

            ...

            ANSWER

            Answered 2021-Feb-19 at 19:58

            Your translation of the function's signature is missing a return type and a calling convention. It should look more like this instead:

            Source https://stackoverflow.com/questions/66282938

            QUESTION

            Dynamic initial form data
            Asked 2020-Dec-31 at 07:22

            I am attempting to add a button to the customer's page to add a new device but when rendering the form I would like to pass the customer's name as an initial value.

            This was my personal Christmas project to make my work projects a bit more centralized in 2021. Im almost over the finish line but I've hit this bump. Any help would be appreciated. Thanks.

            I have two models in separate apps.

            ...

            ANSWER

            Answered 2020-Dec-31 at 07:22

            Add or edit the url that serves the new device form

            Source https://stackoverflow.com/questions/65510712

            QUESTION

            Python to PHP conversion socket connection
            Asked 2020-Jan-16 at 14:53

            i have this script in python:

            ...

            ANSWER

            Answered 2020-Jan-16 at 14:53

            QUESTION

            How to authenticate to IP camera using OpenCV
            Asked 2019-Nov-23 at 15:46

            I'm trying to connect to an IP Camera (Dahua) using OpenCV and Python using an RTSP URI. I added a sample code below (with the username, password and ip provided in separate variables), which results in [rtsp @ 0x55cc3715c600] method OPTIONS failed: 401 Unauthorized. Using VLC, I'm able to connect, however only after entering the password in a separate dialog even though the password was already provided in the URI.

            How should I continue?

            ...

            ANSWER

            Answered 2019-Nov-23 at 15:46

            Found the problem, it had to do with the password having a special character (%), which should be percent encoded (%25).

            Source https://stackoverflow.com/questions/58999462

            QUESTION

            GetProfiles Issue When Accessing Hikvision Cameras Programmatically Via ONVIF
            Asked 2019-Mar-05 at 16:56

            PROBLEM:

            I have a number of test cameras that I'm using in development of a Cocoa ONVIF driver. I have AXIS, Dahua and Hikvision (so far -more will be coming).

            All of the cameras claim conformance to Profile S and Profile G.

            The AXIS cameras are the only ones that are behaving as expected.

            Most can return RTSP image data if I send a direct URI to them (which, I see, is how most "ONVIF" apps seem to work).

            What I am trying to do, is use the "proper channels" to access these devices.

            That means running the MANDATORY GetProfiles query, like so:

            ...

            ANSWER

            Answered 2019-Mar-05 at 16:56

            It seems that you are posting all the requests to the same URI. GetServices and GetCapabilities belong to the Device management Service, while GetProfiles belongs to the Media Service, which could have a different URI (this is something you must verify with GetServices).

            The ONVIF specs are abundant, I suggest you to start from the ONVIF Application Programming Guide. It gives you an idea about how to structure your application.

            Source https://stackoverflow.com/questions/54886892

            QUESTION

            Error while loading shared libraries: No such file or directory even after using LD_LIBRARY_PATH and changing $PATH
            Asked 2017-Dec-06 at 13:13

            I'm new to Linux environment. I'm trying to run my C++ files on Codelite and its giving me error which just won't go. I have a DLL folder of my Dahua SDK. It contains shared .so libraries. I'm getting this error since last 2 days and can't run my project!

            ./Dahuatest1: error while loading shared libraries: libdhnetsdk.so: cannot open shared object file: No such file or directory

            I already tried:

            LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tarak/Documents/General_NetSDK_Eng_Linux64_IS_V3.48.1.R.170623/NetSDK_Eng_Bin/Demo_Src/DLL

            export LD_LIBRARY_PATH

            ldconfig

            which also includes my DLL folder. But still get the same error.

            I also tried to change my path to my folder in ~/.bashrc:

            export $PATH=$PATH:/home/tarak/Documents/General_NetSDK_Eng_Linux64_IS_V3.48.1.R.170623/NetSDK_Eng_Bin/Demo_Src/DLL

            this too failed!

            What should I do to get the output??

            In codelite I've set Linker search path as my DLL folder. And compiler 'Include Path' also as my DLL folder

            Here's a screenshot of my folder: Project file

            DLL folder

            ...

            ANSWER

            Answered 2017-Dec-06 at 12:12

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install dahua

            If you want live-streaming, make sure to add the following to your config.yaml:. See ffmpeg and stream.
            To install with HACS:.
            Click on HACS in the Home Assistant menu
            Click on Integrations
            Click the EXPLORE & ADD REPOSITORIES button
            Search for Dahua
            Click the INSTALL THIS REPOSITORY IN HACS button
            Restart Home Assistant
            Configure the camera by going to Configurations -> Integrations -> ADD INTERATIONS button, search for Dahua and configure the camera.
            :warning: 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.
            NOTE: All streams will be added, even if not enabled in the camera. Just remove the ones you don't want.
            Now the integration is added to HACS and available in the normal HA integration installation, so...
            In the HA left menu, click Configuration
            Click Integrations
            Click ADD INTEGRATION
            Type Dahua and select it
            Enter the details: Username: Your camera's username Password: Your camera's password Address: Your camera's address, typically just the IP address Port: Your camera's HTTP port. Default is 80 RTSP Port: Your camera's RTSP port, default is 554. Used to live stream your camera in HA 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.

            Support

            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.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/rroller/dahua.git

          • CLI

            gh repo clone rroller/dahua

          • sshUrl

            git@github.com:rroller/dahua.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link