npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-thingspeak42

v0.1.4

Published

A node that posts data to a ThingSpeak channel. Capable of aggregating multiple messages into a single mult-field post.

Downloads

120

Readme

node-red-contrib-thingspeak42

A multi-field ThingSpeak node for Node-Red

You can find source code and more information here:

  • GitHub: https://github.com/clough42/node-red-contrib-thingspeak42
  • NpmJS: https://www.npmjs.com/package/node-red-contrib-thingspeak42
  • Node-Red: http://flows.nodered.org/node/node-red-contrib-thingspeak42

ThingSpeak channels can be configured with multiple fields, but often data sources (like MQTT) only send one property per message. This causes issues when trying to populate ThingSpeak for two reasons: the data ends up being sparse, with empty field values in most records, and it's also easy to violate ThingSpeak's 15-second rate limit for channel updates.

This node solves both of these problems.

When data arrives, it is stored for a configurable period of time and then posted all at once. This allows you to use data sources that post one property at a time with multi-field ThingSpeak channels. This is especially useful with devices that use the Homie convention, which posts each property as a separate message.

Settings

  • Name - The name to display for this node. Leave blank to use the default.
  • Delay - The delay before posting data, in seconds. When the first matching message arrives, the timer is started. As subsequent messages arrive and are matched, the data is stored. When the time expires, all of the stored data is posted to ThingSpeak and the stored data is cleared. The next matching topic will start the timer again.
  • Topic 1 - The incoming message topic for channel Field 1. When a message with this topic arrives, the value of the payload is stored and the timer is started. When the timer expires, this stored value is posted as Field 1. If another message with this topic arrives before the timer expires, the stored value will be overwritten and the new value will be sent when the timer expires instead. Subsequent messages do not reset the timer. If you do not wish to publish data for Field 1, leave this configuration item blank.
  • Topic 2 - Same as above, except for channel Field 2.
  • Topic 3 - Same as above, except for channel Field 3.
  • Topic 4 - Same as above, except for channel Field 4.
  • Topic 5 - Same as above, except for channel Field 5.
  • Topic 6 - Same as above, except for channel Field 6.
  • Topic 7 - Same as above, except for channel Field 7.
  • Topic 8 - Same as above, except for channel Field 8.
  • API URL - The URL of the ThingSpeak server. If you are using the official hosted site, you can use the default: https://thingspeak.com
  • API Key - This is the Write API Key for your ThingSpeak channel. You can obtain it from the web site. (Required)

Error Handling

All errors posting data to ThingSpeak are caught and posted to the Node-Red error handler, so you can add an error handler to your flow to handle them.

Logging

The node logs when it matches a topic, stores a value and ultimately posts the data to ThingSpeak. Please note that the API key is removed from the URL and replaced with "XXXXXXXXXX" in the log messages to avoid leaking sensitive data. The real API key is used for the actual ThingSpeak transaction.

Status

While it is running, the node displays its status:

  • ready - The node is waiting for data messages to arrive.
  • data queued, waiting... - A message with a matching topic has arrived, the data is stored and the node is waiting for the timeout to expire before posting it to ThingSpeak.
  • uploading data... - The data is currently being uploaded to ThingSpeak. If everything is working, this message is displayed only briefly and may not be visible.