Skip to content

mojojoseph/tedcosm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tedcosm is a simple Erlang application for obtaining current power consumption from a TED5000 
device and uploading it to cosm.com.  

To use tedcosm you will obviously need a TED5000 and an account on cosm.com.  After that create a 
file, tedcosm.hrl, with the following information:

-define(COSM_API_KEY, _YOUR_COSM_API_KEY_).
-define(COSM_URL, "http:https://api.cosm.com/v2/feeds/_YOUR_FEED_ID_/datastreams/_DATASTREAM_/datapoints.json").
-define(TED_URL, "http:https://_YOUR_TED_IP_/api/LiveData.xml").
-define(DEBUG, 0).
-define(UPLOAD_RATE, 3000).

Place tedcosm.hrl in the include/ directory and compile:

./rebar compile

Use rebar to generate an Erlang daemon application:

./rebar generate

To run TEDCOSM:

$ ./rel/tedcosm/bin/tedcosm start

NB:  You must first compile the source and then generate the application.  Future versions may include a Makefile to automate.

NB:  You _must_ create an include/tedcosm.hrl file with the noted constants
defined.

COSM_API_KEY - Your COSM API key, given to you at cosm.com
COSM_URL     - The URL to your feed's datastream datapoints
TED_URL      - The URL to your TED's LiveData XML stream
DEBUG        - Debugging logs on (1) or off (0)
UPLOAD_RATE  - The rate, in milliseconds, to acquire and upload power data

Feel free to e-mail questions, [email protected].  You can see my COSM feed using this software at https://cosm.com/feeds/64467.

About

Erlang process for uploading TED5000 data to COSM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages