This is a Node.js version of this python library. It allows to communicate with Blink Home Security System from a Node.js application.
npm install node-blink-security
const Blink = require('node-blink-security');
var blink = new Blink('YOUR_EMAIL', 'YOUR_PASSWORD');
blink.setupSystem()
.then(() => {
blink.setArmed()
.then(() => {
// see the object dump for details
console.log(blink);
});
}, (error) => {
console.log(error);
});
class Blink
blink.cameras
- the information about all available camerasblink.idTable
-{cameraId:cameraName}
map for further referencesblink.networkId
- network idblink.accountId
- account idblink.region
- region (e.g.prod
)blink.regionId
- region (e.g.United States
)
blink.refresh
- get all blink cameras and pulls their most recent statusblink.getSummary
- get a full summary of device informationblink.getCameraThumbs
- refresh all cameras thumbnailsblink.getEvents
- get all events from Blink server (e.g. heartbeats, motion...)blink.isOnline
- return boolean system online statusblink.getLastMotions
- refresh motion events datablink.isArmed
- return boolean status of sync module: armed(true)/disarmed(false).blink.setArmed(boolean)
- arm/disarm the system;true
by defaultblink.getCameras
- find and creates cameras; used for internal purposesblink.getLinks
- set access links and required headers for each camera in system; used for internal purposesblink.setupSystem([system name or id])
- logs in and sets auth token, urls, and ids for future requests. Specify a system identifier if you have more than one system setup.blink.getIDs
- set the network ID and Account ID; used for internal purposeblink.getClients
- get information about devices that have connected to the system
class BlinkCamera
blinkCamera.id
- camera idblinkCamera.name
- camera nameblinkCamera.region_id
- region idblinkCamera.armed
- camera arm statusblinkCamera.clip
- current clipblinkCamera.thumbnail
- current thumbnailblinkCamera.temperature
- camera temperatureblinkCamera.battery
- battery levelblinkCamera.notifications
- number of notificationsblinkCamera.image_link
- image linkblinkCamera.arm_link
- link to arm camerablinkCamera.header
- request headerblinkCamera.motion
- last motion event detailblinkCamera.updated_at
- last device update date
blinkCamera.snapPicture
- take a picture with camera to create a new thumbnailblinkCamera.setMotionDetect(boolean)
- set motion detectionblinkCamera.update
- update camera information; internal useblinkCamera.imageRefresh
- refresh current thumbnailblinkCamera.fetchImageData
- get the image data for the camera's current thumbnail
MIT