/WinkRedNode

Node Red application for Home Automation based on WINK api for hub as well as LIFX, IFTTT.

Primary LanguageJavaScriptMIT LicenseMIT

WinkRedNode

Updates

Please check Flows/Bluemix/README.md for latest updates.

This repository explains how to use Node-RED and Freeboard with the Wink API in order to enhance your home automation experience.

This repository is neither officially-endorsed (or supported) by Wink; however, Wink publishes an API and there are lots of wonderful open source tools that allow us to build on that API.

Overview

Node-RED operates around the notion of a "flow". This repository contains examples of many flows that "know" about the Wink API. Once you have one or more flows deployed in your Node-RED process, you can make use of that data.

Installation instruction:

  • Blue Mix Cloud Use following HOWTO for instructions on how to create BlueMix node.js container with node red as well as how to configure application for initial run,

  • Running Locally.

You can run this software on your own computer, such as a Raspberry Pi 2 model B or even your own laptop computer! In order to run Node-RED locally, take a look at the documentation. Here is the QUICKSTART for running Node-RED on Raspberry Pi. You can use configuration settings from local windows config if you do not see package.json in .node-red installation folder 2 things you need to install in order to start using node-red authentication: on your raspbery pi session execute following prior to start using node-red: (assumption is that your user name on rasp pi is 'pi')

  • cd /home/pi/.node-red
  • npm install when
  • npm install path
  • npm install winknodered@"git://github.com/tfatykhov/WinkRedNode.git#master"
  • npm install node-red-contrib-freeboard@"git://github.com/tfatykhov/node-red-contrib-freeboard.git"
  • npm install "suncalc"@"git://github.com/mourner/suncalc.git"

Once you have Node-RED running, you can deploy your flows described below To deploy a flow, point your browser to your Node-RED configuration page, e.g., [http://127.0.0.1:1880/]. Click on the three bars in the upper-right hand corner to get the menu, select "Import > Clipboard", cut-and-paste the contents of the Flow file into the pop-up window, and click OK. Then click on the "Deploy" button.

Main Flows

Please navigate to: Flows/Bluemix. In order for application to work you need to import following flows:

  1. Flows/Bluemix/winkCore.json - core flow that performs initial calls to wink servers in order to get access tocken, list of devices and subscribe itself for status updates from wink as well as other services. It also creates connection to weather api, ifttt, initialstate.com api bassed on your configuration settings.
  2. Flows/Bluemix/winkIntegration.json - creates entry points for IFTTT/tasker/etc.
  3. Flows/Bluemix/winkFreeboards.json - set of flows to generate freeboard dashboards
  4. Flows/Bluemix/tabletUI.json - set of flows to generate application User interface

All these flows works perfectly locally and in the cloud.Only exception is - local version will be t able to use IBM Cloudant DB as percistence layer. You will have to put all global variables in FunctionGlobalContext section of settings.js in /home/pi/.node-red. Also you will need to setup port forwarding so your instance can be accessed from outside.

Brian created schedule flow that works with blue mix monitoring - check it here:[Flows/BMeissen Sample Flows](Flows/BMeissen Sample Flows)

Additional Information

There are many excellent cloud platforms as a service; if you really like another, perhaps you contribute a "HOWTO" for installing Node-RED and Freeboard?

Freeboard

Here is the HOWTO for how to use Freeboard with Node-RED and Wink.

Useful links