Skip to main content

A Python library to communicate with Ring Door Bell (

Project description

Looking for maintainers

Python Ring Door Bell is a library written for Python 3.6+ that exposes the devices as Python objects.

Currently does not provide an official API. The results of this project are merely from reverse engineering.



# Installing from PyPi
$ pip install ring_doorbell

# Installing latest development
$ pip install \

Initializing your Ring object

import json
import getpass
from pathlib import Path
from pprint import pprint

from ring_doorbell import Ring, Auth
from oauthlib.oauth2 import MissingTokenError

cache_file = Path("test_token.cache")

def token_updated(token):

def otp_callback():
    auth_code = input("2FA code: ")
    return auth_code

def main():
    if cache_file.is_file():
        auth = Auth("MyProject/1.0", json.loads(cache_file.read_text()), token_updated)
        username = input("Username: ")
        password = getpass.getpass("Password: ")
        auth = Auth("MyProject/1.0", None, token_updated)
            auth.fetch_token(username, password)
        except MissingTokenError:
            auth.fetch_token(username, password, otp_callback())

    ring = Ring(auth)

    devices = ring.devices()

if __name__ == "__main__":

Listing devices linked to your account

# All devices
devices = ring.devices()
{'chimes': [<RingChime: Downstairs>],
'doorbots': [<RingDoorBell: Front Door>]}

# All doorbells
doorbells = devices['doorbots']
[<RingDoorBell: Front Door>]

# All chimes
chimes = devices['chimes']
[<RingChime: Downstairs>]

# All stickup cams
stickup_cams = devices['stickup_cams']
[<RingStickUpCam: Driveway>]

Playing with the attributes and functions

devices = ring.devices()
for dev in list(devices['stickup_cams'] + devices['chimes'] + devices['doorbots']):
    print('Address:    %s' % dev.address)
    print('Family:     %s' %
    print('ID:         %s' %
    print('Name:       %s' %
    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 == 'chimes':
        dev.test_sound(kind = 'ding')
        dev.test_sound(kind = 'motion')

    # turn on lights on floodlight cam
    if == 'stickup_cams' and dev.lights:
        dev.lights = 'on'

Showing door bell events

devices = ring.devices()
for doorbell in devices['doorbots']:

    # 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

devices = ring.devices()
doorbell = devices['doorbots'][0]
    doorbell.history(limit=100, kind='ding')[0]['id'],

Displaying the last video capture URL


Controlling a Light Group

groups = ring.groups()
group = groups['the-group-you-want']

# Prints True if lights are on, False if off

# Turn on lights indefinitely
group.lights = True

# Turn off lights
group.lights = False

# Turn on lights for 30 seconds
group.lights = (True, 30)

How to contribute


Credits && Thanks

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ring-doorbell, version 0.7.1
Filename, size File type Python version Upload date Hashes
Filename, size ring_doorbell-0.7.1.tar.gz (23.5 kB) File type Source Python version None Upload date Hashes View
Filename, size ring_doorbell-0.7.1-py3-none-any.whl (18.8 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page