Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/madshall/node-blink-security
This is an npm module for communicating with Blink Home Security System
https://github.com/madshall/node-blink-security
blink camera nodejs npm security system
Last synced: about 2 months ago
JSON representation
This is an npm module for communicating with Blink Home Security System
- Host: GitHub
- URL: https://github.com/madshall/node-blink-security
- Owner: madshall
- License: mit
- Created: 2017-03-18T00:22:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-12T12:04:14.000Z (over 3 years ago)
- Last Synced: 2024-11-05T23:43:52.691Z (3 months ago)
- Topics: blink, camera, nodejs, npm, security, system
- Language: JavaScript
- Homepage:
- Size: 187 KB
- Stars: 86
- Watchers: 14
- Forks: 33
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Build Status](https://img.shields.io/travis/madshall/node-blink-security.svg)
![Downloads](https://img.shields.io/npm/dm/.svg)
![Downloads](https://img.shields.io/npm/dt/node-blink-security.svg)
![npm version](https://img.shields.io/npm/v/node-blink-security.svg)
![dependencies](https://img.shields.io/david/madshall/node-blink-security.svg)
![dev dependencies](https://img.shields.io/david/dev/madshall/node-blink-security.svg)
![License](https://img.shields.io/npm/l/node-blink-security.svg)# node-blink-security
This is a Node.js version of [this python library](https://github.com/fronzbot/blinkpy). It allows to communicate with Blink Home Security System from a Node.js application.
# Installation
```
npm install node-blink-security
```# Usage
```javascript
const Blink = require('node-blink-security');var blink = new Blink('YOUR_EMAIL', 'YOUR_PASSWORD', 'DEVICE_ID');
blink.setupSystem()
.then(() => {
blink.setArmed()
.then(() => {
// see the object dump for details
console.log(blink);
});
}, (error) => {
console.log(error);
});
```# API
```javascript
class Blink
```## Constructor
* `email` - your Blink account email
* `password` - your Blink account password
* `deviceId` - identifies your device and registers it in your account. It's required since version 4.0.0 of this package as this is when Blink switched to 2-factor authentication flow. The value is provided by you and it should let you identify the device correctly when you receive a verification email from Blink.
* `options`
* * `auth_2FA: false` - set to `true` if you want to receive verification code for each login, otherwise you'll receive verification email only once for the first time and after that the device will be remembered by Blink.
* * `verification_timeout: 60000` - number of milliseconds to wait for email verification until retrying account login
* * `device_name: "node-blink-security"` - this name appears in verification email along with your `deviceId`## Properties
* `blink.cameras` - the information about all available cameras
* `blink.idTable` - `{cameraId:cameraName}` map for further references
* `blink.networks` - map of configured networks (sync modules)
* `blink.accountId` - account id
* `blink.region` - region (e.g. `prod`)
* `blink.regionId` - region (e.g. `United States`)## Methods
* `blink.refresh` - get all blink cameras and pulls their most recent status
* `blink.getSummary` - get a full summary of system information, broken down by sync module
* `blink.getCameraThumbs` - refresh all cameras thumbnails
* `blink.getVideos(page, Date)` - get metadata for X (per page is unknown) videos recorded since `Date`. Paginate with `page` parameter
* `blink.getEvents` - get all events from Blink server (e.g. heartbeats, motion...), by sync module
* `blink.isOnline` - return boolean system online status, by sync module
* `blink.getLastMotions` - refresh motion events data
* `blink.isArmed()` - return boolean statuses of all sync modules: armed(true)/disarmed(false).
* `blink.setArmed(boolean, [networkIds])` - arm/disarm the system/specific set of sync modules; `true` by default
* `blink.getCameras` - find and creates cameras; used for internal purposes
* `blink.getLinks` - set access links and required headers for each camera in system; used for internal purposes
* `blink.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 IDs and Account ID; used for internal purpose
* `blink.getClients` - get information about devices that have connected to the system```javascript
class BlinkCamera
```## Properties
* `blinkCamera.id` - camera id
* `blinkCamera.name` - camera name
* `blinkCamera.region_id` - region id
* `blinkCamera.armed` - camera arm status
* `blinkCamera.clip` - current clip
* `blinkCamera.thumbnail` - current thumbnail
* `blinkCamera.temperature` - camera temperature
* `blinkCamera.battery` - battery level
* `blinkCamera.notifications` - number of notifications
* `blinkCamera.image_link` - image link
* `blinkCamera.arm_link` - link to arm camera
* `blinkCamera.header` - request header
* `blinkCamera.motion` - last motion event detail
* `blinkCamera.updated_at` - last device update date
* `blinkCamera.network_id` - camera's assigned sync module id (network id)## Methods
* `blinkCamera.snapPicture` - take a picture with camera to create a new thumbnail
* `blinkCamera.setMotionDetect(boolean)` - set motion detection
* `blinkCamera.update` - update camera information; internal use
* `blinkCamera.imageRefresh` - refresh current thumbnail
* `blinkCamera.fetchImageData` - get the image data for the camera's current thumbnail
* `blinkCamera.recordClip` - record video clip from the camera# License
MIT# This is awesome!
If you find this package helpful you can buy me a beer [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=U4M9U63LEHZGJ&lc=US&item_name=Thank%20you¤cy_code=USD)