A Python library to communicate with Ring Door Bell (https://ring.com/)
Project description
Python Ring Door Bell is a library written in Python 2.7/3x that exposes the Ring.com devices as Python objects.
Currently Ring.com does not provide an official API. The results of this project are merely from reverse engineering.
Documentation: http://python-ring-doorbell.readthedocs.io/
Installation
# Installing from PyPi
$ pip install ring_doorbell
# Installing latest development
$ pip install \
git+https://github.com/tchellomello/python-ring-doorbell@master
Initializing your Ring object
from pprint import pprint
from ring_doorbell import Ring, Auth
auth = Auth(None, token_updated)
auth.fetch_token(username, password)
ring = Ring(auth)
pprint(ring.devices)
Listing devices linked to your account
# All devices
myring.devices
{'chimes': [<RingChime: Downstairs>],
'doorbells': [<RingDoorBell: Front Door>]}
# All chimes
myring.chimes
[<RingChime: Downstairs>]
# All door bells
myring.doorbells
[<RingDoorBell: Front Door>]
# All stickup cams
myring.stickup_cams
[<RingStickUpCam: Driveway>]
Playing with the attributes and functions
for dev in list(myring.stickup_cams + myring.chimes + myring.doorbells):
print('Account ID: %s' % dev.account_id)
print('Address: %s' % dev.address)
print('Family: %s' % dev.family)
print('ID: %s' % dev.id)
print('Name: %s' % dev.name)
print('Timezone: %s' % dev.timezone)
print('Wifi Name: %s' % dev.wifi_name)
print('Wifi RSSI: %s' % dev.wifi_signal_strength)
# setting dev volume
print('Volume: %s' % dev.volume)
dev.volume = 5
print('Volume: %s' % dev.volume)
# play dev test shound
if dev.family == 'chimes':
dev.test_sound(kind = 'ding')
dev.test_sound(kind = 'motion')
# turn on lights on floodlight cam
if dev.family == 'stickup_cams' and dev.lights:
dev.lights = 'on'
Showing door bell events
for doorbell in myring.doorbells:
# listing the last 15 events of any kind
for event in doorbell.history(limit=15):
print('ID: %s' % event['id'])
print('Kind: %s' % event['kind'])
print('Answered: %s' % event['answered'])
print('When: %s' % event['created_at'])
print('--' * 50)
# get a event list only the triggered by motion
events = doorbell.history(kind='motion')
Downloading the last video triggered by ding
doorbell = myring.doorbells[0]
doorbell.recording_download(
doorbell.history(limit=100, kind='ding')[0]['id'],
filename='/home/user/last_ding.mp4',
override=True)
Displaying the last video capture URL
print(doorbell.recording_url(doorbell.last_recording_id))
'https://ring-transcoded-videos.s3.amazonaws.com/99999999.mp4?X-Amz-Expires=3600&X-Amz-Date=20170313T232537Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=TOKEN_SECRET/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=secret'
How to contribute
See CONTRIBUTING.rst
Credits && Thanks
This project was inspired and based on https://github.com/jeroenmoors/php-ring-api. Many thanks @jeroenmoors.
A guy named MadBagger at Prism19 for his initial research (http://www.prism19.com/doorbot/second-pass-and-comm-reversing/)
The creators of mitmproxy (https://mitmproxy.org/) great http and https traffic inspector
@mfussenegger for his post on mitmproxy and virtualbox https://zignar.net/2015/12/31/sniffing-vbox-traffic-mitmproxy/
To the project http://www.android-x86.org/ which allowed me to install Android on KVM.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ring_doorbell-0.4.0.tar.gz
.
File metadata
- Download URL: ring_doorbell-0.4.0.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84290b1eadd0ed8e504798adbc5c4823fd0cc12b1e68179b76a6ff09ffb0656b |
|
MD5 | 426822fcfba0207a56ea412e411328a8 |
|
BLAKE2b-256 | 7236873e9abcb5ca49a73efdae76e69d67e647716e40204c1eef23c3fa1e172c |