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

doorbird

v2.6.0

Published

Node JS library for the Doorbird LAN API.

Downloads

970

Readme

node-doorbird

Apache 2.0 License

This is a NodeJS library to interact with Doorbird Door Stations, based on their API.

Disclaimer

As this library potentially interacts with devices that are integrated in the security of the building, I want you to be aware of the fact, that you are using it at your own risk. I cannot be held responsible for any damage that occurs by the usage of this library.

Installation

npm i doorbird

Usage

Prerequisites

In order to use Doorbird's HTTP API, you need a user with privileges to use the API. For specific things, such as live view, open doors, there are dedicated privilates you have to grant to the user, if needed.

Client Initialization

let doorbird = new Doorbird({
    scheme: Scheme.http, // or https
    host: '<Doorbid IP Address>',
    username: '<Doorbird Username>',
    password: '<Doorbird Password>',
    certificate: '<certificate in pem format>' // can be omitted and is then loaded from the host
});

Session Management

// initialize a session
doorbird.initializeSession().then(response => {
    let sessionId = response.SESSIONID;
}).catch(err => {
    console.log(err);
});

// destroy a session
doorbird.destroySession().then(response => {
    console.log("Session destroyed.");
}).catch(err => {
    console.log(err);
});

Basic Control

// get station info
doorbird.getInfo().then(response => {
    console.log(response.VERSION["DEVICE-TYPE"]);
}).catch(err => {
    console.log(err);
});

// open door (switch relay)
doorbird.openDoor("1").then(response => {
    console.log("Door open.");
}).catch(err => {
    console.log(err);
});

// lights on (nightvision)
doorbird.lightOn().then(response => {
    console.log("Lights switched on.");
}).catch(err => {
    console.log(err);
});

// restart device
doorbird.restart().then(() => {
    console.log("Doorbird device restarted.");
}.catch(err => {
    console.log(err);
});

Favorite Handling

// list favorites
doorbird.listFavorites().then(response => {
    console.log("Favorites:", response);
}).catch(err => {
    console.log(err);
});

// create favorite
doorbird.createFavorite(FavoriteType.http, {
    title: 'My Favorite',
    value: 'http://anyIp/doorbird'
}).then(() => {
    console.log("Favorite created.");
}).catch(err => {
    console.log(err);
});

// update favorite
doorbird.createFavorite("favoriteId", FavoriteType.http, {
    title: 'My Favorite',
    value: 'http://anyChangedIp/doorbird'
}).then(() => {
    console.log("Favorite updated.");
}).catch(err => {
    console.log(err);
});

// delete favorite
doorbird.createFavorite("favoriteId", FavoriteType.http).then(() => {
    console.log("Favorite deleted.");
}).catch(err => {
    console.log(err);
});

Schedule

// get schedule
doorbird.getSchedule().then(response => {
    console.log("Schedule:", response);
}).catch(err => {
    console.log(err);
});

// create schedule entry
doorbird.createScheduleEntry({
    input: 'doorbell',
    output: {
        event: 'http',
        param: 'My Favorite',
        schedule: 'once'
    }
}).then(() => {
    console.log("Schedule entry created.");
}).catch(err => {
    console.log(err);
});

// update schedule entry
doorbird.updateScheduleEntry({
    input: 'doorbell',
    output: {
        event: 'http',
        param: 'My Favorite',
        schedule: 'once'
    }
}).then(() => {
    console.log("Schedule entry updated.");
}).catch(err => {
    console.log(err);
});

// delete schedule entry
doorbird.deleteScheduleEntry("doorbell", "My Favorite").then(() => {
    console.log("Schedule entry deleted.");
}).catch(err => {
    console.log(err);
});

SIP

To be documented. (Already available in the library)

Image, Audio and Video URLs

// get image url
let imageUrl = doorbird.getImageUrl();

// get audio url
let audioUrl = doorbird.getAudioUrl(sessionId)

// get video url
let videoUrl = doorbird.getVideoUrl(sessionId);

dgram UDP Socket for Ring and Motion Events

// initialize dgram UDP socket
let doorbirdUdpSocket = doorbird.startUdpSocket(6524);

// register a listener for ring events
doorbirdUdpSocket.registerRingListener(ringEvent => {
    console.log("IntercomId:", ringEvent.intercomId);
    console.log("Event:", ringEvent.event);
    console.log("Time:", ringEvent.timestamp);
});

// register a listener for motion events
doorbirdUdpSocket.registerMotionListener(motionEvent => {
    console.log("IntercomId:", motionEvent.intercomId);
    console.log("Time:", motionEvent.timestamp);
});

// close dgram UDP socket
doorbirdUdpSocket.close();

Doorbird API

Revision: 0.36 Date: November 13th 2023 https://www.doorbird.com/downloads/api_lan.pdf?rev=0.36