Controlling a device based on 2 inputs

I amd trying to control a pump in the central heating system, based on the input of 2 thermostats.

The pump needs to run when the living room temp is lower than the living room set temp.
The living room thermostat is the only thermostat that is able to control the central heating, but when the bedroom thermostat requests heat, I need to do that by controlling the set temp and the pump. I am trying to create a flow, that is able to temporary raise the set temp, but without activating the pump (technically, no hot water flows towards the living room.

I've been playing around with function nodes but my js knowledge did not get me very far so now I am trying to use the nodes to control the pump.

Where I'm stuck is after the change nodes. I get boolean values based on the condition, heating yes or no (simply deducting the room temp from the set temp, if <= then there is no heat required in that room). But then, do I need to join the 2 outputs to feed the logic AND? The logic AND does not really produce an AND, but it looks like the AND results in a pass when true?

Are there better ways to achieve the result in the right debug nodes? If not, how do I configure the join/logic AND nodes... tried all kinds of thing in the rules part of the nodes, but it doesn't seem produce the expected result in the debug nodes.

[{"id":"19b9fb23.993845","type":"tab","label":"Test","disabled":false,"info":""},{"id":"edf57538.f5e0d8","type":"function","z":"19b9fb23.993845","name":"Heating","func":"var BEDROOMHEATT = msg.payload.bedroom.temperature - msg.payload.bedroom.settemp;\nvar LIVINGHEATT = msg.payload.living.temperature - msg.payload.living.settemp;\nvar BEDROOMHEAT = BEDROOMHEATT.toFixed(1);\nvar LIVINGHEAT = LIVINGHEATT.toFixed(1);\nmsg.payload.heating = {\"living\":LIVINGHEAT,\"bedroom\":BEDROOMHEAT};\nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":80,"y":240,"wires":[["90ee849f.f8de08","859f4da7.0737"]]},{"id":"90ee849f.f8de08","type":"change","z":"19b9fb23.993845","name":"","rules":[{"t":"delete","p":"payload.bedroom","pt":"msg"},{"t":"delete","p":"payload.living","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":240,"wires":[["d5edd152.164ee","b1cdabe9.ebeb78","c0c8b17a.78a5e"]]},{"id":"d5edd152.164ee","type":"switch","z":"19b9fb23.993845","name":"Living","property":"payload.heating.living","propertyType":"msg","rules":[{"t":"lte","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":197,"wires":[["c169a17d.bf5df","e2169af9.7ef8e8"],["49260c.cf79f9f4","4b8caf89.efd67"]]},{"id":"b1cdabe9.ebeb78","type":"switch","z":"19b9fb23.993845","name":"Bedroom","property":"payload.heating.bedroom","propertyType":"msg","rules":[{"t":"lte","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":480,"y":277,"wires":[["7fe0db69.4635e4","f3795c35.014aa"],["7a4e1e3d.625f5","60d9ab41.a3e984"]]},{"id":"7a4e1e3d.625f5","type":"change","z":"19b9fb23.993845","name":"Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bedroom","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"bedroom","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":297,"wires":[["b9f2c6bd.a8aa48","4567425c.e3424c","7287225c.c96b5c"]]},{"id":"7fe0db69.4635e4","type":"change","z":"19b9fb23.993845","name":"On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bedroom","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"bedroom","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":257,"wires":[["5d64da42.5629a4","2af0246a.b961cc","a9b75353.08534"]]},{"id":"49260c.cf79f9f4","type":"change","z":"19b9fb23.993845","name":"Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.living","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"living","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":217,"wires":[["a5ef9a7d.6d28d8","a9b75353.08534","4567425c.e3424c"]]},{"id":"c169a17d.bf5df","type":"change","z":"19b9fb23.993845","name":"On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.living","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"living","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":649,"y":177,"wires":[["710b5f7d.94104","2af0246a.b961cc","7287225c.c96b5c"]]},{"id":"66e4df3.15c1c2","type":"and-gate","z":"19b9fb23.993845","name":"L off, Bed on","rules":[{"t":"false","propertyType":"msg","property":"payload.living","topic":"living"},{"t":"true","propertyType":"msg","property":"payload.bedroom","topic":"bedroom"}],"outputTopic":"heating","gateType":"and","emitOnlyIfTrue":false,"x":1050,"y":280,"wires":[["574fd3fc.6a4e1c"]]},{"id":"a03cb70d.c792c8","type":"and-gate","z":"19b9fb23.993845","name":"L on B on","rules":[{"t":"true","propertyType":"msg","property":"payload.living","topic":"living"},{"t":"true","propertyType":"msg","property":"payload.bedroom","topic":"bedroom"}],"outputTopic":"heating","gateType":"and","emitOnlyIfTrue":false,"x":1040,"y":200,"wires":[["5243f61f.eda488"]]},{"id":"a93ff5a.7819408","type":"and-gate","z":"19b9fb23.993845","name":"L on B off","rules":[{"t":"true","propertyType":"msg","property":"payload.living","topic":"living"},{"t":"false","propertyType":"msg","property":"payload.bedroom","topic":"bedroom"}],"outputTopic":"heating","gateType":"and","emitOnlyIfTrue":false,"x":1040,"y":120,"wires":[["4e377e97.287c4"]]},{"id":"574fd3fc.6a4e1c","type":"debug","z":"19b9fb23.993845","name":"L off bed on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1230,"y":280,"wires":[]},{"id":"5243f61f.eda488","type":"debug","z":"19b9fb23.993845","name":"Both on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","statusVal":"","statusType":"auto","x":1220,"y":200,"wires":[]},{"id":"4e377e97.287c4","type":"debug","z":"19b9fb23.993845","name":"L on bed off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1230,"y":120,"wires":[]},{"id":"f0994f81.d0042","type":"inject","z":"19b9fb23.993845","name":"L on B off","props":[{"p":"payload.living.temperature","v":"1","vt":"num"},{"p":"payload.living.settemp","v":"2","vt":"num"},{"p":"payload.bedroom.temperature","v":"2","vt":"num"},{"p":"payload.bedroom.settemp","v":"1","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":80,"y":100,"wires":[["edf57538.f5e0d8"]]},{"id":"859f4da7.0737","type":"debug","z":"19b9fb23.993845","name":"Test Heating","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":320,"y":360,"wires":[]},{"id":"c0c8b17a.78a5e","type":"debug","z":"19b9fb23.993845","name":"Test change","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":360,"wires":[]},{"id":"e2169af9.7ef8e8","type":"debug","z":"19b9fb23.993845","name":"living on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":640,"y":80,"wires":[]},{"id":"4b8caf89.efd67","type":"debug","z":"19b9fb23.993845","name":"living off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":640,"y":120,"wires":[]},{"id":"f3795c35.014aa","type":"debug","z":"19b9fb23.993845","name":"bedroom on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":420,"wires":[]},{"id":"60d9ab41.a3e984","type":"debug","z":"19b9fb23.993845","name":"bedroom off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":460,"wires":[]},{"id":"710b5f7d.94104","type":"debug","z":"19b9fb23.993845","name":"living on boolean","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":20,"wires":[]},{"id":"a5ef9a7d.6d28d8","type":"debug","z":"19b9fb23.993845","name":"living off boolean","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":60,"wires":[]},{"id":"5d64da42.5629a4","type":"debug","z":"19b9fb23.993845","name":"bedroom on boolean","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":420,"wires":[]},{"id":"b9f2c6bd.a8aa48","type":"debug","z":"19b9fb23.993845","name":"bedroom off boolean","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":460,"wires":[]},{"id":"c70a875c.ca3f58","type":"debug","z":"19b9fb23.993845","name":"Boolean joined","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1240,"y":40,"wires":[]},{"id":"2af0246a.b961cc","type":"join","z":"19b9fb23.993845","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":200,"wires":[["a03cb70d.c792c8"]]},{"id":"a9b75353.08534","type":"join","z":"19b9fb23.993845","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":280,"wires":[["66e4df3.15c1c2"]]},{"id":"51344085.c39e3","type":"and-gate","z":"19b9fb23.993845","name":"L off, Bed off","rules":[{"t":"false","propertyType":"msg","property":"payload.living","topic":"living"},{"t":"false","propertyType":"msg","property":"payload.bedroom","topic":"bedroom"}],"outputTopic":"heating","gateType":"and","emitOnlyIfTrue":false,"x":1050,"y":360,"wires":[["2d6cee5.a60a912"]]},{"id":"4567425c.e3424c","type":"join","z":"19b9fb23.993845","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":360,"wires":[["51344085.c39e3"]]},{"id":"2d6cee5.a60a912","type":"debug","z":"19b9fb23.993845","name":"Test both off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1230,"y":360,"wires":[]},{"id":"7287225c.c96b5c","type":"join","z":"19b9fb23.993845","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"1","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":120,"wires":[["a93ff5a.7819408","c70a875c.ca3f58"]]},{"id":"3d881bc0.a54ee4","type":"inject","z":"19b9fb23.993845","name":"L on B on","props":[{"p":"payload.living.temperature","v":"1","vt":"num"},{"p":"payload.living.settemp","v":"2","vt":"num"},{"p":"payload.bedroom.temperature","v":"1","vt":"num"},{"p":"payload.bedroom.settemp","v":"2","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":80,"y":160,"wires":[["edf57538.f5e0d8"]]},{"id":"fcc3912f.b8e0b","type":"inject","z":"19b9fb23.993845","name":"L off B on","props":[{"p":"payload.living.temperature","v":"2","vt":"num"},{"p":"payload.living.settemp","v":"1","vt":"num"},{"p":"payload.bedroom.temperature","v":"1","vt":"num"},{"p":"payload.bedroom.settemp","v":"2","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":80,"y":300,"wires":[["edf57538.f5e0d8"]]},{"id":"55fda32a.16949c","type":"inject","z":"19b9fb23.993845","name":"L off B off","props":[{"p":"payload.living.temperature","v":"2","vt":"num"},{"p":"payload.living.settemp","v":"1","vt":"num"},{"p":"payload.bedroom.temperature","v":"2","vt":"num"},{"p":"payload.bedroom.settemp","v":"1","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":80,"y":360,"wires":[["edf57538.f5e0d8"]]}]

Thanks

To keep track of a state, it may be useful to store that state in a variable and use it for checks.

Example flow; won't work, but it can help to understand the logic

[{"id":"b3ab3f9e.a6ec28","type":"inject","z":"19b9fb23.993845","name":"livingroom t 19","props":[{"p":"temperature","v":"19","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"livingroom","x":176,"y":576,"wires":[["c49575af.18fc08"]]},{"id":"ec2d4d67.dde69","type":"debug","z":"19b9fb23.993845","name":"raise thermostat","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":576,"wires":[]},{"id":"212eafd4.9db8","type":"inject","z":"19b9fb23.993845","name":"bedroom t 19","props":[{"p":"temperature","v":"19","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"bedroom","x":166,"y":696,"wires":[["c49575af.18fc08"]]},{"id":"ca7ae194.0f67e8","type":"inject","z":"19b9fb23.993845","name":"livingroom t 22","props":[{"p":"temperature","v":"22","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"livingroom","x":176,"y":624,"wires":[["c49575af.18fc08"]]},{"id":"3bd1de8e.132e4a","type":"inject","z":"19b9fb23.993845","name":"bedroom t 22","props":[{"p":"temperature","v":"19","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"bedroom","x":166,"y":744,"wires":[["c49575af.18fc08"]]},{"id":"c49575af.18fc08","type":"switch","z":"19b9fb23.993845","name":"pump on ?","property":"pump","propertyType":"flow","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":672,"wires":[["711c2806.a3f2"],["3ec5d085.aa9738"]]},{"id":"711c2806.a3f2","type":"switch","z":"19b9fb23.993845","name":"temp?","property":"temperature","propertyType":"msg","rules":[{"t":"lt","v":"20","vt":"num"},{"t":"gte","v":"21","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":602,"y":624,"wires":[["ec2d4d67.dde69"],["fbfe9aad.2fdeb8"]]},{"id":"3ec5d085.aa9738","type":"switch","z":"19b9fb23.993845","name":"off - room","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"livingroom","vt":"str"},{"t":"eq","v":"bedroom","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":612,"y":744,"wires":[["56ec1fff.186678"],["6c4b95e7.fbcfa4"]]},{"id":"fbfe9aad.2fdeb8","type":"debug","z":"19b9fb23.993845","name":"lower thermostat","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":624,"wires":[]},{"id":"39de6398.c36564","type":"change","z":"19b9fb23.993845","name":"pump on","rules":[{"t":"set","p":"pump","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":924,"y":672,"wires":[["62c914dc.598aec"]]},{"id":"56ec1fff.186678","type":"switch","z":"19b9fb23.993845","name":"temp?","property":"temperature","propertyType":"msg","rules":[{"t":"lt","v":"20","vt":"num"},{"t":"gte","v":"21","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":770,"y":696,"wires":[["39de6398.c36564"],["7e6bd505.6a8b9c"]]},{"id":"7e6bd505.6a8b9c","type":"change","z":"19b9fb23.993845","name":"pump off","rules":[{"t":"set","p":"pump","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":924,"y":720,"wires":[["4d896a1c.6dfc4c"]]},{"id":"62c914dc.598aec","type":"debug","z":"19b9fb23.993845","name":"raise thermostat","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1112,"y":672,"wires":[]},{"id":"4d896a1c.6dfc4c","type":"debug","z":"19b9fb23.993845","name":"lower thermostat","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1122,"y":720,"wires":[]},{"id":"6c4b95e7.fbcfa4","type":"switch","z":"19b9fb23.993845","name":"temp?","property":"temperature","propertyType":"msg","rules":[{"t":"lt","v":"20","vt":"num"},{"t":"gte","v":"21","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":770,"y":768,"wires":[["582019b1.f09c48"],["ee9f9250.1ca128"]]},{"id":"582019b1.f09c48","type":"debug","z":"19b9fb23.993845","name":"raise thermostat","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":944,"y":768,"wires":[]},{"id":"ee9f9250.1ca128","type":"debug","z":"19b9fb23.993845","name":"lower thermostat","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":954,"y":816,"wires":[]}]

Can you describe the principle of your heating system a bit more in detail?

  • specifically, how do you expect hot water to flow to the bedroom if you do not start a pump??
  • or do you have a separate pump for the bedroom?

I'm used to water based heating systems where you might have floor heating on the groundfloor and radiators upstairs. In such case it is common to have a main pump and a separate pump and a blender for the floor heating

I'll check the flow later today. My idea was to store the values in a variable too yes, with a fail safe machanism. If there is missing an input, failsafe state = pump on.

The central heater has a pump, thats the main pump and controlled by the heater itself so the situation is as you describe. Mixer/pump in the living, another mixer/pump in a second downstairs room and radiators upstairs.

The floor downstairs is so well isolated that the living only requires heat in the morning.

So the idea is to have the living room thermostat fire the heater on & main pump on, but keep the pump on the mixer downstairs off.

OK, this is not exactly how you described it in your post :wink:

Have I understood it correctly that:

  • a "main pump" is always running keeping the circulation going in the "main" system, i.e. radiators
  • you have separate mixers/pumps for living room and downstairs respectively
  • those separate mixers/pumps are normally closed/turned off except when there is demand for heating (like in the morning)
  • living room thermostat controls the mixer/pump for living room
  • downstairs room??? Separate thermostat to control mixer/pump for downstairs???
  • with changing the set-point you mean the main set-point for the heating system?

If so, is it not enough just to change this main set-point if you need more (artificial) heat in the bedroom? I mean the circuits for living room and downstairs are anyway closed and they will open/turn on automatically when heating is needed

I did not tell the whole story because I did not want to make the question bigger than it already was. I've created a quick overview of my house with heating lines, pump and a valve for the second room downstairs controlled by a dumb thermostat.

2 Nest thermostats (Data available on the RPi4 via the Google API). The google API output of the Nest devices is basically the same as the injects nodes on the flow in the first post.

Main pump in the central heater only runs when the central heater is burning, it's controlled by the central heater.

2 separate mixers downstairs, with thermostatic valves to limit the inflow temperature to 40c. Pumps are both controllable with a Sonoff relay with Tasmota fw.
Inflow of heat into the second room is controlled by a dumb thermostat. The pump in the second room is activated in the morning, and only when the living room thermostat is requesting heat.

Living room thermostat only controls the central heating, so the pump of the livingroom is under my control.

The living room temperature does not really drop during the afternoon/evening so my idea was:
When the livingroom temp is equal or higher than the set temp and bedroom temperature is lower than the set temp (early evening). Disable the livingroompump for say, 30 minutes/1 hour. Kick up the living room set temp so the central heating starts heating (main pump automaticly on). Because the living room pump is not on, the living room temperature does not rise and the 2nd/3rd floor receive heat.

Does that make sense?

Yes, understod I hope...
Without understanding your complete system it is hard for anyone to give you the best possible advice (I could for instance not fully understand all possible flows the water can take and under which conditions)
So, yes, if the water is blocked from flowing into living rooms/downstairs and the heater and main pump starts, the hot water has to flow through the radiators in the bedroom
But as soon as the main pump stops, the water in the radiators will start cooling down pretty quickly. It would be much better if the water could keep circulating after the heater has turned off, at least until its temperature has dropped down to a certain level. Otherwise I assume you will just have a lot of hot water in a tank, slowly cooling down but not where you need to warm up

There is configurable after run time of the main pump in the central heater, I may have to play around with that to get the desired result.

First learn how I get those join and boolean AND nodes going (er achieve the same results with other nodes).

Looks like this evaluation flow is working on 2 outputs:

Had to fiddle a bit with the join nodes.

and the flow:

[{"id":"1b7b60bf.e5a7af","type":"join","z":"8c92d9a3.1d28b8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"0","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":240,"wires":[["ae51df1b.6f3c5"]]},{"id":"38a4695f.6292f6","type":"and-gate","z":"8c92d9a3.1d28b8","name":"a on b off","rules":[{"t":"true","propertyType":"msg","property":"payload.a","topic":"topic"},{"t":"false","propertyType":"msg","property":"payload.b","topic":"topic"}],"outputTopic":"topic","gateType":"and","emitOnlyIfTrue":false,"x":940,"y":180,"wires":[["5d80e391.0fe25c"]]},{"id":"ae51df1b.6f3c5","type":"and-gate","z":"8c92d9a3.1d28b8","name":"a off, b on","rules":[{"t":"false","propertyType":"msg","property":"payload.a","topic":"topic"},{"t":"true","propertyType":"msg","property":"payload.b","topic":"topic"}],"outputTopic":"test","gateType":"and","emitOnlyIfTrue":false,"x":940,"y":260,"wires":[["5cab1844.7bd9a8"]]},{"id":"25a1df67.82a3","type":"inject","z":"8c92d9a3.1d28b8","name":"A on B off","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":160,"wires":[["c91d00bc.c01b3","b45a6410.0d9318"]]},{"id":"90b97837.01c1f8","type":"switch","z":"8c92d9a3.1d28b8","name":"a","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":180,"wires":[["1b7b60bf.e5a7af"],["549540ac.28e2b"]]},{"id":"2303b32d.1399ec","type":"switch","z":"8c92d9a3.1d28b8","name":"b","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":260,"wires":[["549540ac.28e2b"],["1b7b60bf.e5a7af"]]},{"id":"b45a6410.0d9318","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"-1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"b","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":200,"wires":[["2303b32d.1399ec"]]},{"id":"c91d00bc.c01b3","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":120,"wires":[["90b97837.01c1f8"]]},{"id":"5cab1844.7bd9a8","type":"debug","z":"8c92d9a3.1d28b8","name":"a off b on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1100,"y":260,"wires":[]},{"id":"5d80e391.0fe25c","type":"debug","z":"8c92d9a3.1d28b8","name":"a on b off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1100,"y":180,"wires":[]},{"id":"549540ac.28e2b","type":"join","z":"8c92d9a3.1d28b8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"0","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":200,"wires":[["38a4695f.6292f6"]]},{"id":"61b6ecd1.e4dff4","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"-1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":260,"wires":[["90b97837.01c1f8"]]},{"id":"b7afa705.607438","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"b","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":340,"wires":[["2303b32d.1399ec"]]},{"id":"39e473e0.c0c1dc","type":"inject","z":"8c92d9a3.1d28b8","name":"B on A off","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":300,"wires":[["61b6ecd1.e4dff4","b7afa705.607438"]]}]

Is this a "common" practice to solve this? if someone has a cleaner solution? or comments and alternatives?

Hi, firstly, sorry if i am missing somthing (I have not read entire conversation).

Looking at your flow...

  • clicking the top button outputs {"a":1,"b":-1}
  • clicking the bottom button outputs {"a":-1,"b":1}

I am sure you realise this but you could simply do that in a change node or function node.
image

[{"id":"8f47f61c.e3e968","type":"inject","z":"10910de6.baa5c2","name":"A on B off","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":680,"y":320,"wires":[["d38293ba.71304"]]},{"id":"4cf79d6f.3d71e4","type":"inject","z":"10910de6.baa5c2","name":"B on A off","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":680,"y":380,"wires":[["4f834df4.c53994"]]},{"id":"4824bb17.e13e94","type":"debug","z":"10910de6.baa5c2","name":"a on b off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1000,"y":320,"wires":[]},{"id":"46847685.682088","type":"debug","z":"10910de6.baa5c2","name":"a off b on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1000,"y":380,"wires":[]},{"id":"d38293ba.71304","type":"change","z":"10910de6.baa5c2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"a\":1,\"b\":-1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":320,"wires":[["4824bb17.e13e94"]]},{"id":"4f834df4.c53994","type":"change","z":"10910de6.baa5c2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"a\":-1,\"b\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":380,"wires":[["46847685.682088"]]}]

Been looking at your first flow, I feel I would have tried a bit different approach and break it down in steps before combining everything into one flow

  1. Capturing the current temperature values in bedroom and livingroom, keeping them updated in flow variables

  2. Figure out if extra heating in bedrooms is "allowed". With an inject node run a check at some interval, testing if the temperature in living room is above it's set-point (then we know central heating is off). If so, keep a GATE node open, otherwise keep it closed

  3. With a second inject node run a check at some interval, testing if bedroom temperature is below it's set-point. If so, we know heating is required. Then
    a) block the living room pump for 30 minutes using a trigger node
    b) send a new living room set-point value to the GATE node. From the GATE node forward the temporary set-point value to the central heating system

When the bedroom has reached it's temperature set-point we
a) send the "normal" set-point value to the GATE node
b) the central heating will stop, the pump will do "after run time" so you make use of the heated water
c) the trigger node will unblock the living room pump when 30 minutes (or what you configured) has passed

As long as the GATE is open, heating of bedrooms will be allowed. If the central heating is heating the living room, this extra heating of bedrooms will be blocked

To avoid repeated messages of the same kind in the above functionality we would use rbe nodes where needed

A question: If the central heating is working in normal operation, does the heated water reach all rooms or just the living room?

1 Like

Thank you for your reply, but yes you are right. You missed something. The inject/change nodes on the left are just for simulation of expected values from another flow where the temperature and set temp data from 2 thermostats is processed.

1 Like

That makes more sense :angel:

So on that, then I would possibly simplify to ...

[{"id":"5cab1844.7bd9a8","type":"debug","z":"15d6405d.0fd1f","name":"a off b on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":860,"y":140,"wires":[]},{"id":"5d80e391.0fe25c","type":"debug","z":"15d6405d.0fd1f","name":"a on b off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":860,"y":100,"wires":[]},{"id":"9974c04d.f4543","type":"inject","z":"15d6405d.0fd1f","name":"a=1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"a","payload":"1","payloadType":"num","x":270,"y":100,"wires":[["7da28432.75dadc"]]},{"id":"748260ab.e775f","type":"inject","z":"15d6405d.0fd1f","name":"a=-1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"a","payload":"-1","payloadType":"num","x":270,"y":140,"wires":[["7da28432.75dadc"]]},{"id":"4110894d.33fba8","type":"inject","z":"15d6405d.0fd1f","name":"b=1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"b","payload":"1","payloadType":"num","x":270,"y":200,"wires":[["7da28432.75dadc"]]},{"id":"57e9db10.482694","type":"inject","z":"15d6405d.0fd1f","name":"b=-1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"b","payload":"-1","payloadType":"num","x":270,"y":240,"wires":[["7da28432.75dadc"]]},{"id":"7da28432.75dadc","type":"join","z":"15d6405d.0fd1f","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":510,"y":180,"wires":[["c7b1aced.84765"]]},{"id":"c7b1aced.84765","type":"switch","z":"15d6405d.0fd1f","name":"","property":"payload.a & \",\" & payload.b","propertyType":"jsonata","rules":[{"t":"eq","v":"1,-1","vt":"str"},{"t":"eq","v":"-1,1","vt":"str"},{"t":"eq","v":"1,1","vt":"str"},{"t":"eq","v":"-1,-1","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":630,"y":180,"wires":[["5d80e391.0fe25c"],["5cab1844.7bd9a8"],["66786b1d.b88514"],["57520d4f.df77a4"],["99cbb849.de4fa8"]],"outputLabels":["a=1, b=-1","a=-1, b=1","a=1, b=1","a=-1, b=-1","invalid"]},{"id":"66786b1d.b88514","type":"debug","z":"15d6405d.0fd1f","name":"a on b on (invalid)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":180,"wires":[]},{"id":"57520d4f.df77a4","type":"debug","z":"15d6405d.0fd1f","name":"a off b off (invalid)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":220,"wires":[]},{"id":"99cbb849.de4fa8","type":"debug","z":"15d6405d.0fd1f","name":"Something else (invalid)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":910,"y":260,"wires":[]},{"id":"abf4c2df.e9528","type":"comment","z":"15d6405d.0fd1f","name":"Simulating external values","info":"","x":310,"y":60,"wires":[]},{"id":"2e61b71c.1ceed8","type":"comment","z":"15d6405d.0fd1f","name":"Join and test a/b value","info":"","x":560,"y":120,"wires":[]},{"id":"1351faea.591115","type":"comment","z":"15d6405d.0fd1f","name":"Results (delete others if not needed)","info":"","x":940,"y":60,"wires":[]}]

Hopefully I havent missed the point a second time :smiley:

1 Like

That looks a lot simpler and clean with the JSONATA (I did not dive into that functionality, but that looks a nice tool), and the join you use does not "leak" other values thru as my flow with the 4 join nodes does.

[{"id":"8c92d9a3.1d28b8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"1b7b60bf.e5a7af","type":"join","z":"8c92d9a3.1d28b8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"0","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1010,"y":280,"wires":[["ae51df1b.6f3c5"]]},{"id":"38a4695f.6292f6","type":"and-gate","z":"8c92d9a3.1d28b8","name":"a on b off","rules":[{"t":"true","propertyType":"msg","property":"payload.a","topic":"topic"},{"t":"false","propertyType":"msg","property":"payload.b","topic":"topic"}],"outputTopic":"test","gateType":"and","emitOnlyIfTrue":false,"x":1200,"y":180,"wires":[["5d80e391.0fe25c"]]},{"id":"ae51df1b.6f3c5","type":"and-gate","z":"8c92d9a3.1d28b8","name":"a off, b on","rules":[{"t":"false","propertyType":"msg","property":"payload.a","topic":"topic"},{"t":"true","propertyType":"msg","property":"payload.b","topic":"topic"}],"outputTopic":"test","gateType":"and","emitOnlyIfTrue":false,"x":1200,"y":280,"wires":[["5cab1844.7bd9a8"]]},{"id":"25a1df67.82a3","type":"inject","z":"8c92d9a3.1d28b8","name":"A on B off","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":220,"y":160,"wires":[["c91d00bc.c01b3","b45a6410.0d9318"]]},{"id":"90b97837.01c1f8","type":"switch","z":"8c92d9a3.1d28b8","name":"a","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":200,"wires":[["549540ac.28e2b","6c4489fa.dc5e98"],["1b7b60bf.e5a7af","b72d0104.d01a9"]]},{"id":"2303b32d.1399ec","type":"switch","z":"8c92d9a3.1d28b8","name":"b","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":440,"wires":[["1b7b60bf.e5a7af","6c4489fa.dc5e98"],["549540ac.28e2b","b72d0104.d01a9"]]},{"id":"b45a6410.0d9318","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"b","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":200,"wires":[["2303b32d.1399ec"]]},{"id":"c91d00bc.c01b3","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"-1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":120,"wires":[["90b97837.01c1f8"]]},{"id":"5cab1844.7bd9a8","type":"debug","z":"8c92d9a3.1d28b8","name":"a off b on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1380,"y":280,"wires":[]},{"id":"5d80e391.0fe25c","type":"debug","z":"8c92d9a3.1d28b8","name":"a on b off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1380,"y":180,"wires":[]},{"id":"549540ac.28e2b","type":"join","z":"8c92d9a3.1d28b8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"0","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1010,"y":180,"wires":[["38a4695f.6292f6"]]},{"id":"61b6ecd1.e4dff4","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":260,"wires":[["90b97837.01c1f8"]]},{"id":"b7afa705.607438","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"-1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"b","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":340,"wires":[["2303b32d.1399ec"]]},{"id":"39e473e0.c0c1dc","type":"inject","z":"8c92d9a3.1d28b8","name":"A off B on","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":300,"wires":[["61b6ecd1.e4dff4","b7afa705.607438"]]},{"id":"71501bc2.c8e8d4","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":400,"wires":[["90b97837.01c1f8"]]},{"id":"b09faa40.fe45d8","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"b","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":480,"wires":[["2303b32d.1399ec"]]},{"id":"b4d798ea.7bbba8","type":"inject","z":"8c92d9a3.1d28b8","name":"A off B off","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":440,"wires":[["71501bc2.c8e8d4","b09faa40.fe45d8"]]},{"id":"9f4135d.1ebf5c8","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"-1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":540,"wires":[["90b97837.01c1f8"]]},{"id":"aee0ded8.00758","type":"change","z":"8c92d9a3.1d28b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"-1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"b","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":620,"wires":[["2303b32d.1399ec"]]},{"id":"5569bde5.a4ddd4","type":"inject","z":"8c92d9a3.1d28b8","name":"A on B on","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":580,"wires":[["9f4135d.1ebf5c8","aee0ded8.00758"]]},{"id":"6c4489fa.dc5e98","type":"join","z":"8c92d9a3.1d28b8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"0","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1010,"y":460,"wires":[["a867829e.89efb"]]},{"id":"b72d0104.d01a9","type":"join","z":"8c92d9a3.1d28b8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"0","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1010,"y":380,"wires":[["f51b889a.843558"]]},{"id":"f51b889a.843558","type":"and-gate","z":"8c92d9a3.1d28b8","name":"a off b off","rules":[{"t":"false","propertyType":"msg","property":"payload.a","topic":"topic"},{"t":"false","propertyType":"msg","property":"payload.b","topic":"topic"}],"outputTopic":"test","gateType":"and","emitOnlyIfTrue":false,"x":1200,"y":380,"wires":[["2c996c8a.a9b8d4"]]},{"id":"a867829e.89efb","type":"and-gate","z":"8c92d9a3.1d28b8","name":"a on, b on","rules":[{"t":"true","propertyType":"msg","property":"payload.a","topic":"topic"},{"t":"true","propertyType":"msg","property":"payload.b","topic":"topic"}],"outputTopic":"test","gateType":"and","emitOnlyIfTrue":false,"x":1200,"y":460,"wires":[["c015f33b.13996"]]},{"id":"c015f33b.13996","type":"debug","z":"8c92d9a3.1d28b8","name":"a on b on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1380,"y":460,"wires":[]},{"id":"2c996c8a.a9b8d4","type":"debug","z":"8c92d9a3.1d28b8","name":"a off b off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1380,"y":380,"wires":[]}]

Clicked the top a on/b off inject twice, then the 2nd (a off b on) on inject. I would expect 3 results in the debug:
a on b off
a on b off
a off b on

But this is the result:

Screen Shot 2020-11-15 at 13.51.53

Do you have an idea why the a off/ b off and a on and b on gates "leak" other results?

That's a method to consider yes. I was not yet at that point how I could block the living room pump from running, while upping the set temp to get the central heater going.

Your question, yes the main pump in the central heating pumps water to the first floor, from there water is flowing downstairs to the livingroom mixer and every radiator.

Here is my proposed solution

It works like this:

The "normal" set points for temperature in bedroom & living room is 22 degrees

Simulate that temp in livingroom is above 22 (click the button "23" in the livingroom simulator part). Now the gate should open. You should see messages like "22" and "pump unblock" in the debug log. Meaning that the set point for living room is set to 22 and the pump is unblocked. In this state, heating of bedrooms are "allowed"

Next simulate that the bedroom temp is below 22 (click the button "21" in the bedroom simulator part). You should see messages like "25" and "pump block" in the debug log. Meaning that the set point for living room is raised to 25 and the pump is blocked, causing the heating to start

Finally simulate that the bedroom temp is above 22 (click the button "23" in the bedroom simulator part). You should again see messages like "22" and "pump unblock" in the debug log. Meaning that the set point for living room is set back and the pump is unblocked, causing the heating to stop. If you can manage to allow the pump to make an after run I think would be good

You might like to have other "normal" set points than 22 degrees, you can modify this in the switch nodes

Obviously you have to replace the simulation with real temperature values from your thermostats and you have to replace the debug messages with real commands to adjust set points and to block/unblock the pump

EDIT: If the livingroom temp goes below it's set point (simulate using button "21") the gate will close and heating system is "owned" by livingroom control

[{"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":130,"y":100,"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":130,"y":160,"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":130,"y":310,"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":130,"y":430,"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":330,"y":130,"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":600,"y":100,"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":600,"y":160,"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":800,"y":130,"wires":[[]]},{"id":"e625b0a9.29fd","type":"comment","z":"bf12ff9c.cd354","name":"Livingroom temperature simulator","info":"","x":220,"y":60,"wires":[]},{"id":"39029dfd.2691b2","type":"comment","z":"bf12ff9c.cd354","name":"Bedroom temperature simulator","info":"","x":680,"y":60,"wires":[]},{"id":"1abc6ef6.6003e1","type":"gate","z":"bf12ff9c.cd354","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":650,"y":370,"wires":[["1d042495.1bcebb","6c61a7cf.b24548"]]},{"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":280,"y":310,"wires":[["d5272b26.14bc38"],["bb2fd4a1.0b63d8"]]},{"id":"6c61a7cf.b24548","type":"debug","z":"bf12ff9c.cd354","name":"Set Point living room","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":370,"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":460,"y":290,"wires":[["1abc6ef6.6003e1"]]},{"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":460,"y":330,"wires":[["1abc6ef6.6003e1"]]},{"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":270,"y":430,"wires":[["c8f9d5eb.5bd978"],["87068768.918818"]]},{"id":"87068768.918818","type":"change","z":"bf12ff9c.cd354","name":"Heat ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"25","tot":"str"},{"t":"set","p":"pump","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":450,"wires":[["1abc6ef6.6003e1"]]},{"id":"c8f9d5eb.5bd978","type":"change","z":"bf12ff9c.cd354","name":"Heat OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"22","tot":"str"},{"t":"set","p":"pump","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":410,"wires":[["1abc6ef6.6003e1"]]},{"id":"671780f2.d84a5","type":"debug","z":"bf12ff9c.cd354","name":"Pump block/unblock","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1060,"y":450,"wires":[]},{"id":"1d042495.1bcebb","type":"switch","z":"bf12ff9c.cd354","name":"","property":"pump","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":450,"wires":[["37262b3b.d33364"],["ae37c48d.efad88"]]},{"id":"37262b3b.d33364","type":"change","z":"bf12ff9c.cd354","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"pump block","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":430,"wires":[["671780f2.d84a5"]]},{"id":"ae37c48d.efad88","type":"change","z":"bf12ff9c.cd354","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"pump unblock","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":470,"wires":[["671780f2.d84a5"]]},{"id":"edce181c.1d15f8","type":"comment","z":"bf12ff9c.cd354","name":"Set points for living and bedroom is 22 degrees","info":"","x":260,"y":250,"wires":[]}]

Its because you have multiple parallel paths that multiply the messages.

Also, I personally avoid contrib nodes (like the AND and OR nodes you are using) when the built in nodes can do the job perfectly fine.

Is there an reason you insist on doing is way over what I gave you (or are you just curious)?

I think you misunderstood (or I was not clear) my post. Thank you for the example flow, that join and switch makes it a lot cleaner. I just wanted to understand why my solution did not work, it's in my genes to try to understand and do it better next time :wink:

Also checking @krambriw's solution. I did not use the gate node till now, looks like something that is very useful to reach my goal. Checking that as we speak.

I suspected as much. I am the same - i have a need to understand why :stuck_out_tongue:

glad it is of some use to you.

1 Like

@krambriw Which gate node is used in your flow?

I get this:

Screen Shot 2020-11-15 at 16.27.45

and a lot of gate nodes to choose from in the install (even my logic AND/OR is named GATE)