Git Product home page Git Product logo

node-blink-security's Introduction

Build Status Downloads Downloads npm version dependencies dev dependencies License

node-blink-security

This is a Node.js version of this python library. It allows to communicate with Blink Home Security System from a Node.js application.

Installation

npm install node-blink-security

Usage

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

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
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

node-blink-security's People

Contributors

madshall avatar tonymet avatar junketjim avatar jasmas avatar yacomink avatar bartdorsey avatar ingermaa avatar kylecbrodie avatar squareplanetdesign avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.