Skip to content

Integrate your BPL eyeq wifi doorbell with your home automation system like Home assistant via MQTT pubsub

License

Notifications You must be signed in to change notification settings

thekirankumar/bpl-eyeq-bell-hassio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Ever wondered how awesome it would be to not have your wifi doorbell's app running on your phone in the background consuming your battery and still get notified. Wouldn't it be cool if you can get a telegram message on your phone along with the photo of the person at your door? Or how about having an option to toggle the door lock from within telegram, without opening those shitty chinese apps which hardly work?

All this is possible by using this addon, along with a bunch of other addons. You compile the code present here, deploy it to the doorbell (it runs busybox, so essentially its linux) and voila, your code runs on the doorbell. Keep reading ahead for more details.

What is this ?

This script enables a local MQTT publishing client to run on BPL Eyeq WiFi doorbells. Full credit to @nwaelti for figuring this out. All you have to do is to put the Home assistant (Hassio) MQTT (addon) IP Address into the source, compile it and push it run on the doorbell, and then run automation based on the event from doorbell press.

An example automation with this : If MQTT event with topic = cmd/doorbell/dingdong (provided by this addon) then capture a photo from door bell camera (mjpeg integration has to be done separately), then send a telegram message (telegram integration separate)

Before compiling: change of the mqtt clientid and home assisant MQTT broker IP address.

Pre-requisites

Compilation

Compilation can be achieved on a debian using a cross compile toolchain for mips, with the following command line:

mips-linux-gnu-gcc -mips32 -muclibc -EL -mabi=32 -static mqttbell.c -o mqttbell

When I ran this on a debian, it generated a corrupt binary (600KB), so I ran this command on a windows machine which gave the right binary (50KB) For windows, I installed "Sourcery CodeBench Lite for MIPS GNU/Linux" and ran the same command as above.

Installation

Installation on the doorbell is done with the following procedure:

  1. Connect to the doorbell using telnet (user: root, password: 123456)
  2. Have a TFTP Server running
  3. Upload your mqttbell on the doorbell (tftp -g -r mqttbell <ip_of_tftp_server>) in the /system/system/bin folder
  4. Download your /system/init/ipcam.sh file to modify it on the debian machine
  5. In that file, add two lines: iptables -t nat -A OUTPUT -p udp -d 112.74.102.136 -j REDIRECT --to-ports 8629 and /system/system/bin/mqttbell &
  6. Upload the modified file and make it executable (chmod +x mqttbell)
  7. Start the commands manually to test
  8. Uninstall the shitty BPL eyeq app from your phone. This addon will always be online on the doorbell unlike their app which crashes once in a while.

Now pushing the ring button on your doorbell should trigger a mqtt message.

Have fun...

How does it work

  • ipcam.sh is the script which launches during bootup of the bell. Hence the two commands iptables and mqttbell are added to it.
  • when a doorbell is pressed, it sends a udp packet to 112.74.102.136 (figured out via wireshark)
  • running the iptables command redirects a copy of all the udp packets with destination = 112.74.102.136 (chinese server) to the local port 8629
  • mqttbell binary running in the background intercepts all packets coming from the above step (localhost:8629) and makes a MQTT connection and publishes these packets on the MQTT topic cmd/doobell/dingdong
  • home assistant or any other system subscribed to the above MQTT topic can receive this and use it for automations (like sending a telegram notification or playing a sound).

Warning

The doorbell keeps sending a hearbeat packet (every minute) to the same server. This packet will also be forwarded to your MQTT. You will have to ignore this message by having a condition on the length. The actual packet sent when the doorbell is pressed will have a larger length than the heartbeat packet.

Open the Yale door lock remotely (optional)

You can add the following into home assistant's configuration.yaml Username and password is the one you configured on the BPL eyeq app. IP address is the doorbell's IP address.

rest_command:
  open_door_rest:
    url: http://<IP_of_doorbell>:81/openlock.cgi?user=<username>&pwd=<password>
    method: GET

Once configured, this will expose a home assistant service to open the door lock. This can be used in your automations.

Future

The next set of steps would be to figure out a way to use an addon like facebox to recognize the face and use google home TTS engine to to announce who's at your door.

About

Integrate your BPL eyeq wifi doorbell with your home automation system like Home assistant via MQTT pubsub

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%