Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dahua access control #20

Closed
hasan-fardan opened this issue Jun 19, 2021 · 17 comments
Closed

Add dahua access control #20

hasan-fardan opened this issue Jun 19, 2021 · 17 comments

Comments

@hasan-fardan
Copy link

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.

@rroller
Copy link
Owner

rroller commented Jun 19, 2021

Hi, I'm working on this now :)

@rroller
Copy link
Owner

rroller commented Jun 19, 2021

BTW, face detection should be working now. As long as you selected the event when you setup the camera. If you did that, it'll create a sensor for the event. Can you confirm if that is working? You might need to remove the camera and add it back. Make sure to select FaceDetection

@hasan-fardan
Copy link
Author

Hello,
I can see the face detection sensor but it always says "clear" the state doesn't change even when I scan my face. I removed the integration and installed it again.

@rroller
Copy link
Owner

rroller commented Jun 20, 2021

Can you enable debug logging and send me the event that's found in the log for face detection?
You can enable debug logging like this

logger:
  default: info
  logs:
    custom_components.dahua: debug

@rodaman
Copy link

rodaman commented Jun 20, 2021

Sorry for writing report here. I am new on GitHub.
Those two cameras working very well with the addon.Thank you
DHI-VTO2211G-P
IPC-HFW4433F-ZSA

@rroller
Copy link
Owner

rroller commented Jun 20, 2021

@rodaman no problem. Thank you, I'll update the readme.

@hasan-fardan
Copy link
Author

Have a look at the logs. The good news is that I can see the DoorStatus Event. so if you can just make this event as a binary sensor it will solve my problem. Home assistant will be notified if a person scanned his face. However, there is no log about face detection but i don't care too much about it. The most important thing for me is the DoorStatus Event.

2021-06-20 20:30:33 DEBUG (Thread-78) [custom_components.dahua] Data received: {'id': 8, 'method': 'client.notifyEventStream', 'params': {'SID': 513, 'eventList': [{'Action': 'Stop', 'Code': 'VideoMotion', 'Data': {'LocaleTime': '2021-04-11 21:33:49', 'UTC': 1618148029.0}, 'Index': 0}]}, 'session': 1691002159}
2021-06-20 20:31:01 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.380 seconds
2021-06-20 20:31:02 DEBUG (Thread-78) [custom_components.dahua] Data received: {'id': 8, 'method': 'client.notifyEventStream', 'params': {'SID': 513, 'eventList': [{'Action': 'Pulse', 'Code': 'ScreenSaver', 'Data': {'LocaleTime': '2021-04-11 21:34:18', 'Status': 'Close', 'UTC': 1618148058.0}, 'Index': 0}]}, 'session': 1691002159}
2021-06-20 20:31:02 DEBUG (Thread-78) [custom_components.dahua] Data received: {'id': 8, 'method': 'client.notifyEventStream', 'params': {'SID': 513, 'eventList': [{'Action': 'Pulse', 'Code': 'ScreenSaver', 'Data': {'LocaleTime': '2021-04-11 21:34:18', 'ScreenOff': True, 'Status': 'Close', 'UTC': 1618148058.0}, 'Index': 0}]}, 'session': 1691002159}
2021-06-20 20:31:02 DEBUG (Thread-125) [custom_components.dahua] Keep alive
2021-06-20 20:31:02 DEBUG (Thread-78) [custom_components.dahua] Data received: {'id': 20, 'params': {'timeout': 55}, 'result': True, 'session': 1691002159}
2021-06-20 20:31:31 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.080 seconds
2021-06-20 20:31:31 DEBUG (Thread-78) [custom_components.dahua] Data received: {'id': 8, 'method': 'client.notifyEventStream', 'params': {'SID': 513, 'eventList': [{'Action': 'Start', 'Code': 'VideoMotion', 'Data': {'LocaleTime': '2021-04-11 21:34:47', 'UTC': 1618148087.0}, 'Index': 0}]}, 'session': 1691002159}
2021-06-20 20:31:33 DEBUG (Thread-78) [custom_components.dahua] Data received: {'id': 8, 'method': 'client.notifyEventStream', 'params': {'SID': 513, 'eventList': [{'Action': 'Pulse', 'Code': 'DoorStatus', 'Data': {'LocaleTime': '2021-04-11 21:34:49', 'Status': 'Open', 'UTC': 1618148089}, 'Index': 0}]}, 'session': 1691002159}
2021-06-20 20:31:36 DEBUG (Thread-78) [custom_components.dahua] Data received: {'id': 8, 'method': 'client.notifyEventStream', 'params': {'SID': 513, 'eventList': [{'Action': 'Pulse', 'Code': 'DoorStatus', 'Data': {'LocaleTime': '2021-04-11 21:34:52', 'Status': 'Close', 'UTC': 1618148092}, 'Index': 0}]}, 'session': 1691002159}
2021-06-20 20:31:41 DEBUG (Thread-78) [custom_components.dahua] Data received: {'id': 8, 'method': 'client.notifyEventStream', 'params': {'SID': 513, 'eventList': [{'Action': 'Stop', 'Code': 'VideoMotion', 'Data': {'LocaleTime': '2021-04-11 21:34:57', 'UTC': 1618148097.0}, 'Index': 0}]}, 'session': 1691002159}

@rroller
Copy link
Owner

rroller commented Jun 20, 2021

Thanks so much. I already see the issue and I will fix this. Pretty easy fix now that you provided me the log. Thanks! I'll post back here once it is fixed.

{
   "id":8,
   "method":"client.notifyEventStream",
   "params":{
      "SID":513,
      "eventList":[
         {
            "Action":"Pulse",
            "Code":"DoorStatus",
            "Data":{
               "LocaleTime":"2021-04-11 21:34:49",
               "Status":"Open",
               "UTC":1618148089
            },
            "Index":0
         }
      ]
   },
   "session":1691002159
}
{
   "id":8,
   "method":"client.notifyEventStream",
   "params":{
      "SID":513,
      "eventList":[
         {
            "Action":"Pulse",
            "Code":"DoorStatus",
            "Data":{
               "LocaleTime":"2021-04-11 21:34:52",
               "Status":"Close",
               "UTC":1618148092
            },
            "Index":0
         }
      ]
   },
   "session":1691002159
}

@rroller
Copy link
Owner

rroller commented Jun 20, 2021

@hasan-fardan I've released 0.8.1 that will make the binary sensor work for the door status. It should show the door as opened or closed now.

@hasan-fardan
Copy link
Author

The door status works perfectly. thank you

@rroller
Copy link
Owner

rroller commented Jun 21, 2021

Awesome! Thanks. Closing, please open an issue if you have any more troubles.

@rroller rroller closed this as completed Jun 21, 2021
@rodaman
Copy link

rodaman commented Jun 25, 2021 via email

@rroller
Copy link
Owner

rroller commented Jun 25, 2021

Ack. I can confirm the same. I will work on this immediately.

@rroller
Copy link
Owner

rroller commented Jun 25, 2021

I just released 0.8.3 to address this bug. Sorry for that! Please let me know how this goes

@rodaman
Copy link

rodaman commented Jun 25, 2021 via email

@rodaman
Copy link

rodaman commented Jun 25, 2021 via email

@rroller
Copy link
Owner

rroller commented Jun 25, 2021

Awesome. Thanks very much for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants