Code Monkey home page Code Monkey logo

dahuavto's People

Contributors

myhomeiot avatar thecode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dahuavto's Issues

doorbell

Hello, help the hass newbie, pls.
I connected dahua vto 2111 to the network (dmss works ok), integrated it into the hass, in sensors dahua vto ok . if I copy the automation completely, different notifications appear every second. So I left only this https://i.postimg.cc/XYJMtZRr/2022-02-13-18-23-47.png
what I want to get - when I press the button on the panel, I want to turn on the doorbell relay for 0,5 sec (or any virtual entity that appears in homekit from hass)

2 wire ip VTH2622

Hi there. Can i open the door from Home Assistant if i have only access to the appartment VTH2622 station and not to the outdoor station? VTH is connected to my wifi network to give access to DMSS.

Error on unlock... lock/unlock entity not found

Hi, i have an issue using component with VTO3211 and VTH5221...
this my configuration:

sensor:
  - platform: dahua_vto
    name: CG-Ring
    host: vto_ip
    timeout: 10
    port: 5000
    username: vto_uname
    password: vto_pwd
    scan_interval: 5
#
######################################
#
  - platform: dahua_vto
    name: CG-Phone
    host: vth_ip
    timeout: 10
    port: 5000
    username: vth_uname
    password: vth_pwd
    scan_interval: 5
#
######################################
#
timer:
  door_lock:
    name: Door Lock
    icon: mdi:timer
#
######################################
#
lock:
  - platform: template
    name: CG-Opener
    value_template: "{{ not is_state('timer.door_lock', 'active') }}"
    lock: []
    unlock:
      - service: dahua_vto.open_door
        data_template:
          entity_id: sensor.dahua_vto
          channel: 1
          short_number: HA
#
######################################
#
logger:
  logs:
    custom_components.dahua_vto: debug
#
######################################
#

when i click on unlock button i receive this error:

Failed to call service lock/unlock. entity not found

and on the log:

2021-04-21 12:51:10 ERROR (MainThread) [homeassistant.helpers.script.cg_opener] CG-Opener: Error executing script. Error for call_service at pos 1: entity not found
2021-04-21 12:51:10 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140658126678432] entity not found
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 143, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 649, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/template/lock.py", line 146, in async_unlock
await self._command_unlock.async_run(context=self._context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1200, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 341, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 359, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 559, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 719, in admin_handler
await result
File "/config/custom_components/dahua_vto/init.py", line 59, in service_open_door
raise HomeAssistantError("entity not found")
homeassistant.exceptions.HomeAssistantError: entity not found

thanks for the help

Nothing happened after installation and confirmation

I installed from HACS, I checked that custom_component/daue_vto is there, I included this piece in m y configuration.yaml, but no sensor is created....

sensor:
  - platform: dahua_vto
    name: Puerta Principal
    host: 192.168.1.47
    username: admin
    password: xxxxxxx
    scan_interval: 5

Any help?

The drive is a VTO2211G-WP, wifi connected just installed and working properly as standalone (out of HomeAssistant)

My fault, now is in, don't know what happened..... now I can see:

image

Automation with video door entry call.

Good afternoon. I have configured the integration in HA but I am a bit lost in programming.
I would like to know if an automation could be configured so that when calling the video intercom, it turns on a light for 1 minute.

Any sample code, if anyone has done it?

Thanks

VTO2202 - Video Intercom Button Pressed no longer working

Hi

In the last few days i have noticed that when the intercom button on my VTO2202 is pressed I no longer see the entitiy change in Home Assistant. I have firmware version 2022-05-23 V4.511.0000000.0.R and in my logs i get the following:

Warning:
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:190
First occurred: 17:24:19 (4 occurrences)
Last logged: 17:24:49

Detected that custom integration 'dahua' calls async_write_ha_state from a thread at custom_components/dahua/init.py, line 365: listener(), please report it to the author of the 'dahua' custom integration
Detected that custom integration 'dahua' calls async_write_ha_state from a thread at custom_components/dahua/init.py, line 382: listener(), please report it to the author of the 'dahua' custom integration

Quickly followed by:

Error:
Logger: custom_components.dahua
Source: custom_components/dahua/vto.py:119
integration: Dahua (documentation, issues)
First occurred: 17:24:19 (4 occurrences)
Last logged: 17:24:49

Failed to handle event, error: Detected that custom integration 'dahua' calls async_write_ha_state from a thread at custom_components/dahua/init.py, line 365: listener(). Please report it to the author of the 'dahua' custom integration., Line: 114
Failed to handle event, error: Detected that custom integration 'dahua' calls async_write_ha_state from a thread at custom_components/dahua/init.py, line 382: listener(). Please report it to the author of the 'dahua' custom integration., Line: 114

Is anyone else experiencing similar issues? Any help would be much appreciated.

Thanks,

help to use this code with VTO1220A and VTO6210

Hello,
Could you please help me ? How to use this code to communicate with "VTO1220A and VTO6210"?
I will use them with raspberry pi and flutter (android) application.
for VTO6210 I need to receive a door bill ring, answer it, talk a video call
for VTO1220 I need to receive a call by room number, answer it, talk a video call
Thanks

it´s posible to get the card number?

Hi.

I also use my VTO as access control, so i was wondering if there is a way to get the card id/number of the cards that we use to open the door

Great project!

Bell-pressed, then play a custom sound on another machine.

Hi, i was wondering if this is possible,
So i bought vt2202fp-S2, but i didn't buy their VTH since i already got a LAN-connected viewing station using intel NUC + AOC 16 inch usb monitor. It runs windows now but i could change it to linux since i only need it to run VLC streams (which is available on both windows and linux).
Now I'm trying to figure out how to play a custom sound on that viewing station (connected to a speaker) whenever a doorbell is pressed.
I'm completely new at HA so please bear with me,
I installed HA on my main 24/7 working machine (not the viewing station) using VMware player.
And i Just finished installing your integrations, but i'm a bit lost at event trigger and playing sound on that NUC afterwards. thanks

Camera Feed Automation

Hi,

I've read the documentation and examples on this repo, but I still don't understand how to access the VTO status (BackKeyLight States). I have this sensor called sensor.dahua_vto, but its status is just OK, and it never changes. I need the VTO status because I'm replacing one of my Dahua VTHs with a tablet running Home Assistant. I'd like this to automatically switch to the VTO's camera feed when someone rings (just like it does on the VTH). If there'd be some way to make a sensor similar to sensor.dahua_vto whose status corresponds to the BackKeyLight States, I could use that to trigger my automation.

Thanks

time out when call the "dahua_vto.open_door" service

I have successfully connected to my DAHUA VTO using the plugin, with the model being DH-VTO9531D. After adding the sensor according to the instructions page, the sensor works fine, and the status is displayed as "OK." However, every time I call the "dahua_vto.open_door" service to open the door, I often encounter issues. Specifically, the sensor status changes to "Unavailable," recovers after a few seconds, and prompts a service call timeout. This problem occurs very frequently, significantly affecting normal usage. Could you please take some time to help troubleshoot the issue? Thank you.
QQ截图20231201202835
home-assistant.log

Question: MUTE ring

Hello, this is not actually issue, but after hours still didn't found answer,
have someone managed to call command to disable/mute ringtone ?

My idea is to MUTE it during night, but without success
Tried AudioOutputVolume but that is different option

VTH

Hi,
I'm using the Dahua 2421 VTH and want to integrate it into HA. The only thing is my Home Assistant does not recognize a dahua_vth integration.

I can't find anything about using VTHs in your documentation, even though they are listed as supported.

emulate doorbell button press

Hello
I am finishing integration with custom device to read barcode and open gate if code is available in database.
I want to virtualy press ring button if barcode is not available in database.
Can you show some example?

Upgrading to newer version, will it break HA compatibility?

So my Dahua VTO2202F-P-S2 suddenly stops working with the dmss apps, can't accept video call anymore.
And i was advised by the seller to update app version and firmware version.
What worries me is that they might lock HA compatibility as i have seen companies doing this to maintain exclusivity.
Has anyone upgraded to V4.511.0000000.0.R.220105?
Mine is currently 4.5 but i can use this integration, the only thing missing is the video call from dmss app, which seems to be difficult to emulate even with pbx...
Or is there any way downgrade it once it's updated?

Missing feature list

Sorry to bother but I'am currently looking into video doorbells and Dahua seems to be a very attractive candidate.
I'am missing a feature list, what the integration can do with the doorbell. As far as I understood it's the following:
What it can do in HA:

  • show when somebody rang the bell
  • if calls got answered
  • lock/unlock (this seems a bit useless if you're using HA)

What it can't do:

  • show video from the bell in HA
  • Answering SIP ring calls

Is my understanding correct? Can I setup another RTSP component in HA to get the video? And a SIP server and client for the calls?

2 way audio

Does this support 2-way audio on Home assistant? Or does it still have to be done through a different app?

Playing audio on another machine failed after last update

id: '1640312308566'
alias: Dahua VTO
description: ''
trigger:
  - platform: event
    event_type: dahua_vto
condition:
  - condition: template
    value_template: '{{ trigger.event.data.Data.State | int in [1, 2] }}'
action:
  - service: media_player.media_play
    target:
      entity_id: media_player.gmpc
mode: queued
max: 10

So i have GMPC server and GMPC player installed on my viewing station NUC machine,
The HA is installed on my main server, not the viewing station. The GMPC server's job is to talk to HA in LAN.

On older HA version the above code would trigger doorbell.mp3 on the GMPC player.
But now it wont play at all. I'm getting this error :

Error: In 'template' condition: UndefinedError: 'dict object' has no attribute 'State'

When trying to execute this part :

condition: template
value_template: '{{ trigger.event.data.Data.State | int in [1, 2] }}'

Any ideas?
Hmm maybe next time i'll think twice before updating HA :(

Adding more VTOs

Sorry im not familiar with YAML at all. How do I add an additional VTO?

Possible to make "unlock" command to android desktop?

Would it be possible to make command to unlock the garage by a single press on android home page?
The dahua vto app needs 3 clicks,

  1. Open vto app
  2. Unlock
  3. Confirm unlock

Too much button press compared to IR remote, kinda risky doing it while driving.

Compatibility with VTO2101E-P

Hi, Im trying to hookup VTO2101E-P thru your integration. However it doesn't seem to work with it. The sensor Dahua VTO displays unknown status. Is there any chance to make this integration happen?
Here is what I found in logs:
2022-01-02 15:54:50 ERROR (MainThread) [custom_components.dahua_vto.sensor] Dahua VTO: [Errno 113] Connect call failed ('192.168.1.110', 5000), retry in 10 seconds

VTO2000 Event Unlock for Card and Fingerprint

Hi,

I own a Dahua VTO2000 and your Integration works basicly.

I have not connected my Door-Opener directly to the VTO2000.
The Door-Opener is a binary switch in HA and works with an relay.

Because of that I need an Event "Access granted" everytime a valid Fingerprint or valid ID-Card is recognized from the Dahua VTO.

First Step -> Simple Event when access is granted

Second Step -> Complex Event when access is granted including which ID triggered the access (example: my fingerprint -> ID 1 unlocked the door --- fingerprint of child -> ID 2 unlocked the door) if this is possible

I habe setup some ID-Cards for testing.

What are the next steps? Which information do you need to implement this?

Thanks for your work in this great project :)

I habe activated logging
Here is something from the Logs:
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] Connecting blablabla:5000, username blablabla
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] >>> {"method":"global.login","params":{"clientType":"","ipAddr":"(null)","loginType":"Direct"},"id":1,"session":0}
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"error":{"code":268632079,"message":"Component error: login challenge!"},"id":1,"params":{"authorization":"blablabla","encryption":"Default","mac":"38AF29BF4B14","random":"blablabla","realm":"Login to blablabla"},"result":false,"session":2147473615}
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] >>> {"method":"global.login","params":{"clientType":"","ipAddr":"(null)","loginType":"Direct","userName":"admin","password":"blablabla"},"id":2,"session":2147473615}
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":2,"params":{"keepAliveInterval":60},"result":true,"session":2147473615}
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] >>> {"method":"eventManager.attach","params":{"codes":["All"]},"id":3,"session":2147473615}
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] >>> {"method":"magicBox.getSystemInfo","id":4,"session":2147473615}
2021-08-06 14:32:49 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook ba3b4414c2d017d47f6967ea21db00712d5155b53e0d0737b9f08fe1f2e4d73b from 192.168.178.41
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":3,"params":{"SID":513},"result":true,"session":2147473615}
2021-08-06 14:32:49 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":4,"params":{"appAutoStart":true,"deviceType":"VTO2000A","hardwareVersion":"1.00","processor":"dm365","serialNumber":"4G05C25PAZD71F4","updateSerial":"VTO2000A","updateSerialCloudUpgrade":"VTO2000A:0:4:1:3:5:0:1:9:3:3:0:1B0:0:0:0:0:0:0:0"},"result":true,"session":2147473615}
2021-08-06 14:32:50 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":3,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Start","Code":"AddCard","Data":{"Data":[{"CardNo":"3D609DA1","CardStatus":0,"CardType":0,"UserID":"1405","UserName":"SK-Work"}],"LocaleTime":"2021-08-06 12:30:53","Name":"Card","Number":1"UTC":1628253053.0},"Index":0,"Param":null},{"Action":"Start","Code":"AlarmLocal","Data":{"LocaleTime":"2021-08-06 12:30:53","UTC":1628253053.0},"Index":1,"Param":{}},{"Action":"Start","Code":"CallNoAnswered","Data":{"CallID":"0","IsEncryptedStream":false,"LocaleTime":"2021-08-06 12:30:53","LockNum":2,"SupportPaas":false,"TCPPort":37777,"UTC":1628253053.0},"Index":9900,"Param":{}},{"Action":"Start","Code":"ProfileAlarmTransmit","Data":{"DevSrcType":"Digit","LocaleTime":"2021-08-06 12:30:53","SenseMethod":"PreventRemove","UTC":1627956090,"UserID":"8001"},"Index":1,"Param":null},{"Action":"Start","Code":"RtspSessionDisconnect","Data":{"Device":"192.168.178.56","LocaleTime":"2021-08-06 12:30:53","StreamType":"Extra1","UTC":1628253053.0,"UserAgent":" Lavf58.20.100"},"Index":0,"Param":null},{"Action":"Start","Code":"FingerPrintCollect","Data":{"FingerPrintName":"pk","LocaleTime":"2021-08-06 12:30:53","UTC":1628253053.0,"UserID":"1405"},"Index":0,"Param":null}]},"session":2147473615}
2021-08-06 14:36:28 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":3,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"BackKeyLight","Data":{"LocaleTime":"2021-08-06 12:34:31","State":8,"UTC":1628253271.0},"Index":-1}]},"session":2147473615}
2021-08-06 14:36:28 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":3,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"AccessControl","Data":{"CardNo":"bd08f6fa","CardType":null,"LocaleTime":"2021-08-06 12:34:31","Method":1,"Name":"OpenDoor","Password":"","ReaderID":"1","RecNo":4,"SnapURL":"","Status":1,"Type":"Entry","UTC":1628253271.0,"UserID":"1405"},"Index":0}]},"session":2147473615}
2021-08-06 14:36:50 DEBUG (MainThread) [custom_components.dahua_vto.sensor] >>> {"method":"global.keepAlive","params":{"timeout":60,"action":true},"id":8,"session":2147473615}
2021-08-06 14:36:50 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":8,"params":{"timeout":60},"result":true,"session":2147473615}

Dahua VTO2211G-P no event on button press

I have a Dahua VTO2211G-P running the latest firmware (2021-11-16 V4.511.0000000.0.R) and the component apparently connects successfully to the device, at least every minute the pulse is successful, but i don't get any event or log when the ring button is pressed. It also doesn't show anything on the call log of the device, even though the voice on the device says it is calling. Also nothing rings on the DMSS app.

Is there anything that i might be doing wrong?
Thanks

Log example:
2022-02-11 14:23:06 DEBUG (MainThread) [custom_components.dahua_vto.sensor] >>> {"method":"global.keepAlive","params":{"timeout":60,"action":true},"id":15588,"session":394176402}
2022-02-11 14:23:06 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":15588,"params":{"timeout":60},"result":true,"session":394176402}
2022-02-11 14:23:11 DEBUG (MainThread) [custom_components.dahua_vto.sensor] <<< {"id":3,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2022-02-11 14:22:01","Success":false,"UTC":1644589321.0},"Index":0}]},"session":394176402}

States al the time ok

The state is al the time, ok
got an: VTO2101E-P-S1

When I change the state in HomeAssistant through Developper, the state jumps back to OK.
So when I push the doorbel nothing happens to the state.

Can not unlock

Hello,

Not sure it's related, but with the latest upgrade of the HA core to core-2021.9.3, the unlock function stopped working.
Events from the door panel are received just fine.
This no longer works:

  • platform: dahua_vto
    name: Dahua VTO
    host: 192.168.XX.XX
    username: !secret dahua_username
    password: !secret dahua_password
    scan_interval: 5

service: dahua_vto.open_door
data:
entity_id: sensor.dahua_vto
channel: 1
short_number: HA

This still does:
shell_command:
dahua_vto_open_door: curl -s --globoff --digest --user admin:XXXXX "http://192.168.XX.XX/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote"

There's nothing special in the logs (even though i've not enabled any debug).
Panel type VTO3221D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.