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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mschaeffler/node-red-thermostat

v1.0.0

Published

A Node Red node to control an (electric) heater

Downloads

199

Readme

@mschaeffler/node-red-thermostat

A Node Red node to control an (electric) heater.

image of example flow

Install

$ npm install @mschaeffler/node-red-thermostat

Closed Loop Control

A heating device that just can be switched on and off, can be closed loop controlled:

closed loop control

The on / off cycles are done like this:

cycle state

The on time is calculated in this way:

formula

with this values |value |description | |:------|:---------------| |t_on |time of on cycle| |T_nom |nominal Temperature, parameter nominal| |T_act |actual temperature, msg.payload.temperature| |s |minimal Delta, parameter summand| |f_cycle|$1.4$ for the 1st cycle, $1.2$ for the 2nd, then $1$| |f_msg |control coefficient, msg.payload.factor| |f_node |control coefficient, parameter factor| |t_cycle|time of complete cycle, parameter cycleTime|

Input

|msg. | type | description | |:-------|:-------|:----------------------------------| |payload | object | data to control the thermostat |

There are two different ways to control the thermostat:

direct control

msg.payload is a destinct value:

|msg.payload| type | description | |:------|:------|:------------| |true |boolean| starts heating according to already set data | |false|boolean| stops heating | |on |string | starts heating according to already set data | |off |string | stops heating | |1 |number | sets the cycle count to 1 and starts heating | |2 |number | sets the cycle count to 2 and starts heating | |3 |number | sets the cycle count to 3 and starts heating | |4 |number | sets the cycle count to 4 and starts heating | |5 |number | sets the cycle count to 5 and starts heating | |0 |number | stops heating |

control with objects

msg.payload is an object with at least one of these members:

|msg.payload.| type | description | |:------|:------|:------------| |temperature|number | actual temperature for the closed loop control | |block|boolean| blocks the heating (e.G. open window)| |nominal|number | nominal temperature | |factor|number |multilies the control coefficent (parameter factor) with this value | |cycleTime|number | sets the cyclic time | |cycleCount|number | sets the nuber of cycles |

Outputs

state feedback

This is the general feedback: heating is on or off.

|msg. | type | description | |:-------|:-------|:----------------------------------| |topic | string | parameter topic| |payload | | value according to parameter feedback|

control output

This controls the heater according to the cycles.

|msg. | type | description | |:-------|:-------|:----------------------------------| |topic | string | parameter topic| |payload |boolean | control value to switch the heater|

Parameters

|config | type | description | |:---------|:-------|:----------------------------------| |topic | string | topic value for the output messages | |nominal | number | nominal temperature for the closed loop control | |minDelta | number | actual temp must be by this value lower then the nominal to start heating | |summand | number | additional summand for the closed loop control | |factor | number | control coefficient for the closed loop control | |cycleTime | number | time period of one heating cycle | |cycleCount| number | number of heating cycles | |feedback | string | style of the state feedback |

feedback formats

There are four formats for the state feedback:

|feedback type| description | |:------------|:----------------------------------| |Boolean | boolean value | |"on" / "off" | strings "on" or "off" | |1 / 0 | numbers 1 or 0 | |cycle count | numbers cycleCount or 0 |

Example Flow

example flow

Author

Mathias Schäffler

License

LGPL-2.1