Dahua VTO2111 notification to home automation system

mifrey

n3wb
Joined
Dec 20, 2018
Messages
14
Reaction score
6
Location
Belgium
Hi all.

I have been playing with my VTO2111D-WP those last couple of days to find a way to notify my home automation system that someone is at the door.

I would have loved to see a text field in the web GUI to enter a specific URL that will be called when someone pushes on the doorbell. But of course there is none and Dahua did not foresee any other way to do this... :banghead:

So I found some suggestions on forums like using Tasker that would call a URL when a smartphone/tablet receives a push notification. Another was to set the VTO to record snapshots on a FTP server then use a tool to detect that the FTP directory has been updated. But guess what! My VTO does not record a snapshot when the doorbell button is pushed but only when the call is answered! :facepalm:

So I found another solution that I want to share here. I have some android devices on which I installed gdmss and subscribed to push notifications (note that I do not get the notification when my device is asleep but that is another story...). I analyzed the packets and the doorbell always sends TCP packets to 172.217.168.234 (Google server) port 443 when the button is pushed (would probably be port 2195 for Apple devices). So the idea is to detect those specific packets and do a specific action like calling an URL of my home automation system. This is actually very simple to do (one line :rofl:) on my dd-wrt router:

Code:
while true; do tcpdump -i br0 -n -c 1 'src host 192.168.1.124 and dst host 172.217.168.234 and dst port 443'; curl -k 'https://192.168.1.10/api?xxx'; sleep 5; done
This is an infinite loop in which tcpdump monitors the traffic and exits as soon as the first packet is sent by the doorbell (192.18.1.124) to Google server (172.217.168.234). Then it calls a URL on the home automation server (192.168.1.10) to inform it that someone is at the door. This method is quite generic and could be used with many other connected devices.


EDIT: I noticed that the called Google server is not always the same. Actually the first packet sent by the doorbell is a DNS query to get the IP of fcm.googleapis.com and the IP can change. A simple and probably sufficient solution is to remove the IP from the tcpdump parameters to only check the port 443.

Code:
while true; do tcpdump -i br0 -n -c 1 'src host 192.168.1.124 and and dst port 443'; curl -k 'https://192.168.1.10/api?xxx'; sleep 5; done
 
Last edited:

hnt

n3wb
Joined
Nov 8, 2018
Messages
22
Reaction score
7
Location
/home
Hi mifrey,
From what I noticed, 443/SSL packet is being sent to fcm.googleapis.com - this is why the IP changed in your case.
 

Ros

n3wb
Joined
Sep 26, 2017
Messages
10
Reaction score
0
@mifrey Man this is an awesome solution! I've been looking for something like this for a year now.
Can I do a similar thing with the standard Asus firmware on the router? Or do I have to change the router firmware to dd-wrt?
 
Last edited:

mifrey

n3wb
Joined
Dec 20, 2018
Messages
14
Reaction score
6
Location
Belgium
Hi mifrey,
From what I noticed, 443/SSL packet is being sent to fcm.googleapis.com - this is why the IP changed in your case.
I just checked again and that is correct, the first packet sent by the doorbell is a DNS query to get the IP of fcm.googleapis.com. I will update my first post. Thanks.

Note that I do not see any other communication to other IPs so I do not know how the doorbell would notify a Dahua screen if I had one...
 

mifrey

n3wb
Joined
Dec 20, 2018
Messages
14
Reaction score
6
Location
Belgium
@mifrey Man this is an awesome solution! I've been looking for something like this for a year now.
Can I do a similar thing with the standard Asus firmware on the router? Or do I have to change the router firmware to dd-wrt?
I do not know the stock Asus firmware. You should check if you can connect with SSH and if tcpdump and curl are available.
 

hnt

n3wb
Joined
Nov 8, 2018
Messages
22
Reaction score
7
Location
/home
Note that I do not see any other communication to other IPs so I do not know how the doorbell would notify a Dahua screen if I had one...
Try to configure an arbitrary IP address of VTH and see :)
 

mifrey

n3wb
Joined
Dec 20, 2018
Messages
14
Reaction score
6
Location
Belgium
Try to configure an arbitrary IP address of VTH and see :)
I tried but I only see a UDP packet to a multicast IP (the packet data includes the IP of the VTH) every 30 seconds continuously even when I do not ring...
 
Joined
Mar 29, 2019
Messages
1
Reaction score
0
Location
France
Bonjour !
I just bought a VTO2111. The push notifications are delayed by 1 to 5 second even more sometimes. I am wondering (as I am not an expert) if it would be possible to use google find to ring the smartphone without delay....
Another question : I do not know where to put the code in my DD-WRT router (
while true; do tcpdump -i br0 -n -c 1 'src host 192.168.1.124 and and dst port 443'; curl -k 'https://192.168.1.10/api?xxx'; sleep 5; done) . In the administration/commands ?
I think one of the two "and" can be removed in your code !
Thank you already for sharing your solution !
 
Last edited:

mifrey

n3wb
Joined
Dec 20, 2018
Messages
14
Reaction score
6
Location
Belgium
I did not see your post...

For "google find" I do not know. Another option would be to use another notification apps such as Pushbullet. I have always had delay issues with the notification from the Dahua app, but I believe that is an Android issue at the end...

For dd-wrt, yes one "and" is not needed ;-) you can put the code in Administration->Commands->Startup.
 

JacquesFR

n3wb
Joined
Aug 17, 2019
Messages
2
Reaction score
0
Location
France
Hi
My VTO2111 is recheable at 192.168.0.215 / my Jeedom is at XX;
If i type http://192.168.0.XX/core/api/jeeApi.php?apikey=UOVYXXXXX37AW7&type=camera&id=1665&value=1 in chrome it does what i want in my automation system.

i added those commands in my OPEN WRT at startup :
while true; do tcpdump -i br0 -n -c 1 'src host 192.168.0.215 and dst port 443'; curl -k 'http://192.168.0.XX/core/api/jeeApi.php?apikey=UOVYXXXXX37AW7&type=camera&id=1665&value=1'; sleep 5; done
while true; do tcpdump -i br0 -n -c 1 'src host 192.168.0.215 and dst port 2165'; curl -k 'http://192.168.0.XX/core/api/jeeApi.php?apikey=UOVYXXXXX37AW7&type=camera&id=1665&value=1'; sleep 5; done
i did reboot but nothing happens if i push the button on the VTO.

Could you help guessing where i am wrong ?

thanks
 

mifrey

n3wb
Joined
Dec 20, 2018
Messages
14
Reaction score
6
Location
Belgium
Do you receive a notification on your Android Dahua app when you push the button? If not, you should first subscribe to receive notifications. If yes, I would suggest to sniff the network traffic to observe the packets and make sure the VTO sends a packet to port 443. For that you have 2 options.

Option 1: Connect to you router with SSH and run the command tcpdump -i br0 -n 'src host 192.168.0.215'. Note that the network interface may be different than br0 on your router. You can check the name of the interface with ifconfig.

Option 2: Using Wireshark on your computer with the "SSH remote capture".
 

JacquesFR

n3wb
Joined
Aug 17, 2019
Messages
2
Reaction score
0
Location
France
Yes i do with IOS devices, i will try to sniff, thanks

*edit*
i did try both and see no traffic, im a beginner so i must have done something wrong

i installed tcpdump on my router and connected via putty but the command with br-lan or eth0 results in nothing but ">"
 
Last edited:

catcamstar

Known around here
Joined
Jan 28, 2018
Messages
1,659
Reaction score
1,193
Yes i do with IOS devices, i will try to sniff, thanks

*edit*
i did try both and see no traffic, im a beginner so i must have done something wrong

i installed tcpdump on my router and connected via putty but the command with br-lan or eth0 results in nothing but ">"
For iOS push notifications, you have to watch for outbound TCP 2195.
 
Top