Heater controller for node-red dashboard
-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;
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
This controller has one main input and two outputs;
The input accepts the following topics:
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"
}
}
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
}
]
}
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
}
}
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
}
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}
}
currentTemp
value is below userTargetValue
, a trigger to start the heater will be emitted; if the currentTemp is bigger than userTargetValue the
{
"topic" : "userConfig",
"payload" : {"userTargetValue": 20.0}
}
isUserCustom
is true then the current target value is preserved until next calendar or user intervention.
{
"topic" : "userConfig",
"payload" : {"isUserCustom": true}
}
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"
}
In context tab for this node two variables are displayed
logs
containing the current stored logsstatus
current node statusIf you find this project useful, please consider supporting it with a donation