0.0.3 • Published 6 years ago

zen-rainforest v0.0.3

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

ZEN Rainforest SDK for Node.js

This ZEN Rainforest SDK for Node.js helps you build applications that interact with your ZEN Within ZigBee Thermostat and manage their identities in your app.

npm version

Prerequisites

You need to install the Node.js JavaScript runtime environment to run the ZEN Rainforest SDK on your platform. To check if Node.js supports your platform (OS), verify that an install package is available on the Node.js download page.

yarn is a command-line package manager that is installed with Node.js is installed, and will be used to install the ZEN Rainforest SDK.

Installation

yarn add zen-rainforest to get the latest version.

How to use the ZEN Rainforest SDK for Node.js

Once you have installed the package as indicated above, you can start using the features of the ZEN Rainforest SDK in your code. Below is a code snippet showing how to login with your account and manage your ZEN Within Thermostat:

Note that for this sample to work, you will need to

  • Register your account as ADMIN or Operator on Rainforest cloud portal
  • Assoicate your Rainforest hub with your account
  • Pair your ZEN Within Thermostat
let RainZen = require('zen-rainforest')
let rainZen = new RainZen();

rainZen
    .Login(username, password)
    .catch(error=>{
        //error handling here
    })

rainZen
    .SetThermostatMode(rainforestGuid, thermotatGuid, 'Cool')
    .catch(error=>{
        //error handling here
    })

Directory structure

ZEN Rainforest SDK subfolders

/utils

Set of simple tuils showing how to use the features of the ZEN Rainforest SDK

/test

Test files