Code Monkey home page Code Monkey logo

node-currentcost's Introduction

Currentcost Driver for Node.js

node-currentcost provides an easy way to pull data from current cost home energy devices. For more information about CurrentCost devices go to: http://www.currentcost.com

This driver currently depends on a python serial library in order to provide compatibility across multiple flavors of Unix (Linux, OSX, BSD)

API

The api is very simple. It consists of a single EventEmitter that can notify of 2 types of events:

Incremental Events ('incremental')

These notifications come roughly once every 3 seconds. The data for incremental updates looks like this:

	{ src: 'CC128-v0.15'
	, dsb: 2
	, time: '10:02:03'
	, tmprf: 77.2
	, sensor: 0
	, id: 1123
	, type: 1
	, ch1: { watts: 447 }
	, ch2: { watts: 384 }
	}

History Events ('history')

These notifications come 1 minute past every odd hour that contains details of historical energy usage. The data for incremental updates looks like this:

	{ src: 'CC128-v0.15'
	, dsb: 2
	, time: '10:02:03'
	, hist: 
	   { dsw: 26
	   , type: 1
	   , units: 'kwhr'
	   , data: [ { sensor: 0
		    , h024: 1.1
		    , h022: 0.9
		    , h020: 0.3
		    , h018: 0.4
		    }
		    , { sensor: 1
		    , units: 'kwhr'
		    , h024: 0
		    , h022: 0
		    , h020: 0
		    , h018: 0
		    }
		  ]
	   }
	}

For more information about the Currentcost data schema see the products data specification (http://www.currentcost.com/cc128/xml.htm). All information in this driver is provided in JSON format, but the Currentcost data spec refers to the schema in its xml form: http://www.currentcost.com/cc128/xml.htm

node-currentcost's People

Contributors

robrighter avatar

Watchers

Antony Jones avatar James Cloos avatar  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.