2015-01-04 21:34:12 +01:00
node-red-node-emoncms
=====================
2018-01-07 16:37:28 +01:00
A < a href = "http://nodered.org" target = "_new" > Node-RED< / a > node to send fetch/post data to/from < a href = "http://emoncms.org" target = "_new" > emoncms.org< / a > , local emoncms server or any other emoncms server.
2015-01-04 21:34:12 +01:00
Install
-------
2016-03-02 14:26:19 +01:00
Run the following command in your Node-RED user directory - typically `~/.node-red`
2015-01-04 21:34:12 +01:00
npm install node-red-node-emoncms
Usage
-----
2018-01-07 16:37:28 +01:00
### Emoncms post:
#### Preferred Data Type
The API now accepts a validated JSON object for the name value pairs. This is the preferred data type.
#### Legacy Data Type Support
The original input API for emoncms used a URI in the format `post.json?` . If the data type of legacy is selected, the `msg.payload` can contain:
A comma separated list of name value pairs, e.g.
2015-01-04 21:34:12 +01:00
2018-01-07 16:37:28 +01:00
name:value,...
2015-01-04 21:34:12 +01:00
2018-01-07 16:37:28 +01:00
A comma separated list of values (CSV), e.g.
2015-01-04 21:34:12 +01:00
2018-01-07 16:37:28 +01:00
1,2,..
2015-01-04 21:34:12 +01:00
2018-01-07 16:37:28 +01:00
A simple javascript object (note no quotes) e.g.
2015-01-04 21:34:12 +01:00
2018-01-07 16:37:28 +01:00
{temp:12, humidity:56};
2015-01-04 21:34:12 +01:00
2018-01-07 16:37:28 +01:00
#### Node
If *Node* is left blank `msg.nodegroup` will be used (if set). A *Node* must be set or the flow will fail.
2015-01-04 21:34:12 +01:00
2018-01-07 16:37:28 +01:00
#### msg.time
Insertion time can be manipulated by setting `msg.time` . This can be an ISO format date/time or a number of seconds in epoch format - i.e. seconds since 1970. If no time is set time now is set by emoncms.
2015-12-09 14:21:42 +01:00
2018-01-07 16:37:28 +01:00
#### Status
The flow will indicate if the node has successfully called the API. This is not a guarantee the data has been inserted to emoncms.
2015-10-21 13:08:30 +02:00
### Emoncms In:
2015-12-09 14:21:42 +01:00
Fetches last emoncms feed value, returns a numerical value.