Thingspeak node?

1,297 views
Skip to first unread message

naesk

unread,
Feb 13, 2015, 10:39:15 PM2/13/15
to node...@googlegroups.com
Is there a NR node for Thingspeak available?

I notice there is a nodejs client available https://www.npmjs.com/packages/thingspeakclient

Dan

unread,
Feb 14, 2015, 9:24:56 PM2/14/15
to node...@googlegroups.com
I would be interested too.

Ra Wa

unread,
Feb 19, 2015, 6:31:00 PM2/19/15
to node...@googlegroups.com
I was able to post data to Thingspeak using a plain HTTP request  (you can even update with a GET) but I guess a nice drag and drop block might be nice.

Dan

unread,
Feb 20, 2015, 3:22:55 AM2/20/15
to node...@googlegroups.com
Would you mind sharing the json with us?
Thanks
Dan
Message has been deleted
Message has been deleted

Ra Wa

unread,
Feb 21, 2015, 9:15:56 PM2/21/15
to node...@googlegroups.com
Code below is from a function block, feeding into a black http request GET block
(Does anyone know how to store API keys in some way that I dont have to remember to delete them when posting code?)

// input payload is
//[ 18.9, 23.7, 25.4, 35.6, 25.6, 14.3, 18.6, 31.7, '28 1:7' ]
//[Sydney,Melb,Bris,Perth,Adel,Hobart,Canb,Darwin,date/time]
// therefore Adelaide is [4]
context.last = context.last || -999
var temp=msg.payload[4]
// get a free account at thingspeak.com
// create a channel and copy the Write API key to below
var API_KEY="YOUR_WRITE_KEY"
var url="https://api.thingspeak.com/update?key="+API_KEY+"&field1="+temp
var newMsg={url:url, payload:temp};  // payload not need, good for debugging
if (context.last == temp) {
  return null  // dont post if value hasnt changed
} else {
  context.last=temp
  return newMsg
};

for full docco see http://community.thingspeak.com/documentation/api/

The ThingBox

unread,
Feb 25, 2015, 3:18:58 PM2/25/15
to node...@googlegroups.com
Sorry for the late answer. Here is the node from the Thingbox (included zip)
thingspeak.zip

JR01

unread,
Feb 28, 2016, 12:57:00 PM2/28/16
to Node-RED
Hi Thingbox, newbie here, what does one do to this folder you posted, can one add it to node-red server? How does one do that? (Raspberry with Raspbian)

Mark Setrem

unread,
Feb 28, 2016, 3:26:47 PM2/28/16
to Node-RED

You need to copy the files in the zip file into a directory called "nodes" within your .node-red directory and unzip them

You'll then need to install the npm package that it requires with "npm install request" from within the thingspeak directory.
(this needs to end up in a "node_modules" directory within the thingspeak directory - you'll need to check that it puts them in the right place and if not move them to where it needs to be)

Having done that if you run node-red-stop and the restart node-red the thingspeak node should appear.

( I'm not Thingbox, but they've gone very quiet so hopefully this is enough to get you going...)

The ThingBox

unread,
Mar 1, 2016, 11:16:41 AM3/1/16
to Node-RED

Thanks Mark.


Now that we have integrated GitHub to our production process, we are able to use Github as a source repository.
We'll use it for non-thingbox specific nodes.

Nicolas.

On Sunday, February 28, 2016 at 9:26:47 PM UTC+1, Mark Setrem wrote:


Marko S

unread,
Mar 2, 2016, 3:22:25 PM3/2/16
to Node-RED
TheThingBox, what about your other nodes on the github. Are they all compatible with stock node-red?

Dne torek, 01. marec 2016 17.16.41 UTC+1 je oseba The ThingBox napisala:

The ThingBox

unread,
Mar 4, 2016, 5:18:21 AM3/4/16
to Node-RED

TheThingBox, what about your other nodes on the github. Are they all compatible with stock node-red?


For each node, we'll write in theReadME if the node is compatible with stock NodeRED or not.

For your information, TheThingbox.io is a Node-RED fork on Raspberry Pi aimed at providing a seamless experience of NodeRED for non programmers. Unfortunately, this implies NoderRED modifications. For instance, when pressing the learn button on a ZWave or EnOcean device, a related node automatically appears on the workspace. Very simple to use, but it was not possible to provide this user experience with stock Node-RED. As much as possible we try to fork as less as possible.
Look a demo here (using TimeSquAir, a eady to use Thingbox): https://www.youtube.com/watch?v=Br343lrNKuM

Mark Setrem

unread,
Mar 4, 2016, 6:30:43 AM3/4/16
to Node-RED
Perhaps for these nodes you shouldn't include the keyword "node-red" in the pull request if they aren't compatible, they wouldn't then get picked up by flows.node-red.org.

Alternatively couldn't you discuss with IBM about a pull request to add this functionality back into the core Node-Red? After all Node-Red is open source and they do accept contributions.

Nicholas O'Leary

unread,
Mar 4, 2016, 6:38:48 AM3/4/16
to Node-RED Mailing List
Mark,

we've had this conversation with them already - they'll remove the node-red keyword from the thingbox-specific nodes and once that's done, we can remove them from the flow library (which will be a manual step for me to do at some point).

As for contributions... the door is always open for those discussions, but I appreciate not all changes are suitable for contribution. In those cases, we would be interested to know whether we can make it easier for them to be made in a way that doesn't involve modifying node-red itself. We've already added various plugin points for certain types of customisations - are there others we could look at?

Nick

On 4 March 2016 at 11:30, Mark Setrem <mse...@gmail.com> wrote:
Perhaps for these nodes you shouldn't include the keyword "node-red" in the pull request if they aren't compatible, they wouldn't then get picked up by flows.node-red.org.

Alternatively couldn't you discuss with IBM about a pull request to add this functionality back into the core Node-Red?  After all Node-Red is open source and they do accept contributions.

--
http://nodered.org

Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.

Marko S

unread,
Mar 4, 2016, 11:47:04 AM3/4/16
to Node-RED
So Thethingbox, can you maybe just write down which ones are specific and which ones are compatible with stock. For example besides the thingspeak one, what about the xively one? And what about the sound one?

Dne petek, 04. marec 2016 11.18.21 UTC+1 je oseba The ThingBox napisala:

Dave C-J

unread,
Mar 4, 2016, 12:21:49 PM3/4/16
to node...@googlegroups.com
Marko,
as oer Nick's comment - they are working on it now. So will un-tag any non-Node-RED ones... once they do that we will clean/re-build the flows library.

hunny

unread,
Mar 8, 2017, 8:16:21 AM3/8/17
to Node-RED
Hello. I am trying to upload field on thingspeak by a sensor data through node.js. But its not updating that field. Can you help me? Here is the code

var serialport = require('serialport');
var portName = 'COM6';

var sp = new serialport.SerialPort(portName, {
    baudRate: 9600,
    dataBits: 8,
    parity: 'none',
    stopBits: 1,
    flowControl: false,
    parser: serialport.parsers.readline("\r\n")

});





var ThingSpeakClient = require('thingspeakclient');
var client = new ThingSpeakClient();

var client = new ThingSpeakClient({server:'http://localhost:8000'});

var client = new ThingSpeakClient({useTimeoutMode:false}); 
var client = new ThingSpeakClient({updateTimeout:20000}); 

client.attachChannel(236714, { writeKey:'R3PQDN70JGRYVWYI'});
sp.on('data', function(input)
{
client.updateChannel(236714, {field1: input, field2: 29}, function(err, resp) {
    if (!err && resp > 0) {
        console.log('update successfully. Entry number was: ' + resp);
    }

});
Reply all
Reply to author
Forward
0 new messages