npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@schmupu/doorbot

v5.4.1

Published

Ring.com Doorbell API

Downloads

2

Readme

Ring.com Doorbell API Build Status

This is a copy of the source code from https://github.com/davglass/doorbot . I made this copy only, because the npm version is not actual.

I built this because of this tweet.

I have nothing to do with Ring.com, they just annoyed me with that tweet, so I figured out their api..

doorbot 2.x has an API change

usage

npm i @schmupu/doorbot --save

const RingAPI = require('doorbot');

const ring = RingAPI({
    email: '[email protected]',
    password: '12345',
    retries: 10, //authentication retries, optional, defaults to 0
    userAgent: 'My User Agent', //optional, defaults to @android:com.ringapp:2.0.67(423)
    api_version: 11, //optional in case you need to change it from the default of 9
    timeout: (10 * 60 * 1000) //Defaults to 5 minutes
});

ring.devices((e, devices) => {
    console.log(e, devices);
    ring.history((e, history) => {
        console.log(e, history);
        ring.recording(history[0].id, (e, recording) => {
            console.log(e, recording);
            const check = () => {
                console.log('Checking for ring activity..');
                ring.dings((e, json) => {
                    console.log(e, json);
                });
            };
            setInterval(check, 30 * 1000);
            check();
        });
    });

    //floodlights are under the stickups_cams prop
    if (devices.hasOwnProperty('stickup_cams') && 
        Array.isArray(devices.stickup_cams) &&
        devices.stickup_cams.length > 0) {
        
        ring.lightToggle(devices.stickup_cams[0], (e) => {
            //Light state has been toggled
        });
    }
});

api

Get a list of your devices:

ring.devices(callback) => (error, array)

Device Health: ring.health(device, callback) => (error, json)

Get your ring history:

ring.history(callback) => (error, array) ring.history(limit, callback) => (error, array) - limit - The Number of items to return from the history. ring.history(limit, older_than, callback) => (error, array) - limit - The Number of items to return from the history. older_than - The ID of the latest history item to start with when going backward.

Get a URL to a recording:

ring.recording(id, callback) => (error, url)

Get information for video on demand:

ring.vod(device, callback) => (error, json)

Turn on floodlights

ring.lightOn(device, callback) => (error)

Turn off floodlights

ring.lightOff(device, callback) => (error)

Toggle floodlights

ring.lightToggle(device, callback) => (error)

Set Chime Do Not Disturb

ring.set_chime_dnd(device, minutes, callback) => (error, json)

  • on: ring.set_chime_dnd(device, 15, callback) => (error, json)
  • off: ring.set_chime_dnd(device, 0, callback) => (error, json)

Get Chime Do Not Disturb

ring.get_chime_dnd(device, callback) => (error, json)

Set Doorbot Do Not Disturb (motion snooze)

ring.set_doorbot_dnd(device, minutes, callback) => (error, json)

  • on: ring.set_doorbot_dnd(device, 60, callback) => (error, json)
  • off: ring.set_doorbot_dnd(device, 0, callback) => (error, json)

The Get API call for the doorbot DND returned a 404, not sure how to get the current time

debugging

I've added the debug module, so you can run this with export DEBUG=doorbot and it will print some helpful logs.