Skip to main content

A Python library to communicate with Ring Door Bell (https://ring.com/)

Project description

https://badge.fury.io/py/ring-doorbell.svg https://travis-ci.org/tchellomello/python-ring-doorbell.svg?branch=master https://coveralls.io/repos/github/tchellomello/python-ring-doorbell/badge.svg?branch=master https://img.shields.io/pypi/pyversions/ring-doorbell.svg

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 ring_doorbell import Ring
myring = Ring('foo@bar', 'secret')

myring.is_connected
True

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):

    # refresh data
    dev.update()

    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

Project details


Download files

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

Source Distribution

ring_doorbell-0.2.9.linux-x86_64.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

ring_doorbell-0.2.9-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file ring_doorbell-0.2.9.linux-x86_64.tar.gz.

File metadata

  • Download URL: ring_doorbell-0.2.9.linux-x86_64.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for ring_doorbell-0.2.9.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 05a9940dc8f0f7815d999124d8c8b90a821cb4dd339dac934911fb7eb75dfbd4
MD5 206bbb81afdc512cc889943ad499233b
BLAKE2b-256 dd0cbb8219ef5c69c079e0d38630041481ab279635ebfe0a9ea928b71656fd5b

See more details on using hashes here.

File details

Details for the file ring_doorbell-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: ring_doorbell-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for ring_doorbell-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 86932b6cc2487373f823f71d7a6fcf00aee0c117bb2641c9891888b5a33af811
MD5 e0e807932df0dd27ee39fa712fea9501
BLAKE2b-256 fac48e8b68efeff61e8fbe30ab85d79d48c26cca74dfb951beffee9e169d3696

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page