Node-Red temperature control

2,688 views
Skip to first unread message

Bart Butenaers

unread,
Dec 27, 2017, 9:58:57 AM12/27/17
to Node-RED
Hi everybody,

One of my good intentions for 2018 is to automate my central heating system at home, as a result of a large amount of feedback I got from my wife about this topic ...

So I had a look at the node-red-contrib-ramp-temperature, which looks very nice.  It allows me to setup a series of profiles, where each profile is a list of 10 points (specifying the desired room temperature for that day).  For example:

The red dots are key pairs (time / temperature) that can be specified in the node's config screen.  

The node will try to have the room temperature following this graph, by controlling the heat pump.


If I should be a bachelor, this would all be perfect.  However since I have been married, things will likely become a little more complicated...
This means that 'we' would like that our Node-Red system predicts the room temperature based on a series of input parameters:
  • An outdoor temperature sensor
  • The temperature history of that room
  • ...
I assume that I will need artificial intelligence, machine learning, neural networks, ...  To be honest, not my cup of tea ;-(
Is that correct?  And does anybody can give me some tips on how a dummy like me can achieve something like this.  

Have been searching around the web, but didn't find something (open source libraries).  Probably searching with the wrong keywords.

Thanks a lot,
Bart Butenaers

Dean Cording

unread,
Dec 27, 2017, 11:16:11 PM12/27/17
to Node-RED
Can I point you in the direction of node-red-contrib-comfort - it calculates the perceived comfort level (cold, cool, neutral, warm, hot) of an environment based on temperature, humidity, wind-speed (draft), clothing and activity levels.   It wouldn't be too hard to create a feedback mechanism that adjusted the temperature to maintain a comfort level that suited your current level of activity (sleeping, relaxing, cooking, cleaning, working) and clothing level (summer, winter, sleepwear, nude).

If you wanted it to be smart, then you could use various sensors to detect the amount of activity occurring (movement, noise, lights) and use that as the driving input. 


Dean

Colin Law

unread,
Dec 28, 2017, 9:01:14 AM12/28/17
to node...@googlegroups.com
Dean, that is very interesting.
What have you done about Mean Radiant Temperature in your model?  I don't see it in the inputs.

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/2a5ae60b-4ffc-4904-b13d-443e932bc494%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dean Cording

unread,
Dec 28, 2017, 9:26:26 AM12/28/17
to Node-RED
Mean Radiant Temperature is set the same as Air Temperature on the simplifying assumption that that the measurement is for an insulated/sheltered space such as a modern home or office.    


On Friday, 29 December 2017 00:01:14 UTC+10, Colin Law wrote:
Dean, that is very interesting.
What have you done about Mean Radiant Temperature in your model?  I don't see it in the inputs.

Colin
On 28 December 2017 at 04:16, Dean Cording <dean+...@cording.id.au> wrote:
Can I point you in the direction of node-red-contrib-comfort - it calculates the perceived comfort level (cold, cool, neutral, warm, hot) of an environment based on temperature, humidity, wind-speed (draft), clothing and activity levels.   It wouldn't be too hard to create a feedback mechanism that adjusted the temperature to maintain a comfort level that suited your current level of activity (sleeping, relaxing, cooking, cleaning, working) and clothing level (summer, winter, sleepwear, nude).

If you wanted it to be smart, then you could use various sensors to detect the amount of activity occurring (movement, noise, lights) and use that as the driving input. 


Dean

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Colin Law

unread,
Dec 28, 2017, 9:32:44 AM12/28/17
to node...@googlegroups.com
I think that is a gross oversimplification for many rooms in a typical home. External walls will rarely be at room temperature, and if wall radiators are fitted then the radiant effect from these needs to be taken into account. Also with underfloor heating the temperature of the floor can be well above air temperature.

Colin

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Dean Cording

unread,
Dec 28, 2017, 10:09:41 AM12/28/17
to Node-RED
Well, technically yes but in reality not really. Typical temperature sensors in use in home systems essentially measure operative temperature. The model itself is fairly vague in that it only predicts what the majority of people would feel, is quite subjective, and assumes everyone is wearing the same amount of clothing and peeforming the same activity.

For a home system, the model would be quite usable for controlling a HVAC system if a calibration factor was included to account for the physical characteristics of the location as well as personal preferences.

Colin Law

unread,
Dec 28, 2017, 10:22:58 AM12/28/17
to node...@googlegroups.com
In reality, no. I speak from personal experience. I am controlling rooms with underfloor heating (under ceramic tiles) and I measure the temperature of the floor. To get a similar feeling in the room I have to drop the measured air temperature setpoint by 0.75 degrees when the floor is warm. I control the air temperature typically within 0.15C of the setpoint.  Other rooms are heated by wall radiators and again I measure the temperature of the radiators and adjust the temperature down when they are hot.

The fact that the model only predicts what the majority of people feel is not relevant. If it were used in a closed loop to control the heating system then there would be a control to adjust what the individual user considered comfortable (a comfistat?) so he/she would adjust it as required and the system would adjust the heating accordingly.

Colin

On 28 December 2017 at 15:09, Dean Cording <dean+...@cording.id.au> wrote:
Well, technically yes but in reality not really.  Typical temperature sensors in use in home systems essentially measure operative temperature.  The model itself is fairly vague in that it only predicts what the majority of people would feel, is quite subjective, and assumes everyone is wearing the same amount of clothing and peeforming the same activity.

For a home system, the model would be quite usable for controlling a HVAC system if a calibration factor was included to account for the physical characteristics of the location as well as personal preferences.
--
http://nodered.org

Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.

Dave C-J

unread,
Dec 28, 2017, 10:30:52 AM12/28/17
to node...@googlegroups.com
Luckily Dean published the source so it could be extended if you wish. Sadly he made it gpl2 license so I'm not allowed to touch it. 
--
Sent from phone.

Colin Law

unread,
Dec 28, 2017, 10:45:05 AM12/28/17
to node...@googlegroups.com
Since I believe it is based on [1] (or at least that is referenced in the readme) and that is GPL2 he probably didn't have much choice.

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.

Dave C-J

unread,
Dec 28, 2017, 10:47:26 AM12/28/17
to node...@googlegroups.com
Yeah , not a problem for some. Just for me and a few others. 
--
Sent from phone.

Bart Butenaers

unread,
Dec 28, 2017, 2:28:47 PM12/28/17
to Node-RED
Hi guys,

Thanks for joining this discussion !  
At the moment I have very little knowledge about temperature control, so I have some questions about your feedback:
  • 1) I thought that I had to select somewhere in my dashboard a target temperature (= which is called the setpoint) for each room, but if I understand correctly I have to apply instead 6 input parameters:

The first 3 parameters could be measured by the system, but the next 3 parameters should be specified manually on the dashboard.  Is that correct?  So I have to specify somewhere the metabolic rate (i.e. what I'm currently doing e.g. eating, working, ...),  the clothing level (e.g. long pyjama, short pyjama, ...) and the comfort (e.g. hot, warm, cool, ...).  Is that a standard setup in a rich-men's domotica system?  I can understand that you specify a comfort instead of a target temperature, but I tink that I'm too old fashioned to discuss with my dashboard about what I'm wearing ;-)

  •  2) This is the first time I hear about Mean Radiant Temperature.  Thought only the air temperature was relevant.  If I understand correctly, the MRT is the average temperature of the surfaces that surround a particular point, and which will exchange thermal radiation to that point. 

I agree that the MRT is important for the thermal comfort: all surfaces in the room exchange thermal radiation with their surroundings (depending on their surface temperature and emissivity).  For example when I'm near a large window, it feels very cold in the winter.  But I don't understand how we can use that here, since I read somewhere that it is very hard to calculate this.  And to me it looks like this depends on your position in the room: if person A sits near the cold window, and person B at the other side of the room.  In that case both persons feel a completely different MRT.  So how can I use that if I have e.g. 1 radiator in the room?

Suppose that in a lot of cases Dean's simplification can be sufficient, to use the air temperature as MRT.  Or not ? 
  • 3) And I also have to introduce an adjustment factor, because the heat source itself (e.g. underfloor heating) could be much hotter than the air temperature.  This is again something that I don't really understand.  I understand this is necessary when you measure the air temperature near the heat source, like with a thermostatic radiator valve:

However I don't want thermostatic valves anymore at each radiator, but I want a single temperature sensor in the MIDDLE of the room against the wall (far away from the heat sources).  So I'm measuring the air temperature (in the middle of the room), instead of the temperature of ALL the heat sources.  Or is my setup not good ?

I appreciate all the feedback !!

Bart

Colin Law

unread,
Dec 28, 2017, 4:06:41 PM12/28/17
to node...@googlegroups.com
Hi Bart

The discussion has become rather esoteric and concerned with rather more sophisticated control than most people want or need. Most are indeed perfectly happy just with controlling the room temperature to a user adjustable value (setpoint, meaning a point which can be set) which can be tweaked up or down a little as the user likes.  So yes, measure the temperature away from heat sources and then you must decide how to control the heat input.  What sort of heating is it and how can you control the heat input to that room?

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Dean Cording

unread,
Dec 28, 2017, 6:33:09 PM12/28/17
to Node-RED
The climate model library I am using from University of California is GPL2 and my code is just a wrapper around that.  In any case, I'm happy to make changes.

The library handles both ambient/radiant and operative temperatures  - I just used the operative temperature because I only had one temperature sensor to work with.  Measuring radiant temperature needs something like a globe thermometer to get an estimation and varies from place to place in a room.  Potentially you could use a non-contact IR thermometer but you would need to scan the room.  If you are going to measure radiant temperature then you need to ensure that your air temperature sensor isn't affected by radiant heat.  And if you are going to that much trouble you should also start measuring actual air speed in the environment. Very quickly you end up building a full weather station inside your house just to control the HVAC. 

For most intents and purposes, operative temperature is an adequate measure.



Stephen Mann

unread,
Dec 28, 2017, 6:47:18 PM12/28/17
to Node-RED
My wife is a biologist and even her lab isn't controlled to that level.
I do think that Bart is overthinking the problem.
Bart, the factors you are measuring are insignificant to the granularity of the heat-pump or furnace control or the comfort level of the people in the room.  I.E., it's lost in the hysteresis  If you try to force the heat-pump or furnace to close-tolerances, you could damage the system.  For example, if you have a set point of 70-degrees (f), and the furnace kicks in at 69-degrees, and off at 71, then it's going to be cycling on and off continuously. That is why every HVAC has hysteresis built into the controls.  In my home system, if the set point is 70-degrees, it won't come on until the room temperature drops to 68, and it won't stop until it reaches 72.

A truly smart system would simply look for people in the room in addition to the ambient temperature.  No people, lower the set point, etc.  What difference does the outside temperature make?  You still want the inside temperature at a comfortable level regardless how cold it is outside.

Steve Mann

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Dean Cording

unread,
Dec 28, 2017, 7:37:36 PM12/28/17
to Node-RED
Hi Bart,

As Colin says, the discussion has gotten into the theoretical vs practical aspects of climate control - it's still a bit of a black art area of work.

  • 1) I thought that I had to select somewhere in my dashboard a target temperature (= which is called the setpoint) for each room, but if I understand correctly I have to apply instead 6 input parameters:



Yes, well maybe.  

Firstly, comfort property is the output - it is the value calculated from the other parameters and the setting is where that value is recorded - it can be added to the message or stored in the flow/global context.

The comfort model works on the basis that there a range of combinations of the five parameters where you will feel comfortable - outside of that range you will feel cool or warm to different degrees.  For example, you will feel comfortable in a hot room if there is sufficient air flow (such as a fan) or in a cold room if you are rugged up and being active.  The model produces a number between -3 (cold) to 3 (hot) that indicates the comfort level (with 0 being neutral).  Your system can use this number to drive the factors under its control.  In most cases, this will be temperature, so if the model says the comfort factor is 'cool' then apply heat until it is back in the 'neutral' range.  So the 'setpoint' temperature can and will vary according to other conditions.

As an interesting thought experiment, instead of controlling the temperature, the comfort module could also be used to suggest what level of clothing you should be wearing.
 

The first 3 parameters could be measured by the system, but the next 3 parameters should be specified manually on the dashboard.  Is that correct? 

So I have to specify somewhere the metabolic rate (i.e. what I'm currently doing e.g. eating, working, ...),  the clothing level (e.g. long pyjama, short pyjama, ...) and the comfort (e.g. hot, warm, cool, ...).  Is that a standard setup in a rich-men's domotica system?  I can understand that you specify a comfort instead of a target temperature, but I tink that I'm too old fashioned to discuss with my dashboard about what I'm wearing ;-)



For most people, they tend to follow very set routines of activity and dress.  We all wear summer clothes during summer and winter clothes during winter, with a gradual transition between the two.  Even during the day, we wear pyjamas at night (plus bedding after bed time), nude at bath time, sports clothes during active times, work clothes during work time.  Likewise for activity - we sleep at night, have a peak of activity during the day, and relax during the evening.  All of this can be modelled using a simply time based model.  Remember, these are just numbers so a simply time based calculation with both a daily period and a seasonal period would suffice.  (Hmm, sounds like an idea for another node...) 
 
  •  2) This is the first time I hear about Mean Radiant Temperature.  Thought only the air temperature was relevant.  If I understand correctly, the MRT is the average temperature of the surfaces that surround a particular point, and which will exchange thermal radiation to that point. 

I agree that the MRT is important for the thermal comfort: all surfaces in the room exchange thermal radiation with their surroundings (depending on their surface temperature and emissivity).  For example when I'm near a large window, it feels very cold in the winter.  But I don't understand how we can use that here, since I read somewhere that it is very hard to calculate this.  And to me it looks like this depends on your position in the room: if person A sits near the cold window, and person B at the other side of the room.  In that case both persons feel a completely different MRT.  So how can I use that if I have e.g. 1 radiator in the room?

Suppose that in a lot of cases Dean's simplification can be sufficient, to use the air temperature as MRT.  Or not ?

As we have been discussing, yes MRT is important but it adds a lot of complexity.  A standard thermostat or temperature reads closer to operative temperature because it is affected by both air temperature and radiant temperature.  To measure MRT and air temperature separately requires two specialised sensors that exclude one temperature or the other, and variances between different locations make it somewhat pointless.    

 
 
  • 3) And I also have to introduce an adjustment factor, because the heat source itself (e.g. underfloor heating) could be much hotter than the air temperature.  This is again something that I don't really understand.  I understand this is necessary when you measure the air temperature near the heat source, like with a thermostatic radiator valve:

However I don't want thermostatic valves anymore at each radiator, but I want a single temperature sensor in the MIDDLE of the room against the wall (far away from the heat sources).  So I'm measuring the air temperature (in the middle of the room), instead of the temperature of ALL the heat sources.  Or is my setup not good ?



Thermostatic values work by measuring the nearby temperature.  If it is below the setpoint then is opens to add more heat, and if it is below the setpoint it closes to stop adding heat.

Using this comfort module works in much the same way, except it uses the comfort level as the controlling setpoint.  If the comfort level is below neutral then add more heat until it is back to neutral.  This may be a simple on/off control, or it could be a proportional control depending on what you have to work with.

The best place to have the sensor is close to where you are - if you work at a desk then have it near your desk but in most cases, near the centre of the room is sufficient.  I would also recommend adding a humidity sensor because that is a factor that influences comfort.

The adjustment factor has more to do with your personal perception of what is comfortable.  The model will produce a number that suggests what the comfort level is but if you feel cold when it says neutral, you are still cold.  Use the adjustment factor (both offset and scale) to adjust the model output to your perceptions.

My advice is to start simple and only add complexity if it is warranted.  Hope this helps and feel free to ask more questions.


Dean

Dean Cording

unread,
Dec 28, 2017, 8:04:29 PM12/28/17
to Node-RED
If you are interested in playing around with the comfort model to see how the different parameters affect comfort, there is an interactive online tool available at http://comfort.cbe.berkeley.edu/
 

Dean

Dean Cording

unread,
Dec 28, 2017, 8:41:51 PM12/28/17
to Node-RED


On Friday, 29 December 2017 09:47:18 UTC+10, Stephen Mann wrote:
My wife is a biologist and even her lab isn't controlled to that level.
I do think that Bart is overthinking the problem.


If you really want to get into active climate control, there is research that suggests that intermittent exposure to environments outside of the 'normal' comfortable temperature range can help tackle major metabolic diseases, such as diabetes and obesity.  This research indicates that mild cold and variable temperatures may have a positive effect on our health and at the same time are acceptable or even may create pleasure, and therefore buildings such as homes and offices should adopt drifting temperatures to create a more healthy environment.

Bart Butenaers

unread,
Dec 29, 2017, 3:38:05 AM12/29/17
to Node-RED
Hey guys,

First of all, thanks again for all the help!  I have learned a lot from it yesterday, both theoretical and technical.

But indeed, I don't want to build a complex system !!!!  I was just asking about the MRT and other stuff to be able to understand all the terminology used in the (interesting) feedback in this discussion...

I will summarize how I want to do it, and I will try to explain at the end WHY I would like (beside the current room air temperature) to take into account the room's heating history OR the outside temperature.  Here we go ...

Hardware
Suppose I have a room with three radiators (A, B, C):

In every room I want to place a single simple temperature sensor (D).  Like Dean said, this sensor will be placed near the location where we will be sitting most of the time.  And outside the house I planned to add also a single temperature sensor (E).  Both sensors simply measure the air temperature.

I don't want a (wireless) thermostatic valve located on top of each radiator (due to lots of reasons):


Instead of such thermostatic valves, I would like to add an electromagnetic valve on each tube on my hot water collector:


This way all the valves are located in my basement, so I can nicely wire them easily to the GPIO pins of my Raspberry.  So Node-Red can control them. 


I assume there is nothing wrong in this setup.  Or ?


Software
From the information in this discussion, I assume there are a couple of ways to use these valves and temperature sensors in my Node-Red flow:
  1. I could specify a series of (10 point) profiles in the node-red-contrib-ramp-thermostat node, and then activate another profile by injecting it (e.g. based on a timer node).  This way I can schedule automatically profiles: e.g. activate profile 'bathroom_1' on weekdays and profile 'bathroom_2' on weekend days.  That is perfect, because the bathroom will be warm as soon as I get up in the morning.  
  2. I could also use Dean's node-red-contrib-comfort node.
  3. I could create a new node, based on some existing libraries.  I found for example this library, which implements the functionality of a Nest thermostat.
Don't know yet which option would be best to control the hardware I have described in the first part ?

One of the issues I have, is that in the winter the outside temperature will be much lower, so it will take much longer to reach the target temperature.   I could simply turn on the heating much earlier (during the entire year) to reach my target temperature sooner, however I would like to avoid that since my last name isn't Trump :-)

This means e.g. for option 1, that the slopes of the profile graph should start earlier.  
I assume that I need the outside temperature or the room's heating history to take this into account.  Isn't that correct?  
Perhaps the profile can be calculated dynamically, based on outside temperature?

Another issue is that I will need to be able to switch to manual mode, e.g. when I arrive home earlier.  This means that I want to heaten up the room immediately.  I assume e.g. for option 1, that I can accomplish that by injecting another profile (with all points at the temperature that I have setted manually) ...

All tips are welcome how to achieve this.  Since I don't want to build a nuclear power plant, I'm already satisfied with simple solutions :-)

Thanks !!
Bart

Colin Law

unread,
Dec 29, 2017, 3:51:47 AM12/29/17
to node...@googlegroups.com
On 28 December 2017 at 23:47, Stephen Mann <mann....@gmail.com> wrote:
My wife is a biologist and even her lab isn't controlled to that level.
I do think that Bart is overthinking the problem.
Bart, the factors you are measuring are insignificant to the granularity of the heat-pump or furnace control or the comfort level of the people in the room.  I.E., it's lost in the hysteresis  If you try to force the heat-pump or furnace to close-tolerances, you could damage the system.  For example, if you have a set point of 70-degrees (f), and the furnace kicks in at 69-degrees, and off at 71, then it's going to be cycling on and off continuously. That is why every HVAC has hysteresis built into the controls.  In my home system, if the set point is 70-degrees, it won't come on until the room temperature drops to 68, and it won't stop until it reaches 72.

Are you saying your room temperature fluctuates between 68 and 72? If so that would not be comfortable for most.  Most room thermostats have a build in resistor which causes the stat to cycle around the selected temperature so that the heating switches on and off, typically every ten minutes or so to average out the temperature.  With modern technology this can be done much more accurately by measuring the temperature accurately and using a PID control algorithm to cycle the heating/cooling.

Colin
 
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Colin Law

unread,
Dec 29, 2017, 4:26:00 AM12/29/17
to node...@googlegroups.com
You are basically looking along the right lines.  In particular if you can use electronic valves to control the flow to individual rooms then that is ideal.  There are two different technologies available for these. Firstly are motorised valves that operate within a few seconds, these are ideal as they are quick enough to allow control of the temperature of the radiator. A conventional heating system will switch the flow on/off every ten or twenty minutes or so, adjusting the on/off times to achieve the desired amount of heat, the effect of this is that the radiators are alternately hot then cool down then heat up again.  If you have fast acting valves you can cycle the radiator flow so that it maintains a temperature which gives the required amount of heat, so rather than being hot then cold it stays warm instead.

The second technology uses a small heater to melt wax in a chamber to open the valve.  These can be very cheap, and are available with wifi control, but have the disadvantage that they can take a couple of minutes to open/close, so the fine control of radiator temperature is more difficult.   Satisfactory control can still be achieved with these if money is an issue, however.

Rather than planning the whole heating strategy and worrying about whether you need to measure external temperature and so on I would start simple by fitting the required hardware (room temperature sensor, zone control valves, and the systems for controlling these and controlling the heating/cooling system) then worry about the details of the algorithms later.  You can start just by measuring the temperature and using a simple comparator with hysteresis to switch on/off.  Once that is going you might like to look at node-red-contrib-pid (there are several pid nodes but this is the one best suited to this application, in my slightly biased opinion) with node-red-contrib-timeprop to generate a time proportioned output to drive the valves/heaters.

For temperature sensing I use 1-Wire DS18b20 sensors.

One thing to bear in mind is that you will almost certainly required the ability to tweak the setpoint up/down 0.5 or 1 degree occasionally so don't forget that when thinking about profiles and so on.  For time scheduling look at node-red-bigtimer.  I went initially just with time scheduling and the ability to tweak the setpoint as required.  Profiling and so on can be added later.

Colin


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Colin Law

unread,
Dec 29, 2017, 4:44:51 AM12/29/17
to node...@googlegroups.com
On 28 December 2017 at 23:33, Dean Cording <dean+...@cording.id.au> wrote:
The climate model library I am using from University of California is GPL2 and my code is just a wrapper around that.  In any case, I'm happy to make changes.

The library handles both ambient/radiant and operative temperatures  - I just used the operative temperature because I only had one temperature sensor to work with.  Measuring radiant temperature needs something like a globe thermometer to get an estimation and varies from place to place in a room.  Potentially you could use a non-contact IR thermometer but you would need to scan the room.  If you are going to measure radiant temperature then you need to ensure that your air temperature sensor isn't affected by radiant heat.  And if you are going to that much trouble you should also start measuring actual air speed in the environment. Very quickly you end up building a full weather station inside your house just to control the HVAC. 

I wasn't thinking of measuring MRT, but rather estimating it using a combination of outside environmental conditions, radiator temperatures and so on.

 

For most intents and purposes, operative temperature is an adequate measure.

For most intents and purposes (at least in the uk) just measuring internal temperature and controlling that is sufficient, but that doesn't stop us experimenting with more sophisticated ideas :)

Colin

Bart Butenaers

unread,
Dec 29, 2017, 6:07:25 AM12/29/17
to Node-RED
Hey Colin,
very interesting!

For completeness (for other users reading this discussion), each of my radiator has it's own hot water loop to the collector.  This way I can use centrally wired electromagnetic valves.  But in lots of houses there is a single loop that provides warm water to a series of radiators:

In such cases, indeed you cannot solve this centrally.  Otherwise all radiators should be switched on/off all together.  In that case you will need some kind of (wireless) valve at each radiator.  Seems I'm a bit spoiled ...

By the way, the warm water is pumped into the collector by means of a hot water pump.  I was thinking of only activating that pump, if at least one of the valves was open:

I have already a bypass: if none of the radiators needs warm water, the high pressure valve opens and a bypass circuit makes sure that the pump can send the water back to the heating system (to avoid the pump starts overheating).  However, that should only be used in emergency cases.  Useles to have the pump running when no radiator needs warm water ...

And of course I need some hysteresis, to make sure I don't burn the pump by continiously switching it on/off/on/off/on ... (while trying to have the exact temperature).  I assume you would use the node-red-contrib-pid to accomplish this?

However it is not clear to me how I can have the node-red-ramp-thermostat, the node-red-contrib-timeprop and the node-red-contrib-pid work together in a single flow.  I would appreciate if you could please explain that a bit in more detail?  At this moment I don't have a clue how I could start building a test flow for this :-(

Bart

Colin Law

unread,
Dec 29, 2017, 6:42:05 AM12/29/17
to node...@googlegroups.com
In order for me to answer the question about bypass valves and pump control, what sort of heat source is it? For many boilers the boiler itself will have a pump power control output which must be wired to the pump to make sure the boiler does not overheat and there must be a bypass loop (as you say) so that water can still circulate even if all the radiators are turned off.  In that case I don't control at all but leave it to the boiler (though obviously I do control the boiler so it does not come on when I don't need any heat). That means that when I decide all the radiators should be off I close all the valves and switch the boiler off, but the pump keeps running for a while through the bypass till the boiler decides it is safe to turn it off.  In that sense the use of bypass loop is not an emergency situation at all, it is perfectly common.

node-red-contrib-ramp-thermostat is a useful but non-ideal node.  It combines two completely separate functions and should (I think) be two separate nodes, one for ramp profile generation and one for thermostatic control.  It makes a good job of profile generation which is what I have used it for. If one wants a crude on/off thermostatic control then it may be useful for that, but I have not used it for that so I don't know.  If you want to do PID control of the temperature then you don't want the thermostat part of ramp-thermostat, though you may still find the ramp feature useful.  So the basic operation is:

Poll a temperature sensor to get current temperature
Get required setpoint which may be a user controlled parameter or could come from ramp-thermostat
Feed temp and setpoint into the PID node
Feed the output into the timeprop node
Control the valve with the output of the timeprop node.
Repeat ad nauseam

Once that is all going and you get bored and feel like making it more sophisticated you can put temperature sensors on the radiators then you can use cascaded PID loops so you have an outer loop which uses room temp and setpoint in a PID node and use the output as the radiator temperature setpoint which goes into an inner PID node along with current radiator temperature and controls the valve.  So the inner loop controls the radiator to a temperature set by the outer loop.

However, as I said earlier, I suggest getting it going initially just using the thermostat method with the stat driving the valve directly, then switch to basic PID control.

Colin


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Bart Butenaers

unread,
Dec 29, 2017, 7:25:46 AM12/29/17
to Node-RED
Colin, Dean,

THANKS FOR ALL YOUR TIME! Will get back here with my experiences as soon as I hve been able to experiment with it.

See you next year and I wish you guys already a happy new year,
Bart

Dean Cording

unread,
Dec 29, 2017, 7:26:29 AM12/29/17
to Node-RED

However, as I said earlier, I suggest getting it going initially just using the thermostat method with the stat driving the valve directly, then switch to basic PID control.

Colin


I'd even suggest starting a bit more basic and just implement some monitoring first to get a baseline of your current system to understand the problem before you start jiggering around with a working system. 

Dean  

Julian Knight

unread,
Dec 29, 2017, 4:44:18 PM12/29/17
to Node-RED
Speaking of monitoring ... does humidity make as much difference inside as it does outside to the perceived comfort?

Dean Cording

unread,
Dec 29, 2017, 5:41:12 PM12/29/17
to Node-RED
Have a play with the online interactive app (http://comfort.cbe.berkeley.edu/) of the model to get a feel for how the different parameters influence comfort.

Julian Knight

unread,
Dec 29, 2017, 8:01:17 PM12/29/17
to Node-RED
Ah, cool (pun intended)! Thanks Dean, useful.

Stephen Mann

unread,
Dec 29, 2017, 11:01:14 PM12/29/17
to Node-RED
Are you saying your room temperature fluctuates between 68 and 72? 
No, just illustrating an example of hysteresis.

Stephen Mann

unread,
Dec 29, 2017, 11:13:41 PM12/29/17
to Node-RED
OK, I get it.
But, I still don't see why the outside temperature is necessary.  All you need it the room temperature.  You could build in some pre-heat if the room temperature is below a lower set-point an hour before the next step in the slope.  So if the target set point is 70° at 7AM, then test the temperature at 5AM and if it's really low, turn on the heat early.  Test again at 6AM, etc.

I assume that the boiler has its own controls and safety features; all you will be doing is controlling the hot water distribution.  I've had some strange hiccups with my MQTT stuff on Node Red.  Including a space heater that gets an 'off' payload from somewhere at random.  (I haven't had time to research it, yet).

Steve Mann

On Friday, December 29, 2017 at 3:38:05 AM UTC-5, Bart Butenaers wrote:
Hey guys,
  1. ...One of the issues I have, is that in the winter the outside temperature will be much lower, so it will take much longer to reach the target temperature.   I could simply turn on the heating much earlier (during the entire year) to reach my target temperature sooner, however I would like to avoid that since my last name isn't Trump :-)

Colin Law

unread,
Dec 30, 2017, 4:31:49 AM12/30/17
to node...@googlegroups.com
The outside temperature is not *necessary* but there are some particular circumstances where it can be useful for those looking for ultimate in efficiency and comfort.

If the room is allowed to cool down overnight then there are two approaches that can be used on startup, either to adjust the switch-on time based on current (internal) temperature or to use a ramp of a pre-determined rate to ramp up the setpoint so that the heating automatically takes over an appropriate time before the time the room should be up to temperature. However there is a problem with both of these, which is that the rate at which the room will heat up will depend on the outside temperature (when it is cold outside more or the heat will go out through the walls so less is available to warm the room up). Therefore that external temperature can be used to determine the rate at which the setpoint should ramp up, or to adjust the switch-on time if a ramp is not used.

Once the room is up to temperature a properly tuned PID controller will keep the room (or the sensor at least) at the specified temperature.  However, if the house is poorly insulated or draughty, then for a given room air temperature the room may feel colder when it is cold outside due to the effects of draughts and radiation from the cold walls (back to Mean Radiant Temperature again), so if the external temp is known it could be used to tweak the setpoint up slightly when it is cold outside.  Alternately, as is the case in my home which is well insulated, when it is cold outside the radiators or underfloor heating run at a higher temperature and this *increases* the perceived temperature (increased MRT) so one might want to decrease the setpoint when it is cold outside. In practice this case is probably better dealt with by monitoring the radiator/floor temperatures and adjusting the setpoint using that.  It is obviously a lot easier to measure one outside temperature than multiple radiator/floor temperatures.

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Bart Butenaers

unread,
Dec 30, 2017, 5:25:46 AM12/30/17
to Node-RED
Hey Stephen,

Indeed my boiler also has some build-in temperature control system.  It is an older type at higher temperature: the boiler starts burning when the water temperature drops below 60° Celsius, and it stops burning when the water (inside the boiler) temperature reaches 80° Celsius.  So as soon as the heat pump starts pumping, water (with temperature between 60 and 80 degrees) runs through the radiators.

And about the outside temperature.  One picture says more than thousand (wise) words :-)

Suppose I want the bathroom to be 24° C at 7 pm.  On a less-cold day (red graph), the valve should be openend at 6:45.  However on a cold day (blue graph), the valve should be opened already at 6:30 (since my room temperature doesn't rise fast enough).  Otherwise the room will not be 24° C at 7:00, but only at 7:15 ...


I'm not saying this will be the case for all buildings, but it can be the case when the house is not well insulated or e.g. when you have a large amout of glass windows.  Or like Julian already mentioned: if you don't heat during the night at all, the night temperature inside the room might drop below the 15° C.  In that case the valve should also be opened earlier because the temperature difference will be larger.


I'm getting already cold sweat when thinking about this experiment ;-)

Bart

Colin Law

unread,
Dec 30, 2017, 5:48:20 AM12/30/17
to node...@googlegroups.com
One other thing you will want to think about, as Dean mentioned, is monitoring the system. For that I highly recommend using Influxdb for saving data and Grafana for showing graphs.  Also as Dean suggested maybe a good idea is to get the monitoring system going first, if you have not already.

Colin

Walter

unread,
Dec 30, 2017, 5:07:49 PM12/30/17
to Node-RED
I wouldn't use electromagnetic valves:

* it consumes power to keep it open (> 5 W each)
* can only switched on and off -> no flow regulation
* durability
* reliability - if the valve fails, you cannot switch it by hand (unlike an electromechanical valve)

A electromechanical valve per room would should do it.

Colin Law

unread,
Dec 30, 2017, 5:15:23 PM12/30/17
to node...@googlegroups.com
Can you define in more detail what you mean by electromagnetic and electromechanical valves?

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Walter

unread,
Dec 30, 2017, 5:39:33 PM12/30/17
to Node-RED
On Saturday, December 30, 2017 at 11:15:23 PM UTC+1, Colin Law wrote:
Can you define in more detail what you mean by electromagnetic and electromechanical valves?


electromagnetic = solenoid valve
electromechanical = motorized ball valve

Colin Law

unread,
Dec 31, 2017, 4:38:59 AM12/31/17
to node...@googlegroups.com
Hi Walter

I am not aware of solenoid control valves, or motorised ball valves that are proportional rather than open/close (at a reasonable price). Do you have some examples of these? It would be great to have proportional ones.

In the UK the common ones are heated wax ones, for example  [1], and motorised on/off ones, eg [2].

Type [1] can be used to replace conventional thermostatic rad valves which can be very convenient for retro-fit.

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Bart Butenaers

unread,
Dec 31, 2017, 4:54:00 AM12/31/17
to Node-RED
Hi Walter, Colin,

I have already seen such ball valves, but they were more expensive. 
And I'm pretty sure that they allow much more precise temperature control, since the hysteresis can be kept smaller.

But not sure how to control them from a Node-Red flow ...

The magnetic valves are 'rather' easy to use, since they have a simple ON/OFF state.
I 'assume' that a temperature graph with a magnetic valve would look like this:

The red line is the target temperature profile, that I configure via Node-Red.
The blue line is the real air temperature, measured with a temperature sensor.
The hysteresis mechanism would look like this:
  1. Real temperature exceeds the target temperature too much (+hysteris), so the valve will be switched OFF.
  2. Real temperature falls below the target temperature too much (-hysteris), so the valve will be switched ON.
  3. Real temperature exceeds the target temperature too much (+hysteris), so the valve will be switched OFF.
  4. Real temperature falls below the target temperature too much (-hysteris), so the valve will be switched ON.
  5. ...
Simply two states, but I 'suppose' the temperature fluctuations might be inconvient...
With the balve valve we could keep it 'a little bit' open, to flatten the real temperature curve.

But again, I have currently no idea how to add this kind of functionality in the above flow proposal of Colin.

Bart

Colin Law

unread,
Dec 31, 2017, 5:12:42 AM12/31/17
to node...@googlegroups.com
Bart, the cycling on graph you show is not to do with whether the valve is on/off or proportional,  it is due to the fact that you are using on/off control with hysteresis rather than something more sophisticated like PID control.   An on/off valve can be driven in a time proportioned way to give the effect of proportionality.  So if you want 25% flow it is switched on for 25% of the time and off for 25% of the time.  Provided the switching period is small compared to the time constants of the system being heated (a room in this case) you can get very accurate control.  In the case of a room a 10 minute cycle time is typically used, so for the 25% power case it would be on for 2.5 minutes then off for 7.5 minutes.

A PID controller works by monitoring the difference between the actual and required temperature and generating a varying output between 0 and 100% which, if the controller is tuned correctly, will give very accurate control of the system.  To use this with an on/off actuator the 0-100% output of the pid can be fed into a time proportioning node such as node-red-contrib-timeprop, the output of which is an on/off signal which is fed to the actuator via a relay or similar.

Colin


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

cflurin

unread,
Dec 31, 2017, 5:32:59 AM12/31/17
to Node-RED
One feature I'd like to point out:

The ramp-thermostat can be configured to provide a different switching time.
You only have to define a gradient line for the morning period.

E.g. the proflie for the dining room looks like the sample on github: https://github.com/cflurin/node-red-contrib-ramp-thermostat

As you can see in the picture it will turn on the valve at a specific time depending on the room temperature in the morning. If the outdoor temperature is low (e.g. 5 C degree), the indoor temperature will also be low because of the thermal loss. If the outdoor temperature is very low (e.g. -10 C degree), the indoor temperature will also be lower. The current temperuture line will cross the target temperature line earlier in the morning and will turn the valve earlier. Therfore you don't need an outdoor temperature sensor for the room temperature control. I only use one for the central heating to control the flow temperature.

In my case (floor heating) I only turn on the heating during the day, in the night starting at 20:00 the heating is off. For every room I use a temperature sensor and an electromagnetic valve connected (wifi) to a rpi3 > node-red > ramp-thermostat.

Bart Butenaers

unread,
Dec 31, 2017, 9:07:19 AM12/31/17
to Node-RED
Hmmm,
it indeed seems that outside temperature is being mostly used to control the water temperature inside the boiler: in the winter the water needs to be hotter... Thanks, that makes my case a little bit more simple.

That was it for me this year. See you guys in 2018 !

Colin Law

unread,
Dec 31, 2017, 9:40:55 AM12/31/17
to node...@googlegroups.com
Using the external temperature to control the hot water temperature is a way of increasing the gain of the heating system. It means that if, for example, the radiators are on for 50% of the time then the amount of heat given off will be greater if the water is hotter.  If your boiler has the ability to be told electronically what water temperature to control to then that is a perfectly valid use of external temperature.

Colin

--
http://nodered.org

Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.

Walter

unread,
Jan 1, 2018, 8:21:30 AM1/1/18
to Node-RED

I am not aware of solenoid control valves, or motorised ball valves that are proportional rather than open/close (at a reasonable price). Do you have some examples of these? It would be great to have proportional ones.

@Colin:
I would use an item like this, if precise temperature control is needed:

In this case, i think that a 2 way motorized ball valve could also be used (with a lower voltage, the runtime could be extended for a better regulation).

BR
Walter

Reply all
Reply to author
Forward
0 new messages