Node-red-contrib-simple-thermostat

Trying to set up a simple temperature control using teh node-red-contrib-simple-thermostat.
Problem: I'm unable to set the target temp by a message. Messages with topic "target" have been ignored.
Has someone a hint?

Looking at the source code you should be setting msg.target

Tbh, it looks like all this node does is compare 2 values& returns on or off. Tbh, I wouldn't bother. Just DIY it with a function node or a switch node and change node.

As noted that node just does a straight comparison, but any measurement has some noise on it so the result is that when very close to the setpoint it will switch the power on and off rapidly which is not good. Have a look at node-red-contrib-ramp-thermostat instead which allows you to specify a hysteresis value. It also provides a ramp feature but you can just ignore that if you don't need it.

If you want really good control then have a look at node-red-contrib-pid, though I am biased in this, as I wrote it. Even if you think you might do that eventually, get it all working with the thermostat first.

Steve, Colin
thanks for the reply.
DIY I wanted to avoid ; don't invent the wheel ...
I hesitated before the node-red-contrib-ramp-thermostat, bu was a good tip. It seemed too complicated at first sight. But through the good doc, he now does what he should.
Control loop oscillations I did not expect, there are ways to avoid it away from sophisticated PID stuff.

1 Like

@gnulp as you become more proficient with node-red you get a sense for when to and when not to install contrib nodes.

I understand your point about not re-inventing the wheel but my point was that particular node was a re-invented wheel - and you were using the re-invented wheel - so I was really suggesting you use the original wheel if all you wanted to do was compare 2 values :slight_smile:

That original node may as well be called "node-red-contrib-compare-two-numbers".

As for the one you went with in the end, that is understandably packaged as a contrib node as it is more advanced than a 2 number compare.

Happy you are sorted.

Control with a simple thermostat will always oscillate. The cause is that when the temperature reaches the setpoint the power will switch off, but there is always energy stored in the system (in radiators for example) so the temperature continues to rise for a while even though the power is off. Then the temperature starts falling and when it gets back to the setpoint the power comes on, but then it takes time to heat up the system again and start heating. During that time the temperature keeps falling. Then as the power comes in it starts going up again and the cycle repeats. You can minimise this by sampling the temperature as rapidly as possible so that at least you switch the power at the earliest moment. Also set the hysteresis (dead band) as small as possible such that you don't get noise induced on/off action as it crosses the setpoint. If you are using something like a DS18B20 you can probably get away with something like 0.25 degrees C hysteresis. Maybe even lower. Also make sure you don't put anything in the flow that rounds the value to a particular number of digits before you get to the thermostat. If you want to round it then do that when you display it.
Room thermostats improve this a bit by including a small resistor inside the housing which slightly heats the sensor when the power is on. This adds a crude Proportional term (the P in PID) which is moderately effective. Using PID I am able to control room temperatures to well within 0.25 C steady state.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.