dahua | Dahua Camera and Doorbell Home Assistant Integration
kandi X-RAY | dahua Summary
kandi X-RAY | dahua Summary
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
Top functions reviewed by kandi - BETA
- 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
dahua Key Features
dahua Examples and Code Snippets
Community Discussions
Trending Discussions on dahua
QUESTION
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
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:33What 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.
QUESTION
**
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:09I 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.
QUESTION
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:22There are some problems with your url, you can try the following rule:
QUESTION
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:00But in the sample code,
...pfacePhoto[i] = new char[100*1024]
in my limited knowledge of C++ means thePAnsiChar
receiving a Delphi array[0..(100*1024)-1] of AnsiChar
.Since
pFacePhoto[i]
is aPAnsiChar
, 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()
:
QUESTION
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:58Your translation of the function's signature is missing a return type and a calling convention. It should look more like this instead:
QUESTION
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:22Add or edit the url that serves the new device form
QUESTION
i have this script in python:
...ANSWER
Answered 2020-Jan-16 at 14:53Instead of
QUESTION
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:46Found the problem, it had to do with the password having a special character (%), which should be percent encoded (%25).
QUESTION
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:56It 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.
QUESTION
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
...ANSWER
Answered 2017-Dec-06 at 12:12Try
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dahua
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
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page