Controlling a device based on 2 inputs

Sorry, yes, it is node-red-contrib-simple-gate

@krambriw I think you missed the situation that the living room is below settemp, and the bedroom at/above. The heater is activated AND pump needs to run.

Fiddling around with the gates. I think I will have to use Steve's switch with the 5 outputs to be able to control the condition where the living room pump needs to run, while the bedroom is at/above settemp.

Those gates may come in handy when storing the set temp before kicking up the set temp. If the bedroom requests heat, that closes a gate for the settemp (already available in a global and used in the flow) towards a flow context value. That value can than later be used to restore the previous living room settemp.

The weekend was too short to finish the flow...

In that situation, that I think is covered, the gate would be closed and the pump unblocked. This means the heating could be on and the pump would run. I have assumed the pump was already connected and controlled by a thermostat in some way?

But this discussion now drills down to details how you control the pump. What I meant by blocking & unblocking the pump was that a switch was operated that would break & un-break the control signal to the pump. If this is done differently, you have to specify, otherwise we can spend hours guessing how it works

The living room pump is controlled by the raspberry > sonoff relay, based on the heating status of the Nest Thermostat. Heating status is calculated based on the settemp minus the measured temp. <= 0 equals heating. I've added the scullery pump control to the flow, time framed & delayed on and 20 minutes after run.

I'm going to continue work in the coming days, checking how to control the pump thru the gate and storing the settemp value.

My idea for storing a value was to control the updating of a flow context value with a gate. So if the livingroom set temp was going to be raised because the bedroom temp was below the set temp. I would close the gate to a change node where the flow value was set. That value would then stop being updated and could be the input value for when the bedroom settemp was reached. Inject that settemp value back to the livingroom thermostat.

This was exactly my point. How would you prevent (or block) the pump from starting when you raise the settemp?

Since I don't know exactly what controls & inputs you have at hand or can make available, my suggestion here might be missing something. But anyway, to make a control system, i.e. flow, I would try to make it simpler, more obvious, more straight forward. Instead of fiddling & cheating a thermostat can't you simply re-wire things a bit?

Instead of controlling the heater directly with the Nest thermostat in the living room, just capture the current temperature but start the heater with help of a relay controlled by the Pi. If so you would have better possibilities to control things, no need to kick up set temps and keep them in memory either

Having the following would simplify things

  • a relay to start the heater
  • a relay to start the living room pump
  • capture readings from thermostats (current temp and set temps)

I think you have already everything except for an additional relay to start/stop the heater


  1. Living room needs heating: turn on heater & living room pump
  2. Living room reached set temp: turn off heater & living room pump
  3. Bedrooms need heating and living room set temp is reached: turn on heater
  4. Bedrooms reached set temp: turn off heater

What will happen if living room and bedrooms need heating at the same time? The heater will be turned on and also the pump in the living room. Would this be a problem? Or is this a "normal" case?

You are completely right, kicking up the living room thermostat is a bit cheating and not the best ^ robust solution.

The central heater supports OpenTherm (modulating) and on/off thermostats. I was chatting with a colleague last week and he told me that his central heater, supports both & simultaneously. I tried that, but I think I broke something in the process...Since then the thermostat is complaining that there is no OpenTherm signal available and the heater goes into failsafe (heater on) when I connect the heatlink (the device connected to the heater, wirelessly controlled by the thermostat). Disconnect the heatlink and the heater stays idle. So I suspect the heatlink, still have to find a OpenTherm thermostat somewhere to check what is wrong.

You already know that I have a spare Nest, the bedroom one. That's an on/off thermostat which I now wired to the central heater... and it works (though different than the modulating)

If the heatlink is ok but I fried the OpenTherm part of the central heater, I may be looking at couple of hundreds to replace the mainboard of the central heater... you're suggestion of controlling the central heater with some relays, may sound like a viable option :nerd_face:

There are already ESP controlled relays at both the scullery and living room pumps. So it would be an option to upgrade the scullery ESP8266 to something beefier and wire the on/off thermostat to an input, and on the outputs: relay to control the heater and add a simple DS18B20 temperature to sense the water temperature at the heater.

Before I upgraded the house with a radiant floor, the pump in the central heater was the pump that pumped water to the living, all bedroom, badroom and the hallway (except the scullery, that has it's own pump). I remove the living and hallway radiators and installed a radiant floor. So bedroom and living both requesting heat is not a problem, If I recall correctly the heater is somewhere in the region of 30kw, so that's more than enough.

In the mean time, Node-RED is fun to play around with :slight_smile:

Cool, I see, you have all the stuff and experience needed. Those ESP devices are useful, I have a couple of those (ESP32) myself in my system for dedicated tasks where wifi connections are more convenient than wiring. They are working great. Combining everything in Node-RED is really fun and very powerful! Amazing solutions can be made

I see your flow and realize you have additional stuff to support. I have just focused on the original part, how to handle the need for heating in bedrooms & living room. I was thinking of a flow like below

The gates are used to prevent a possible conflict in control of the heater. If no heating is needed, the living room pump and heater is turned off and all gates are open. If you simulate lower temp in one of the rooms, the gates for the other room will be closed. Only one room "is allowed" to control the heater at the same time. Once the target temp is reached, heater will be turned off, gates will be opened and any room can then request heating. I'm assuming that the internal pump in the heater also runs when the heater is turned on. Also the situation that both rooms need heating is covered I think. If the bedrooms need heating, the heater is on. If the living room then also calls for heating, the heater is already on and just the living room pump will be started in addition

This is just a simulator but when I raise and lower temperatures in the rooms, I think the output looks ok, should work if I have not misunderstood the concept

Oh yes, the delay nodes (5ms) are just there to guarantee that the gates are set correctly before messages are sent to control the heater and the pump

[{"id":"e1c6bd71.8e4d9","type":"inject","z":"bf12ff9c.cd354","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"23","payloadType":"num","x":150,"y":160,"wires":[["693a525e.f9ad2c"]]},{"id":"71a7fb8c.e36974","type":"inject","z":"bf12ff9c.cd354","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":150,"y":220,"wires":[["693a525e.f9ad2c"]]},{"id":"310b0743.a30818","type":"inject","z":"bf12ff9c.cd354","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":150,"y":400,"wires":[["6f17ddea.781e94"]]},{"id":"38a19aee.c7a296","type":"inject","z":"bf12ff9c.cd354","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":150,"y":700,"wires":[["bbc26ff8.8a085"]]},{"id":"693a525e.f9ad2c","type":"change","z":"bf12ff9c.cd354","name":"","rules":[{"t":"set","p":"livingroom","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":190,"wires":[[]]},{"id":"775a0bf2.52f594","type":"inject","z":"bf12ff9c.cd354","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"23","payloadType":"num","x":620,"y":160,"wires":[["93a57c7c.ad25b"]]},{"id":"dadf44e4.4fc5f8","type":"inject","z":"bf12ff9c.cd354","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":620,"y":220,"wires":[["93a57c7c.ad25b"]]},{"id":"93a57c7c.ad25b","type":"change","z":"bf12ff9c.cd354","name":"","rules":[{"t":"set","p":"bedroom","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":190,"wires":[[]]},{"id":"e625b0a9.29fd","type":"comment","z":"bf12ff9c.cd354","name":"Livingroom temperature simulator","info":"","x":240,"y":120,"wires":[]},{"id":"39029dfd.2691b2","type":"comment","z":"bf12ff9c.cd354","name":"Bedroom temperature simulator","info":"","x":700,"y":120,"wires":[]},{"id":"6f17ddea.781e94","type":"switch","z":"bf12ff9c.cd354","name":"livingroom","property":"livingroom","propertyType":"flow","rules":[{"t":"gte","v":"22.0","vt":"num"},{"t":"lt","v":"22.0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":400,"wires":[["d5272b26.14bc38","a84bf8af.4d1b08"],["bb2fd4a1.0b63d8","a9daf0b1.642ed"]]},{"id":"6c61a7cf.b24548","type":"debug","z":"bf12ff9c.cd354","name":"Pump living room","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1240,"y":400,"wires":[]},{"id":"d5272b26.14bc38","type":"change","z":"bf12ff9c.cd354","name":"Open gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":500,"wires":[["443ff4b3.98443c","3c3abebb.c92872"]]},{"id":"bb2fd4a1.0b63d8","type":"change","z":"bf12ff9c.cd354","name":"Close gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":450,"wires":[["443ff4b3.98443c","3c3abebb.c92872"]]},{"id":"bbc26ff8.8a085","type":"switch","z":"bf12ff9c.cd354","name":"bedroom","property":"bedroom","propertyType":"flow","rules":[{"t":"gte","v":"22.0","vt":"num"},{"t":"lt","v":"22.0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":700,"wires":[["3494b514.6da95a","b9bc21a8.afcce"],["45de57da.32da98","18e0c87.25a9e38"]]},{"id":"671780f2.d84a5","type":"debug","z":"bf12ff9c.cd354","name":"Heater","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1200,"y":540,"wires":[]},{"id":"37262b3b.d33364","type":"change","z":"bf12ff9c.cd354","name":"Heater_ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"heater on ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":580,"wires":[["f1d22222.b3e1d"]]},{"id":"ae37c48d.efad88","type":"change","z":"bf12ff9c.cd354","name":"Heater_OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"heater off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":510,"wires":[["f1d22222.b3e1d"]]},{"id":"edce181c.1d15f8","type":"comment","z":"bf12ff9c.cd354","name":"Set points for living and bedroom is 22 degrees","info":"","x":280,"y":320,"wires":[]},{"id":"ae543b4e.4de918","type":"change","z":"bf12ff9c.cd354","name":"Pump__ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"pump living room  on ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":420,"wires":[["89cfae7b.9c362"]]},{"id":"ec66c369.63719","type":"change","z":"bf12ff9c.cd354","name":"Pump_OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"pump living room  off ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":380,"wires":[["89cfae7b.9c362"]]},{"id":"443ff4b3.98443c","type":"gate","z":"bf12ff9c.cd354","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":700,"y":580,"wires":[["ae37c48d.efad88"]]},{"id":"3c3abebb.c92872","type":"gate","z":"bf12ff9c.cd354","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":700,"y":640,"wires":[["37262b3b.d33364"]]},{"id":"47680b81.58f2d4","type":"gate","z":"bf12ff9c.cd354","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":700,"y":460,"wires":[["ae37c48d.efad88"]]},{"id":"b893845b.0891e8","type":"gate","z":"bf12ff9c.cd354","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":700,"y":520,"wires":[["37262b3b.d33364"]]},{"id":"3494b514.6da95a","type":"change","z":"bf12ff9c.cd354","name":"Open gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":650,"wires":[["b893845b.0891e8","47680b81.58f2d4"]]},{"id":"45de57da.32da98","type":"change","z":"bf12ff9c.cd354","name":"Close gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":600,"wires":[["47680b81.58f2d4","b893845b.0891e8"]]},{"id":"f1d22222.b3e1d","type":"rbe","z":"bf12ff9c.cd354","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1070,"y":540,"wires":[["671780f2.d84a5"]]},{"id":"89cfae7b.9c362","type":"rbe","z":"bf12ff9c.cd354","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1070,"y":400,"wires":[["6c61a7cf.b24548"]]},{"id":"18e0c87.25a9e38","type":"delay","z":"bf12ff9c.cd354","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":500,"y":720,"wires":[["3c3abebb.c92872"]]},{"id":"b9bc21a8.afcce","type":"delay","z":"bf12ff9c.cd354","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":500,"y":680,"wires":[["443ff4b3.98443c"]]},{"id":"a84bf8af.4d1b08","type":"delay","z":"bf12ff9c.cd354","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":500,"y":380,"wires":[["47680b81.58f2d4","ec66c369.63719"]]},{"id":"a9daf0b1.642ed","type":"delay","z":"bf12ff9c.cd354","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":500,"y":420,"wires":[["b893845b.0891e8","ae543b4e.4de918"]]}]

The supplier of the Nest Thermostat E asked me to return the thermostat, so now my system is crippled...
The bedroom thermostat moved downstairs and is now controlling the central heater.

Changed the paths that set the global context values, and the bedroom is now controlling the central heater :slight_smile:
In the mean time, I've created a failsafe state for the heating system for when internet is not available or one of the thermostats is dead (mains>USB powered).

[{"id":"70c8436a.d5266c","type":"telegram sender","z":"bc363c12.0f7d","name":"Catch","bot":"f0af1e3f.3cb23","x":690,"y":340,"wires":[[]]},{"id":"1c66f9a2.155a76","type":"change","z":"bc363c12.0f7d","name":"Chatid","rules":[{"t":"set","p":"payload.chatId","pt":"msg","to":"chatid","tot":"num"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"Living thermostat offline","tot":"str"},{"t":"set","p":"failsafe","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":340,"wires":[["70c8436a.d5266c"]]},{"id":"2dd7e283.c5044e","type":"debug","z":"bc363c12.0f7d","name":"Debug catch","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":290,"y":360,"wires":[]},{"id":"b74a0d0e.3ed3e","type":"catch","z":"bc363c12.0f7d","name":"","scope":["830b4816.3d8af8","8e0e1010.70398","fce7801.2fde28","25b7c806.a6f1a8","8383efc7.fa899","aefc7f43.690cf","2e92c18d.4229fe"],"uncaught":false,"x":130,"y":340,"wires":[["2dd7e283.c5044e","1c66f9a2.155a76"]]},{"id":"ceabf8a8.9e0888","type":"switch","z":"bc363c12.0f7d","name":"Living online","property":"","propertyType":"msg","rules":[{"t":"eq","v":"ONLINE","vt":"str"},{"t":"eq","v":"OFFLINE","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":490,"y":240,"wires":[["a2f915a1.62e0d8","593c08fe.689638","6bce2bb5.189c04"],["a2f915a1.62e0d8"],["593c08fe.689638","a2f915a1.62e0d8"]]},{"id":"c644bb7f.849f78","type":"inject","z":"bc363c12.0f7d","name":"","props":[{"p":"topic","vt":"str"},{"p":"","v":"living.status","vt":"global"}],"repeat":"300","crontab":"","once":true,"onceDelay":0.1,"topic":"living status","x":120,"y":240,"wires":[["699a31d1.f6822"]]},{"id":"7bfd9ce6.a9b944","type":"change","z":"bc363c12.0f7d","name":"Bedroom failsafe","rules":[{"t":"set","p":"bedroom.failsafe","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":420,"wires":[[]]},{"id":"c89f563.548e7a8","type":"comment","z":"bc363c12.0f7d","name":"Catch http API errors","info":"","x":140,"y":300,"wires":[]},{"id":"3132748d.5b1aec","type":"switch","z":"bc363c12.0f7d","name":"Bedroom online","property":"payload.bedroom.status","propertyType":"msg","rules":[{"t":"eq","v":"ONLINE","vt":"str"},{"t":"eq","v":"OFFLINE","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":500,"y":440,"wires":[["7bfd9ce6.a9b944"],["74bc1f2a.a4e0e"],["593c08fe.689638","74bc1f2a.a4e0e"]]},{"id":"4349b4fe.a10dcc","type":"inject","z":"bc363c12.0f7d","name":"","props":[{"p":"topic","vt":"str"},{"p":"payload.bedroom.status","v":"bedroom.status","vt":"global"}],"repeat":"300","crontab":"","once":true,"onceDelay":0.1,"topic":"bedroom status","payloadType":"str","x":130,"y":440,"wires":[["d81677a4.bd1858"]]},{"id":"a2f915a1.62e0d8","type":"change","z":"bc363c12.0f7d","name":"Chatid","rules":[{"t":"set","p":"payload.chatId","pt":"msg","to":"chatid","tot":"num"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"Living thermostat offline","tot":"str"},{"t":"set","p":"living.failsafe","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":300,"wires":[["70c8436a.d5266c"]]},{"id":"74bc1f2a.a4e0e","type":"change","z":"bc363c12.0f7d","name":"Chatid","rules":[{"t":"set","p":"payload.chatId","pt":"msg","to":"chatid","tot":"num"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"Bedroom thermostat offline","tot":"str"},{"t":"set","p":"bedroom.failsafe","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":380,"wires":[["70c8436a.d5266c"]]},{"id":"5360ed0a.f7b884","type":"comment","z":"bc363c12.0f7d","name":"Thermostat bedroom online check, set failsafe","info":"","x":190,"y":400,"wires":[]},{"id":"593c08fe.689638","type":"debug","z":"bc363c12.0f7d","name":"Otherwise","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":720,"y":280,"wires":[]},{"id":"d81677a4.bd1858","type":"rbe","z":"bc363c12.0f7d","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":310,"y":440,"wires":[["3132748d.5b1aec"]]},{"id":"699a31d1.f6822","type":"rbe","z":"bc363c12.0f7d","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":310,"y":240,"wires":[["ceabf8a8.9e0888"]]},{"id":"6bce2bb5.189c04","type":"change","z":"bc363c12.0f7d","name":"Living failsafe","rules":[{"t":"set","p":"living.failsafe","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":240,"wires":[[]]},{"id":"751eb929.587d08","type":"comment","z":"bc363c12.0f7d","name":"Thermostat living online check, set failsafe","info":"","x":200,"y":200,"wires":[]},{"id":"f0af1e3f.3cb23","type":"telegram bot","botname":"Home_bot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"60000","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]

If any of the thermostats are offline, they set a global context value. On which I switch on the living room pump and send a telegram message that one of the thermostats is offline. Next failsafe to be completely independent of wifi is to add a 2nd temperature sensor to the ESP controlling the living room pump. If incoming water is hot and living room temperature is below the settemp, turn on pump.

Checking your simulator now..

Yes, a fail safe solution is of course required. I mean what could otherwise happen if the gas burner never turns off. I was also thinking about such things so for sure, you need reliable monitoring & control

Two things to mention:

  • the simulator is running temperature checking every 5 seconds, in reality this is hardly needed I guess
  • if you remove the RBE nodes, you will see current commands being repeated every 5 second. In a real system this might not be too bad, kind of fail safe as well, the last correct commands being repeated to make sure the relays are in correct state

Try this ..

and ..

iHome Smart Thermostat collection

imo trying to do control using nodered is non trivial ..

iHome uses very simple ladder logic .. probably the most ubiquitous and installed control system ever ..

have fun

Temperatures don't fluctuate that much so I set the injects to one minute interval, more that sufficient for the heater. The heater stops heating when the return temperature is higher than a set threshold, so that's covered although a waste of gas.

Also adding the Tasmota device MQTT response to the mix, if there is no response on the command > send a telegram message. And thinking of how to put a last will to use...

That is too easy for me :wink:

I was directed to this post by @krambriw from one that I just wrote last night here:

I'm sure you guys have considered this already, but with the instant hot water panel that I have recently built, I have my main engine (which runs in a NR function node) also trigger every one minute, like @mintgroen suggested , this is perfectly adequate for heating IMHO, however I also added 3x more triggers to run the engine more frequently:

  1. if a temp value changes
  2. if a pump status changes ie. someone overrode a pump from another interface
  3. if a user changes any config from the VueJS/uibuilder interface

With the above 3x triggers it means that the panel runs "instantly" from the users perspective ie.. if you change a temp setpoint or turn a zone on/off, you see the action executed within less than a second of making the change....

I have not read this entire thread, so apologies if you have covered the above off, but I thought I'd share this as it seemed like a good idea to me to implement it at the time.

Is an interesting input. However, since a water heating system is relatively slow (or densely might be a better word), you still have to wait a while until the desired temperature is reached so there is no real need to "be in a hurry" from that perspective I guess

I did not come to the point to develop the controlling the thermostat from a UI. At this moment the automated control for upstairs is sufficient and downstairs is at a comfortable 20.5 during the day, 19 at night. And if you want the living to heat, the thermostat itself or the Nest app are the UI at the moment. The heater responds immediately, main pump wil start. Although the response of the livingroom mixer pump is one minute, that's well before there is any meaningful increase in water temperature at that mixer.

Correct, increase the temperature downstairs 1 degree C, takes at least an hour.

Ah, I think we are mixing different things here. My hot water cylinder increases slowly, not 1C per hour, maybe 1C per 10 mins, but my instant hot water runs very quickly i.e. it easily increases >3C in 90 seconds.

So if you want instant hot water for a shower upstairs, you can press the override and by the time you are upstairs and ready for the shower the water is steaming hot.

I'm also very impatient when it comes to HA. I want to see things happen straight away so I know they are working and TBH Node-RED can handle the load easily. It seems very good at running little snippets of code regularly.

But yes, for heating up a cylinder 1 minute cycles is more than enough.

I think so too yes. I am only talking about the central heating system to supply heat to the radiators/floor radiants. Since the living room only requires heat in the morning, the 2nd floor doesn't receive any heat. So I don't want the floor radiant pumps to run 24/7 and I want to keep the 2nd floor warm, that needs some control of the heater and living room mixer pump.

Hot shower water does not need any control, if the shower is turned on, there is a pressure sensor that turns on the central heater and the hot water produced is switched to a heat exchanger, which heats the water towards the shower.

Oh yeah, I get that, but it takes about 2.5 minutes for the hot water to get to my loft shower. The point of instant hot water is just that... piping hot water in about 2 seconds from turning the tap on. It's a luxury :wink:

How does the water in the pipe become hot, when there is no flow? (there is about 15m of pipe from heater/shower).

Since this topic is wrecked anyway, my failsafe on the ESP:

and rules

// Bootstate
on System#Boot do

// mqtt lost, pump on
on MQTT#Disconnected do

// Water 25c, ambient <19.5 pump on
on Rules#Timer=1 do
   if AM2301#Temperature<19.50 and Watertemp#Temperature>25 

//Switch on
on Button#State=1 do

AM2301 measures ambient livingroom as the redundant temperaturesensor and a DS18B20 to measure the pump temperature.

Now back to Node-RED :wink:

I apologise if it was me that threw your topic off!

To answer your question, the water would not get hot when the pump is off and no water is flowing. During that period the temp is dropping. When it hits the low temp setooint, the pump is turned back on to heat up the water in the pipe.

1 Like