0.2.8 • Published 11 months ago

@mschaeffler/node-red-thermostat v0.2.8

Weekly downloads
-
License
LGPL-2.1
Repository
github
Last release
11 months ago

@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.typedescription
payloadobjectdata to control the thermostat

There are two different ways to control the thermostat:

direct control

msg.payload is a destinct value:

msg.payloadtypedescription
truebooleanstarts heating according to already set data
falsebooleanstops heating
onstringstarts heating according to already set data
offstringstops heating
1numbersets the cycle count to 1 and starts heating
2numbersets the cycle count to 2 and starts heating
3numbersets the cycle count to 3 and starts heating
4numbersets the cycle count to 4 and starts heating
5numbersets the cycle count to 5 and starts heating
0numberstops heating

control with objects

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

msg.payload.typedescription
temperaturenumberactual temperature for the closed loop control
blockbooleanblocks the heating (e.G. open window)
nominalnumbernominal temperature
factornumbermultilies the control coefficent (parameter factor) with this value
cycleTimenumbersets the cyclic time
cycleCountnumbersets the nuber of cycles

Outputs

state feedback

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

msg.typedescription
topicstringparameter topic
payloadvalue according to parameter feedback

control output

This controls the heater according to the cycles.

msg.typedescription
topicstringparameter topic
payloadbooleancontrol value to switch the heater

Parameters

configtypedescription
topicstringtopic value for the output messages
nominalnumbernominal temperature for the closed loop control
minDeltanumberactual temp must be by this value lower then the nominal to start heating
summandnumberadditional summand for the closed loop control
factornumbercontrol coefficient for the closed loop control
cycleTimenumbertime period of one heating cycle
cycleCountnumbernumber of heating cycles
feedbackstringstyle of the state feedback

feedback formats

There are four formats for the state feedback:

feedback typedescription
Booleanboolean value
"on" / "off"strings "on" or "off"
1 / 0numbers 1 or 0
cycle countnumbers cycleCount or 0

Example Flow

example flow

Author

Mathias Schäffler

License

LGPL-2.1

0.2.8

11 months ago

0.2.7

11 months ago

0.2.6

11 months ago

0.2.5

11 months ago

0.2.4

11 months ago

0.2.3

11 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago

0.0.1

11 months ago