SergiuToporjinschi / node-red-contrib-heater-controller

Heater controller for node-red dashboard
GNU General Public License v3.0
18 stars 17 forks source link
heater heater-controller node-red node-red-contrib node-red-dashboard node-red-project target-temperature

GitHub license npm version npm npm downloads GitHub repo size in bytes GitHub last commit GitHub stars GitHub watchers

Codacy Badge Maintainability Package Quality Tests Coverage Status

node-red-contrib-heater-controller

-Requirements for version 3.0.0:
-NodeJS: 16.x Minimum version 12.x
-node-red: 2.0.6 Minimum version 1.x

A dashboard ui interface node for controlling a heater;

Interface

image image

Once a custom value has been set will keep that value until the user is resetting it by double clicking the target value or by sliding it left or right, when the current calendar target value is taken from calendar.

Optimal size -> 8x5

Properties

Inputs messages

This controller has one main input and two outputs;

The input accepts the following topics:

Topic: status

Triggers an status message on second output(Info) and no message on first output(Heater status) Input example

{
    "topic" : "status"
}

Output on info example

{
  "topic":"status", --same input topic
  "payload":{
    "currentTemp": 10, --current room temperature (ref no.2)
    "targetValue": 20, --current target temperature (ref no.1)
    "isUserCustom": false, --is a current target user temperature considered (ref no.1 and 9)
    "isLocked": false,  --is locked to a custom target value (ref no.8)
    "userTargetValue": 20, --last user target temperature (ref no.1)
    "currentSchedule": { --current schedule from calendar (ref no.5)
      "time": "08:00",
      "day": "Saturday",
      "temp": 20
    },
    "nextSchedule": { --next schedule from calendar (ref no.6)
      "time": "20:00",
      "day": "Saturday",
      "temp": 22
    },
    "currentHeaterStatus": "on", --current heater status (ref no.3)
    "time":"9/4/2021, 1:47:27 PM"
  }
}

Topic: logs

Triggers a message which contains the logs of the latest action. The array length is depending on the Log: Max length from node properties Input example

{
    "topic" : "logs"
}

Output on info example

{
  "topic":"logs",  --same input topic
  "payload":[ --an array with the last actions
    {
      "currentTemp": 10,
      "targetValue": 20,
      "currentSchedule": {
        "time": "08:00",
        "day": "Saturday",
        "temp": 20
      },
      "nextSchedule": {
        "time": "20:00",
        "day": "Saturday",
        "temp": 22
      },
      "currentHeaterStatus": "on", --heater status when the action was triggered (ref no.3)
      "time":"9/4/2021, 1:47:27 PM" --execution time
    }
  ]
}

Topic: config

Triggers a message which contains the current node properties Input example

{
    "topic" : "config"
}

Output on info example

{
  "topic":"config",
  "payload":{
    "title":"Heater",
    "topic":"newHeaterStatus",
    "logLength":1,
    "threshold":0.5,
    "calendar":{
      "Monday":{"00:00":19,"06:20":22,"08:00":19,"16:40":22,"23:59":19},
      "Tuesday":{"00:00":19,"06:20":22,"08:00":19,"16:40":22,"23:59":19},
      "Wednesday":{"00:00":19,"06:20":22,"08:00":19,"16:40":22,"23:59":19},
      "Thursday":{"00:00":19,"06:20":22,"08:00":19,"16:40":22,"23:59":19},
      "Friday":{"00:00":19,"06:20":23,"08:00":19,"16:40":22,"23:59":19},
      "Saturday":{"00:00":19,"08:00":20,"20:00":22,"23:59":19},
      "Sunday":{"00:00":19,"08:00":20,"20:00":22,"23:59":19}
    },
    "unit":"C",
    "displayMode":"buttons",
    "sliderMaxValue":35,
    "sliderMinValue":10,
    "sliderStep":0.5
  }
}

Topic: currentTemp

A message with this topic should come from time to time, containing a payload with an integer or float number (integer or float number); The payload value should represent the current room/boiler temperature; Each time currentTemp message is received the entire logic is executed to decide if is the case to trigger an out put with on or off status for starting the heater.

NOTE: If this message is not received then no logic is executed and the entire control will remain in current state.

{
    "topic" : "currentTemp",
    "payload" : 22.5
}

Topic: userConfig

Can be used to control the node with an input message. Basically almost all actions that user can do from dashboard should be possible with this message. Payload should be an json structure with the following options

{
    "topic" : "userConfig",
    "payload" : {"isLocked": true}
}
{
    "topic" : "userConfig",
    "payload" : {"userTargetValue": 20.0}
}
{
    "topic" : "userConfig",
    "payload" : {"isUserCustom": true}
}

HeaterStatus output

A message is emitted when the status is recalculated (when the user is changing the target temperature, from interface or with a userConfig message, or a new currentTemp is received)

Example:

{
    "topic" : "newHeaterStatus", //topic set in node properties
    "payload" : "on"
}

Context tab

In context tab for this node two variables are displayed

ChangeLog

Testing schema

If you find this project useful, please consider supporting it with a donation
Donate