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-ds18b20-sensor

v1.3.6

Published

Node-red node to connect DS18B20 sensors

Downloads

204

Readme

node-red-contrib-ds18b20-sensor

This is a Node Red node to manage connection to DS18B20 sensors on a Raspberry Pi, searching all available directories. For each sensor found, it returns the msg object where the topic is set to the sensor ID and the payload is set to the temperature. If the node's topic is set to a device ID, or a device ID is passed into the node as msg.topic, this is used to return a single reading for the specified sensor. If the Array checkbox is checked or msg.array is set to true, the value(s) are returned as an array in msg.payload. The current timestamp is always set as msg.timestamp.

A simple flow is to click on an input node to inject an empty message to the sensor node and capture the output in a debug node:

Node-RED flow

Clicking on the input node causes the values from all available temperature sensors to be returned as a series of messages:

Message list

If the Array checkbox is checked this will cause the return of data as an array, i.e. the function of this checkbox is to force a single value into an array:

Edit dialog

If you provide an empty topic value, this indicates that you want the data associated with all devices returned. If the array checkbox is selected, they are in a single message as an array in the payload:

[ { "family": "28", "id": "71EEFA050000", "file": "28-000005faee71", "temp": 15.062 }, { "family": "28", "id": "8D85FB050000", "file": "28-000005fb858d", "temp": 16.75 }, { "family": "28", "id": "BD27FB050000", "file": "28-000005fb27bd", "temp": 85 }, { "family": "28", "id": "1BE4FA050000", "file": "28-000005fae41b", "temp": 15.812 }, { "family": "28", "id": "678C8B060000", "file": "28-0000068b8c67", "temp": 16.937 } ]

However, if the checkbox is not checked, the values are returned as a series of individual messages, one per sensor, where the payload is set to the temperature value. In this case, the topic contains the ID of the sensor:

{ "_msgid":"dd456bcd.22ba98", "topic":"71EEFA050000", "payload":30.875, "timestamp":1490739050565, "file":"28-000005faee71", "dir":"w1_bus_master1", "family":"28" }

In both cases, the timestamp of the reading is set in the message.

Now, if the input node is clicked again, this time the data are returned as an array:

Message array

By default, this node targets DS18B20 sensors, but you can also use it to capture data from other similar sensors. This reads the list of all available sensors using the Dallas One-Wire Protocol, and retrieves the temperature from those sensors that provide a temperature value.

The node is added to the Raspberry Pi section.