Skip to content

Repository files navigation

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

letdoorbird=newDoorbird({scheme: Scheme.http,// or httpshost: '<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 sessiondoorbird.initializeSession().then(response=>{letsessionId=response.SESSIONID;}).catch(err=>{console.log(err);});// destroy a sessiondoorbird.destroySession().then(response=>{console.log("Session destroyed.");}).catch(err=>{console.log(err);});

Basic Control

// get station infodoorbird.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 devicedoorbird.restart().then(()=>{console.log("Doorbird device restarted.");}.catch(err=>{console.log(err);});

Favorite Handling

// list favoritesdoorbird.listFavorites().then(response=>{console.log("Favorites:",response);}).catch(err=>{console.log(err);});// create favoritedoorbird.createFavorite(FavoriteType.http,{title: 'My Favorite',value: 'http://anyIp/doorbird'}).then(()=>{console.log("Favorite created.");}).catch(err=>{console.log(err);});// update favoritedoorbird.createFavorite("favoriteId",FavoriteType.http,{title: 'My Favorite',value: 'http://anyChangedIp/doorbird'}).then(()=>{console.log("Favorite updated.");}).catch(err=>{console.log(err);});// delete favoritedoorbird.createFavorite("favoriteId",FavoriteType.http).then(()=>{console.log("Favorite deleted.");}).catch(err=>{console.log(err);});

Schedule

// get scheduledoorbird.getSchedule().then(response=>{console.log("Schedule:",response);}).catch(err=>{console.log(err);});// create schedule entrydoorbird.createScheduleEntry({input: 'doorbell',output: {event: 'http',param: 'My Favorite',schedule: 'once'}}).then(()=>{console.log("Schedule entry created.");}).catch(err=>{console.log(err);});// update schedule entrydoorbird.updateScheduleEntry({input: 'doorbell',output: {event: 'http',param: 'My Favorite',schedule: 'once'}}).then(()=>{console.log("Schedule entry updated.");}).catch(err=>{console.log(err);});// delete schedule entrydoorbird.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 urlletimageUrl=doorbird.getImageUrl();// get audio urlletaudioUrl=doorbird.getAudioUrl(sessionId)// get video urlletvideoUrl=doorbird.getVideoUrl(sessionId);

dgram UDP Socket for Ring and Motion Events

// initialize dgram UDP socketletdoorbirdUdpSocket=doorbird.startUdpSocket(6524);// register a listener for ring eventsdoorbirdUdpSocket.registerRingListener(ringEvent=>{console.log("IntercomId:",ringEvent.intercomId);console.log("Event:",ringEvent.event);console.log("Time:",ringEvent.timestamp);});// register a listener for motion eventsdoorbirdUdpSocket.registerMotionListener(motionEvent=>{console.log("IntercomId:",motionEvent.intercomId);console.log("Time:",motionEvent.timestamp);});// close dgram UDP socketdoorbirdUdpSocket.close();

Doorbird API

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

About

Node client library for Doorbird's HTTP API.

Topics

Resources

Code of conduct

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages