Ever since I added security cameras to my house I’ve wanted to use the video in various projects, such as automatically detecting cars and faces and sending myself a text message saying “Your parents just arrived at your house!”, or “The UPS truck is here!”.
Unfortunately Ring doesn’t even give you any way to manually download the videos, let alone automatically whenever activity is detected.
Fear not though, even though there is no official api to allow this, there are some unofficial ways you can write programs or scripts to get your camera information and download videos from your Ring cameras.
Thankfully some wonderful people on GitHub, such as tchellomello, have provided us all with an unofficial way of getting this information.
This is written in Python and makes accessing your information incredibly easy.
Assuming you already have Python installed, first you need to install this unofficial api
pip install ring_doorbell
Then in your python script, give your credentials to allow the script to log into your account.
from ring_doorbell import Ring
myring = Ring(‘email_address‘, ‘password‘)
After that you are free to start querying your devices with
myring.stickup_cams #This handles all ring cameras which are not doorbells.
For example, back to my use case of training a computer vision system to automatically detect faces and objects, I can download the latest video from one of my floodlight cameras like this:
floodlight = myring.stickup_cams
This code will:
- grab the first floodlight or stickup camera (the api treats them both the same),
- get the id of the latest video from that camera’s history which was generated from a motion event
- use the id to download the file to wherever your python script is running from and give the video the name “motion.mp4”
From there you can run the video through the computer vision system and test how well it works.
Unfortunately this doesn’t yet get me to the point where I’m automatically downloading the videos to send myself alerts, but I’m still working on that part. So please check back later to see my progress!