This is a NodeJS library to interact with Doorbird Door Stations, based on their API.
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.
npm i doorbirdIn 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.
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});// 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);});// 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);});// 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);});// 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);});To be documented. (Already available in the library)
// get image urlletimageUrl=doorbird.getImageUrl();// get audio urlletaudioUrl=doorbird.getAudioUrl(sessionId)// get video urlletvideoUrl=doorbird.getVideoUrl(sessionId);// 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();Revision: 0.36 Date: November 13th 2023 https://www.doorbird.com/downloads/api_lan.pdf?rev=0.36