Is it allowed to post an integration to Home Center with third party support tools? I hope so, because this is awesome!
My goal: Show the latest ringer at my front door in the Fibaro Home Center App when using my Ring Doorbell.
The Challenge: Ring.com has no official API and snapshots are not possible at the moment. Fibaro does not support Ring Doorbell and Home Center and LUA code is not able to download a video and extract a frame from it.
How I fixed it? I run a Node-RED box on (Debian) Linux. I installed Python with the Python Ring Door Bell Library to download the latest ringer video and ffmpeg to create a snapshot image. I use Node-RED to serve this snapshot with HTTP to the Home Center. You can also use NGINX, Apache or whatever webserver you like!
This post is for experienced users, I skip a lot Linux stuff. A more detailed approach is on my website (see my signature).
1. Install Python, pip and ffmpeg (of not already present) on your Linux (Raspberry/NUC/etc..) box:
sudo apt-get install python python-pip ffmpeg
2. Install the Python Ring Door Bell Library:
pip install ring_doorbell
3. Create a folder and download my FibaroRingCam.py script to it:
mkdir FibaroRingCam
cd FibaroRingCam
wget https://github.com/joepv/fibaro/blob/master/FibaroRingCam.py
4. In the script you have to edit the following lines with your own (login) information:
myring = Ring('
[email protected]', 'password')
mypath = '/home/joep/FibaroRingCam/'
5. Now run the file. You can run it as a service, but that is out of the scope of this topic.
6. Serve the snapshot with Node-RED to the Home Center.
Add the following node to Node-RED and edit the path of the file node to the path of the last_ding.jpg snapshot. If you want to use another webserver configure it to serve the snapshot:
[{"id":"d1f4395b.cd0778","type":"comment","z":"30de6047.723c","name":"Fibaro Ring Camera Snapshot","info":"","x":160,"y":180,"wires":[]},{"id":"e42e6aeb.e610e8","type":"http in","z":"30de6047.723c","name":"[get] /last_ding.jpg","url":"/last_ding.jpg","method":"get","upload":false,"swaggerDoc":"","x":130,"y":220,"wires":[["9329fca.9bf87"]]},{"id":"9329fca.9bf87","type":"file in","z":"30de6047.723c","name":"last_ding.jpg","filename":"/home/joep/FibaroRingCam/last_ding.jpg","format":"","chunk":false,"sendError":false,"x":350,"y":220,"wires":[["5dd8cb15.ea08b4"]]},{"id":"5dd8cb15.ea08b4","type":"http response","z":"30de6047.723c","name":"serve last_ding.jpg","statusCode":"","headers":{"content-type":"image/jpeg"},"x":590,"y":220,"wires":[]}]
7. Add a new camera in Fibaro Home Center 2:
8. Give the camera a useful name and change the advanced settings to the following settings:
IP address: node-red ip address:port
JPG path: last_ding.jpg
MJPG stream: last_ding.jpg
Note! The MJPG stream does not work, you have NO video! I’m still searching for a solution to play the last Ring video as camera stream.
The result in Home Center 2:
And in the Home Center App:
What the Python script does?
It logs in at the Ring.com servers and checks every 15 seconds if there is a new ring. It saves a local file to know if the last ring is a new one. If the ring is new, it downloads the lastest video and feeds it to ffmpeg to extract 1 frame to create a snapshot.