Hey
I tried to add multi cameras and it didnt work .This is my config.
thanks in advance
https://paste.ubuntu.com/p/hzCDSJBVvR/
Is your username and password the same?
Your password !secret is pointing to your !secret username entry!
Hey
Yes iam using same usename and password for all the cameras.
@johnnyletrois i tried your script but couldnât get it to work (i ran out of time so didnât spend hours on it). Main question is, where do you leave the script? Do you have it running âstand aloneâ or have it inside the âpython_scriptsâ folder inside hassio?
Do you have an âguideâ on how to use this script?
I would like to use this script instead of the FTP upload / folder watcher combination i used before. In that situation i let the Dahua Camera upload an snapshot when motion was triggered and used the âfolder_watcherâ component to discover newly uploaded images and trigger automations. It works but i rather use an MQTT solution like you did.
I run it in a standalone python docker container. Sorry, but I donât have a guide other than configure the script, run it, and enjoy the MQTT binary sensor goodness.
Running HA v0.91.3 in a pyvenv. Was able to copy your code into the custom_component directory structure and get it to run. Looking at the hass.log, I see that the component seems to be setup AND that it is detecting motion events on the one camera I currently have integrated:
2019-04-12 12:05:59 WARNING (MainThread) [homeassistant.loader] You are using a custom component for dahua_event which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-04-12 12:06:00 INFO (MainThread) [homeassistant.setup] Setting up dahua_event
2019-04-12 12:06:00 DEBUG (SyncWorker_8) [custom_components.dahua_event] Added Dahua device at: http://192.168.xxx.xxx:80/cgi-bin/eventManager.cgi?action=attach&channel=1&codes=%5BVideoMotion,CrossLineDetection,AlarmLocal,VideoLoss,VideoBlind%5D
2019-04-12 12:06:02 INFO (MainThread) [homeassistant.setup] Setup of domain dahua_event took 2.3 seconds.
2019-04-12 12:06:04 DEBUG (Thread-3) [custom_components.dahua_event] [frontdoor]: HTTP/1.1 200 OK
2019-04-12 12:06:04 DEBUG (Thread-3) [custom_components.dahua_event] [frontdoor] OnConnect()
2019-04-12 12:07:04 DEBUG (Thread-3) [custom_components.dahua_event] [frontdoor]: -- myboundary
2019-04-12 12:07:04 DEBUG (Thread-3) [custom_components.dahua_event] [frontdoor] OnDisconnect(Failed writing body (0 != 101) (23))
2019-04-12 12:07:09 DEBUG (Thread-3) [custom_components.dahua_event] [frontdoor] OnDisconnect(Success)
However, I cannot find any associated component or event actually occurring in HA. Were you able to have a component created? How do I get these events other than from the hass.log?
Hey
How did you put the file in the structure for 0.91.3?
i tried
/home/homeassistant/.homeassistant/custom_components/dahua_event/dahua_event.py
and also
/home/homeassistant/.homeassistant/custom_components/dahua_event/event.py
i also put a empty file called init.py
Package dahua_event setup failed. Component dahua_event cannot be merged. Expected a dict.
in the custom_components folder, create folder called dahua_event. In the folder, copy the file from git hub, but rename it to init.py (notice double underscore).
I ended up using this https://github.com/psyciknz/CameraEvents (it uses that same code)
But am still having a little trouble getting it to start on boot⌠but it works. I started trying to make it a component but itâs gonna take me awhileâŚ
Tips you can get settings also http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyseRule
What are the prerequisites of using this?
Iâm a n00b using Python Using Hass.io on a rPI3b.
Tried some stuff, not working including AppDeamon.
Iâm using a Dahua NVR with 5 channels. Already configures intrusion detection.
The API is returning the camera ID, so itâs working. But now I want to do a âonâ / âoffâ just like some other binary sensors for doors/windows in HA.
Iâm not using MQTT, donât really think itâs having advantages in stead of what Iâm using right now.
Love to figure somethings out but this is exhaustively haha
Edit: also in Dahua IPC to MQTT App
I added a forked repo that is updated and it support home assistant 0.92 https://github.com/JLFN/home-assistant-dahua-event @SaWey are you running newest version of home assistant?
Iâve just tried to add your forked repo as a custom_componet. Iâm running HA v0.92 in a pyvenv and did install pycurl v7.43.0.2 inside my venv.
When I run HA, I donât see any errors in my logs and do see the following message:
2019-05-01 13:57:14 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for dahua_event which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
This seems to indicate it has been successfully loaded.
However, Iâve now add the following to my configuration.yaml:
dahua_event:
- name: driveway
protocol: http
host: 192.168.200.200 #IP of my camera, not my real IP
port: 80
user: !secret dahua_username
password: !secret dahua_password
events: VideoMotion,CrossLineDetection,CrossRegionDetection
I donât see any component being added to HA, there is not dahua_event to be found. Iâm assuming I should see a component like âdahua_event.drivewayâ.
I recommend you using MQTT version instead i got it working on docker fast and easy.
im trying the custom component from sawey but i constantly get this error:
'Component error: dahua_event - Integration 'dahua_event' not found.'
What im i doing wrong?
custom component/
create file:
1/ int.py,
2/ dahua_event.py