myhomeiot / DahuaVTO

Control Dahua VTO/VTH devices from Home Assistant
GNU General Public License v3.0
147 stars 17 forks source link

emulate doorbell button press #30

Closed bartoszx closed 3 months ago

bartoszx commented 4 months ago

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?

myhomeiot commented 4 months ago

Hello, not sure that I understand your question correctly, you want to send some VTO command to pressing the doorbell button so the VTO should make a SIP call as it's did when regular ring button pressed? Or you just need to send same event as VTO did when ring button pressed so the rest of Home Assistant automations will works as getting doorbell ring?

bartoszx commented 4 months ago

Thank you for your response. Yes, I want to send a command to the VTO to simulate pressing the doorbell button, causing it to make a SIP call just as it would if the physical ring button were pressed. The scenario is as follows:

When a barcode is scanned and found to be invalid (i.e., not in the database), I want Home Assistant to virtually press the ring button on the VTO so that the courier will be able to call through the intercom (or wait for the gate to open by me) as if they pressed the button physically.

myhomeiot commented 4 months ago

Don't know if it possible at all but I will try to find something.

myhomeiot commented 3 months ago

I found the command which working with my VTO2111D! It's make a SIP call to number 9901 same as doorbell button. To cancel the call you can use hc command.

service: dahua_vto.send_command
data:
  entity_id: sensor.dahua_vto
  method: console.runCmd
  params: {'command': 'call 9901'}
  event: false
bartoszx commented 3 months ago

works perfect! thank you!!

myhomeiot commented 3 months ago

Great!