Import of multiple flows, causes MQTT to oscillate between connected and disconnected state

I was developing a solution with multiple flows (eleven) on a Raspberry Pi 4 and reached a point with the visual editor was going out to lunch for extended periods of time. So I restarted node red in safe mode and exported each flow individually.

I then deleted all the flows and re-imported the first one that had a GUI and the UI web page would not display and the environment was still sluggish.

So I totally recreated the environment from scratch to start over again. Verified that the visual editor and UI web page was functional.

I then started importing my individual flows and was soon back to the point of the response time being very slow.

So I recreate the environment again and start to import my flows again, concentrating on the oldest most mature flows.

I was importing the individual flows as new flows each time. I noticed that each flow had to have a MQTT node reconfigured. After getting in two flows that used MQTT I noticed that each flow would oscillate between connected and disconnected for the MQTT nodes in the visual editor.

I then visited the hamburger and configuration nodes to see that there was multiples for mqtt-broker, so I deleted the extra configuration.

This causes the flow that the used the configuration to report an error on the MQTT nodes and have the mqtt host selection removed.

I then configured these nodes to point to the same broker configuration and redeployed.

This did not fix the oscillate between connected and disconnect problem.

Here are the flows that demonstrate the problem.

Hydronic heating GUI

[{"id":"2c8971dd.fc375e","type":"tab","label":"Hydronic heating GUI","disabled":false,"info":""},{"id":"ab0159b0.a0e0a8","type":"comment","z":"2c8971dd.fc375e","name":"Hydronic Dashboard Web Page","info":"","x":150,"y":20,"wires":[]},{"id":"9008b70f.f97fd8","type":"function","z":"2c8971dd.fc375e","name":"true/false on/off Conversion to Boolean","func":"if (msg.topic.includes(\"/relay\"))\n{\n    cmd = msg.payload.toLowerCase();\n    if (cmd === \"on\")\n    {\n        msg.payload = true;\n        return msg;\n    }\n    if (cmd === \"true\")\n    {\n        msg.payload = true;\n        return msg;\n    }\n    if (cmd === \"false\")\n    {\n        msg.payload = false;\n        return msg;\n    }\n    if (cmd === \"off\")\n    {\n        msg.payload = false;\n        return msg;\n    }\n}\nreturn null;","outputs":1,"noerr":0,"x":190,"y":300,"wires":[["8540177d.0e88a8"]]},{"id":"8540177d.0e88a8","type":"switch","z":"2c8971dd.fc375e","name":"Switch router","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"Zone1/relay","vt":"str"},{"t":"cont","v":"Zone2/relay","vt":"str"},{"t":"cont","v":"Zone3/relay","vt":"str"},{"t":"cont","v":"Zone4/relay","vt":"str"},{"t":"cont","v":"Zone5/relay","vt":"str"},{"t":"cont","v":"Zone6/relay","vt":"str"},{"t":"cont","v":"Stir/relay","vt":"str"},{"t":"cont","v":"Burner/relay","vt":"str"},{"t":"cont","v":"Engine/relay","vt":"str"},{"t":"cont","v":"Generator/relay","vt":"str"},{"t":"cont","v":"BurnerValve/relay","vt":"str"}],"checkall":"true","repair":false,"outputs":11,"x":250,"y":680,"wires":[["d5c4cb96.1e14a8"],["bf61fbe2.98bc28"],["bc7da947.542bd8"],["3a932964.e07136"],["f06a5391.a173"],["9761ad60.f869c"],["52bc70c8.019f9"],["35288b24.f503a4"],["abab7885.4607a8"],["f25b6b35.f45e18"],["4718b4cd.a4550c"]],"info":"Switch node to router MQQT messages to the appropiate relay pin\n"},{"id":"cf8c35b5.b9b248","type":"link in","z":"2c8971dd.fc375e","name":"","links":["d0b11d35.29843"],"x":495,"y":80,"wires":[["d5c4cb96.1e14a8"]]},{"id":"d0b11d35.29843","type":"link out","z":"2c8971dd.fc375e","name":"","links":["cf8c35b5.b9b248"],"x":615,"y":80,"wires":[]},{"id":"d5c4cb96.1e14a8","type":"ui_switch","z":"2c8971dd.fc375e","name":"Bedroom Manual Control","label":"Bedroom","tooltip":"Zone pump and fan control for Bedroom","group":"f774edbd.a2dde","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Zone1/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":540,"y":20,"wires":[["d0b11d35.29843","55c44c41.b9cb34"]]},{"id":"722530ef.2fa45","type":"link in","z":"2c8971dd.fc375e","name":"","links":["3c68e337.d62e5c"],"x":475,"y":200,"wires":[["bf61fbe2.98bc28"]]},{"id":"3c68e337.d62e5c","type":"link out","z":"2c8971dd.fc375e","name":"","links":["722530ef.2fa45"],"x":615,"y":200,"wires":[]},{"id":"bf61fbe2.98bc28","type":"ui_switch","z":"2c8971dd.fc375e","name":"Bathroom Manual Control","label":"Bathroom","tooltip":"Zone pump and fan control for Bathroom","group":"f774edbd.a2dde","order":2,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Zone2/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":540,"y":140,"wires":[["3c68e337.d62e5c","55c44c41.b9cb34"]]},{"id":"1cf1bd40.d4d6c3","type":"link in","z":"2c8971dd.fc375e","name":"","links":["3044f42.25ac50c"],"x":475,"y":320,"wires":[["bc7da947.542bd8"]]},{"id":"3044f42.25ac50c","type":"link out","z":"2c8971dd.fc375e","name":"","links":["1cf1bd40.d4d6c3"],"x":615,"y":320,"wires":[]},{"id":"bc7da947.542bd8","type":"ui_switch","z":"2c8971dd.fc375e","name":"Kitchen Manual Control","label":"Kitchen","tooltip":"","group":"f774edbd.a2dde","order":3,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Zone3/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":540,"y":260,"wires":[["3044f42.25ac50c","55c44c41.b9cb34"]]},{"id":"16a22554.a0975b","type":"link in","z":"2c8971dd.fc375e","name":"","links":["9e3cca6a.27e958"],"x":475,"y":440,"wires":[["3a932964.e07136"]]},{"id":"9e3cca6a.27e958","type":"link out","z":"2c8971dd.fc375e","name":"","links":["16a22554.a0975b"],"x":555,"y":440,"wires":[]},{"id":"3a932964.e07136","type":"ui_switch","z":"2c8971dd.fc375e","name":"Living Room Manual Control","label":"Living Room","tooltip":"Zone pump and fan control for Living Room","group":"f774edbd.a2dde","order":4,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Zone4/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":550,"y":380,"wires":[["9e3cca6a.27e958","55c44c41.b9cb34"]]},{"id":"9c5c5072.4b65f","type":"link in","z":"2c8971dd.fc375e","name":"","links":["ad4a1617.5d2e68"],"x":1055,"y":200,"wires":[["52bc70c8.019f9"]]},{"id":"ad4a1617.5d2e68","type":"link out","z":"2c8971dd.fc375e","name":"","links":["9c5c5072.4b65f"],"x":1135,"y":200,"wires":[]},{"id":"52bc70c8.019f9","type":"ui_switch","z":"2c8971dd.fc375e","name":"Hydronic Stir pump Manual Control","label":"Hydronic Stir pump","tooltip":"Hydronic Stir pump for glycol circulation","group":"f774edbd.a2dde","order":5,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Stir/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1150,"y":140,"wires":[["ad4a1617.5d2e68","55c44c41.b9cb34"]]},{"id":"b2110a9c.1c1638","type":"link in","z":"2c8971dd.fc375e","name":"","links":["5bc2df77.83e7c"],"x":1075,"y":480,"wires":[["abab7885.4607a8"]]},{"id":"5bc2df77.83e7c","type":"link out","z":"2c8971dd.fc375e","name":"","links":["b2110a9c.1c1638"],"x":1195,"y":480,"wires":[]},{"id":"abab7885.4607a8","type":"ui_switch","z":"2c8971dd.fc375e","name":"Engine Preheat Manual Control","label":"Engine Preheat","tooltip":"Engine Preheat pump","group":"f774edbd.a2dde","order":9,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Engine/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1140,"y":420,"wires":[["5bc2df77.83e7c","55c44c41.b9cb34"]]},{"id":"68170731.959aa8","type":"link in","z":"2c8971dd.fc375e","name":"","links":["17f79902.19ce27"],"x":1075,"y":620,"wires":[["f25b6b35.f45e18"]]},{"id":"17f79902.19ce27","type":"link out","z":"2c8971dd.fc375e","name":"","links":["68170731.959aa8"],"x":1195,"y":620,"wires":[]},{"id":"f25b6b35.f45e18","type":"ui_switch","z":"2c8971dd.fc375e","name":"Generator Preheat Manual Control","label":"Generator Preheat","tooltip":"Generator Preheat pump","group":"f774edbd.a2dde","order":10,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Generator/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1150,"y":560,"wires":[["55c44c41.b9cb34","17f79902.19ce27"]]},{"id":"eb93641c.943618","type":"link in","z":"2c8971dd.fc375e","name":"","links":["4caeaaab.80a404"],"x":1035,"y":320,"wires":[["35288b24.f503a4"]]},{"id":"4caeaaab.80a404","type":"link out","z":"2c8971dd.fc375e","name":"","links":["eb93641c.943618"],"x":1135,"y":320,"wires":[]},{"id":"35288b24.f503a4","type":"ui_switch","z":"2c8971dd.fc375e","name":"Diesel Boiler Manual Control","label":"Diesel Boiler","tooltip":"Diesel Boiler for glycol heating","group":"f774edbd.a2dde","order":6,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Burner/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1130,"y":280,"wires":[["4caeaaab.80a404","55c44c41.b9cb34"]]},{"id":"de8ca34e.36ef7","type":"link in","z":"2c8971dd.fc375e","name":"","links":["e62e021b.2e912"],"x":435,"y":560,"wires":[["f06a5391.a173"]]},{"id":"e62e021b.2e912","type":"link out","z":"2c8971dd.fc375e","name":"","links":["de8ca34e.36ef7"],"x":615,"y":560,"wires":[]},{"id":"f06a5391.a173","type":"ui_switch","z":"2c8971dd.fc375e","name":"Forward bays Manual Control","label":"Forward bays","tooltip":"Zone pump and fan control for Forward bays","group":"f774edbd.a2dde","order":7,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Zone5/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":560,"y":500,"wires":[["e62e021b.2e912","55c44c41.b9cb34"]]},{"id":"6f2204f3.5d9abc","type":"link in","z":"2c8971dd.fc375e","name":"","links":["48045faf.508a8"],"x":1015,"y":80,"wires":[["9761ad60.f869c"]]},{"id":"48045faf.508a8","type":"link out","z":"2c8971dd.fc375e","name":"","links":["6f2204f3.5d9abc"],"x":1195,"y":80,"wires":[]},{"id":"9761ad60.f869c","type":"ui_switch","z":"2c8971dd.fc375e","name":"Rear Bays Manual Control","label":"Rear Bays","tooltip":"Zone pump and fan control for Rear Bays","group":"f774edbd.a2dde","order":8,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/Zone6/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1130,"y":20,"wires":[["48045faf.508a8","55c44c41.b9cb34"]]},{"id":"e2221c7a.ace02","type":"mqtt in","z":"2c8971dd.fc375e","name":"MQTT Hydronic Heating hydronic/#","topic":"hydronic/#","qos":"2","datatype":"auto","broker":"7e5d3078.0d6f1","x":160,"y":160,"wires":[["9008b70f.f97fd8"]]},{"id":"55c44c41.b9cb34","type":"mqtt out","z":"2c8971dd.fc375e","name":"MQTT Hydronic Heating","topic":"","qos":"2","retain":"true","broker":"7e5d3078.0d6f1","x":1670,"y":300,"wires":[]},{"id":"4718b4cd.a4550c","type":"ui_switch","z":"2c8971dd.fc375e","name":"Diesel Boiler Valve Manual Control","label":"Diesel Boiler Diversion Valve","tooltip":"Diesel Boiler Diversion Valve for glycol heating","group":"f774edbd.a2dde","order":6,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"hydronic/BurnerValve/relay","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1150,"y":700,"wires":[["3a62197e.3db946","55c44c41.b9cb34"]]},{"id":"c3c6e258.4764d","type":"link in","z":"2c8971dd.fc375e","name":"","links":["3a62197e.3db946"],"x":1035,"y":740,"wires":[["4718b4cd.a4550c"]]},{"id":"3a62197e.3db946","type":"link out","z":"2c8971dd.fc375e","name":"","links":["c3c6e258.4764d"],"x":1135,"y":740,"wires":[]},{"id":"f774edbd.a2dde","type":"ui_group","z":"","name":"Manual Control","tab":"74343ae5.9cb4b4","order":1,"disp":true,"width":"6","collapse":false},{"id":"7e5d3078.0d6f1","type":"mqtt-broker","z":"","name":"Mosquitto","broker":"127.0.0.1","port":"1883","clientid":"NodeRed On Pi","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"74343ae5.9cb4b4","type":"ui_tab","z":"","name":"Hydronic Heating","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

Hydronic Heating Relays

[{"id":"b67332d2.6d629","type":"tab","label":"Hydronic Heating Relays","disabled":false,"info":"# Hydronic Heating Relay Control Flow\n\nThis flow manages the interactions between the MQTT broker and implements the required functionality.\n\nDesign objectives:\n\n - MQTT Centric in that all state information and events are persisted or orginated from MQTT\n - Allow manual over-ride of the activation of zones.\n - React to MQTT requests from other sources like HomeAssistant, Alexia or other flows.\n\n"},{"id":"40bae63c.d364c8","type":"mqtt in","z":"b67332d2.6d629","name":"MQTT Hydronic Heating","topic":"hydronic/#","qos":"2","datatype":"auto","broker":"7e5d3078.0d6f1","x":130,"y":80,"wires":[["cfe9b032.6e859","bccd213b.9d51e"]]},{"id":"9e2a424a.27a35","type":"comment","z":"b67332d2.6d629","name":"Hydronic Relay Control","info":"# Hydronic Heating Control Relays\n\nThe house raspberry pi located in the plumbing/electrical bay has numerous relays to control the functionality of Hydronic heating system.\n\nThere are six heating zones for:\n\n - Zone 1: Bedroom heater pump and fan\n - Zone 2: Bathroom heater pump and fan\n - Zone 3: Kitchen heater pump and fan\n - Zone 4: Living room heater pump.\n - Zone 5: Forward two bays freeze protection pump and fans\n - Zone 6: Rear two bays freeze protection pump and fans\n\nThere are three additional pumps for:\n\n - Stir/Circulation pump to even out temperature between the two heat storage tanks and provide hot coolant flow for the heat exchanger that provides hot water.\n - Pump for Engine preheating and thermosiphon heat recovery\n - Pump for Generator preheating and thermosiphon heat recovery\n - \n\nThere is an additional relay functionality to:\n\n - Turn on the diesel boiler\n - Control electric ball valve to force flow through the diesel boiler when it is on, bypass when off\n\nNote this last functionality is implemented with one control signal from the Raspberry Pi, driving three SPDT relays.\n\nFor the basic heart of the hydronic system there are three temperature sensors for:\n\n - hydronic tank output\n - engine heater circuit coolant\n - generator heater circuit coolant\n\nThe last two sensors are used the preheating and the thermosiphon heat recovery functionality.\n\n","x":120,"y":40,"wires":[]},{"id":"bbbbecca.9a93b","type":"switch","z":"b67332d2.6d629","name":"Switch Control Relays","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"Zone1/relay","vt":"str"},{"t":"cont","v":"Zone2/relay","vt":"str"},{"t":"cont","v":"Zone3/relay","vt":"str"},{"t":"cont","v":"Zone4/relay","vt":"str"},{"t":"cont","v":"Zone5/relay","vt":"str"},{"t":"cont","v":"Zone6/relay","vt":"str"},{"t":"cont","v":"Stir/relay","vt":"str"},{"t":"cont","v":"Burner/relay","vt":"str"},{"t":"cont","v":"Engine/relay","vt":"str"},{"t":"cont","v":"Generator/relay","vt":"str"},{"t":"cont","v":"BurnerValve/relay","vt":"str"}],"checkall":"true","repair":false,"outputs":11,"x":900,"y":180,"wires":[["e0a6998a.8da538"],["708cb457.b34c8c"],["13d54f08.ea8051"],["cfea9b59.96b8a8"],["be1fcec4.82c99"],["b0f32382.5baa7"],["860ab312.46a76"],["d3a339ca.e1c0c8"],["387f62dc.75065e"],["ee898e0a.bcb86"],["9cbc8327.4d84f"]],"info":"Switch node to router MQQT messages to the appropiate relay pin\n"},{"id":"e0a6998a.8da538","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Zone 1 GPIO17","pin":"11","set":true,"level":"1","freq":"","out":"out","x":1340,"y":20,"wires":[]},{"id":"708cb457.b34c8c","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Zone 2 GPIO27","pin":"13","set":true,"level":"1","freq":"","out":"out","x":1340,"y":80,"wires":[]},{"id":"13d54f08.ea8051","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Zone 3 GPIO22","pin":"15","set":true,"level":"1","freq":"","out":"out","x":1340,"y":140,"wires":[]},{"id":"cfea9b59.96b8a8","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Zone 4 GPIO10","pin":"19","set":true,"level":"1","freq":"","out":"out","x":1340,"y":200,"wires":[]},{"id":"be1fcec4.82c99","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Zone 5 GPIO09","pin":"21","set":true,"level":"1","freq":"","out":"out","x":1340,"y":260,"wires":[]},{"id":"b0f32382.5baa7","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Zone 6 GPIO11","pin":"23","set":true,"level":"1","freq":"","out":"out","x":1340,"y":320,"wires":[]},{"id":"860ab312.46a76","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Hydronic Stir Pump GPIO05","pin":"29","set":true,"level":"1","freq":"","out":"out","x":1380,"y":380,"wires":[]},{"id":"d3a339ca.e1c0c8","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Hydronic Burner GPIO19","pin":"35","set":true,"level":"1","freq":"","out":"out","x":1370,"y":440,"wires":[]},{"id":"387f62dc.75065e","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Engine Preheat GPIO31","pin":"31","set":true,"level":"1","freq":"","out":"out","x":1370,"y":500,"wires":[]},{"id":"ee898e0a.bcb86","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Generator preheat GPIO13","pin":"33","set":true,"level":"1","freq":"","out":"out","x":1380,"y":560,"wires":[]},{"id":"cfe9b032.6e859","type":"debug","z":"b67332d2.6d629","name":"MQTT message in","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":410,"y":40,"wires":[]},{"id":"bccd213b.9d51e","type":"function","z":"b67332d2.6d629","name":"true/false on/off Conversion to 0/1 for Active Low Relays","func":"if (msg.topic.includes(\"/relay\"))\n{\n    if (msg.payload === true)\n    {\n        msg.payload = \"0\";\n        return msg;\n    }\n    if (msg.payload === false)\n    {\n        msg.payload = \"1\";\n        return msg;\n    }\n    cmd = msg.payload.toLowerCase();\n    if (cmd === \"true\")\n    {\n        msg.payload = \"0\";\n        return msg;\n    }\n    if (cmd === \"on\")\n    {\n        msg.payload = \"0\";\n        return msg;\n    }\n    if (cmd === \"false\")\n    {\n        msg.payload = \"1\";\n        return msg;\n    }\n    if (cmd === \"off\")\n    {\n        msg.payload = \"1\";\n        return msg;\n    }\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":550,"y":180,"wires":[["bbbbecca.9a93b"]]},{"id":"5364b3c9.b20b6c","type":"mqtt out","z":"b67332d2.6d629","name":"MQTT Hydronic Heating","topic":"","qos":"2","retain":"true","broker":"7e5d3078.0d6f1","x":690,"y":720,"wires":[]},{"id":"22896649.30ab9a","type":"inject","z":"b67332d2.6d629","name":"Zone 1 on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone1/relay","payload":"true","payloadType":"bool","x":100,"y":140,"wires":[["5364b3c9.b20b6c"]]},{"id":"2ba3ce7.ace8f32","type":"inject","z":"b67332d2.6d629","name":"Zone 1 off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone1/relay","payload":"false","payloadType":"bool","x":100,"y":180,"wires":[["5364b3c9.b20b6c"]]},{"id":"c5e3abcb.dbdf48","type":"inject","z":"b67332d2.6d629","name":"Zone 2 on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone2/relay","payload":"true","payloadType":"str","x":100,"y":220,"wires":[["5364b3c9.b20b6c"]]},{"id":"40c21d0f.f71154","type":"inject","z":"b67332d2.6d629","name":"Zone 2 off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone2/relay","payload":"false","payloadType":"bool","x":100,"y":260,"wires":[["5364b3c9.b20b6c"]]},{"id":"9d9cae31.dd183","type":"inject","z":"b67332d2.6d629","name":"Zone 3 on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone3/relay","payload":"true","payloadType":"bool","x":100,"y":300,"wires":[["5364b3c9.b20b6c"]]},{"id":"c8b7562c.0a5fd8","type":"inject","z":"b67332d2.6d629","name":"Zone 3 off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone3/relay","payload":"false","payloadType":"bool","x":100,"y":340,"wires":[["5364b3c9.b20b6c"]]},{"id":"30dd86cc.bbcb5a","type":"inject","z":"b67332d2.6d629","name":"Stir on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Stir/relay","payload":"true","payloadType":"bool","x":90,"y":620,"wires":[["5364b3c9.b20b6c"]]},{"id":"262675bd.738c4a","type":"inject","z":"b67332d2.6d629","name":"Stir off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Stir/relay","payload":"false","payloadType":"bool","x":90,"y":660,"wires":[["5364b3c9.b20b6c"]]},{"id":"a501bb68.4f8508","type":"inject","z":"b67332d2.6d629","name":"Burner on","props":[{"p":"payload","v":"true","vt":"bool"},{"p":"topic","v":"hydronic/Burner/relay","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Burner/relay","payload":"true","payloadType":"bool","x":100,"y":700,"wires":[["5364b3c9.b20b6c"]]},{"id":"b8697a76.e580a8","type":"inject","z":"b67332d2.6d629","name":"Burner off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Burner/relay","payload":"false","payloadType":"bool","x":100,"y":740,"wires":[["5364b3c9.b20b6c"]]},{"id":"24d43474.5523bc","type":"inject","z":"b67332d2.6d629","name":"Engine Preheat on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Engine/relay","payload":"true","payloadType":"bool","x":130,"y":780,"wires":[["5364b3c9.b20b6c"]]},{"id":"cf081ca7.9b31c","type":"inject","z":"b67332d2.6d629","name":"Engine Preheat off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Engine/relay","payload":"false","payloadType":"bool","x":130,"y":820,"wires":[["5364b3c9.b20b6c"]]},{"id":"1c17fbf0.7b35c4","type":"inject","z":"b67332d2.6d629","name":"Generator Preheat on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Generator/relay","payload":"true","payloadType":"bool","x":140,"y":860,"wires":[["5364b3c9.b20b6c"]]},{"id":"3adfba2.613cc46","type":"inject","z":"b67332d2.6d629","name":"Generator Preheat off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Generator/relay","payload":"false","payloadType":"bool","x":140,"y":900,"wires":[["5364b3c9.b20b6c"]]},{"id":"cc5847a7.f83818","type":"inject","z":"b67332d2.6d629","name":"Zone 4 on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone4/relay","payload":"true","payloadType":"bool","x":100,"y":380,"wires":[["5364b3c9.b20b6c"]]},{"id":"13959db9.acf742","type":"inject","z":"b67332d2.6d629","name":"Zone 4 off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone4/relay","payload":"false","payloadType":"bool","x":100,"y":420,"wires":[["5364b3c9.b20b6c"]]},{"id":"7c0cb748.05f8b8","type":"inject","z":"b67332d2.6d629","name":"Zone 5 on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone5/relay","payload":"true","payloadType":"str","x":100,"y":460,"wires":[["5364b3c9.b20b6c"]]},{"id":"72f1843b.5e409c","type":"inject","z":"b67332d2.6d629","name":"Zone 5 off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone5/relay","payload":"false","payloadType":"bool","x":100,"y":500,"wires":[["5364b3c9.b20b6c"]]},{"id":"7a1258ea.64c788","type":"inject","z":"b67332d2.6d629","name":"Zone 6 on","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone6/relay","payload":"true","payloadType":"bool","x":100,"y":540,"wires":[["5364b3c9.b20b6c"]]},{"id":"a4f30958.7cb0b8","type":"inject","z":"b67332d2.6d629","name":"Zone 6 off","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/Zone6/relay","payload":"false","payloadType":"bool","x":100,"y":580,"wires":[["5364b3c9.b20b6c"]]},{"id":"c6b5b014.3fb75","type":"inject","z":"b67332d2.6d629","name":"Burner Valve on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/BurnerValve/relay","payload":"true","payloadType":"bool","x":120,"y":940,"wires":[["5364b3c9.b20b6c"]]},{"id":"be824d72.037bd","type":"inject","z":"b67332d2.6d629","name":"Burner Valve off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hydronic/BurnerValve/relay","payload":"false","payloadType":"bool","x":120,"y":980,"wires":[["5364b3c9.b20b6c"]]},{"id":"9cbc8327.4d84f","type":"rpi-gpio out","z":"b67332d2.6d629","name":"Hydronic BurnerValve GPIO 7","pin":"26","set":true,"level":"1","freq":"","out":"out","x":1390,"y":620,"wires":[]},{"id":"7e5d3078.0d6f1","type":"mqtt-broker","z":"","name":"Mosquitto","broker":"127.0.0.1","port":"1883","clientid":"NodeRed On Pi","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

The MQTT server is on the same host and access at 127.0.0.1 with login credentials.

The node red environment has the dashboard and RPI nodes installed.

I also tested with a separate node red installation that wasn't on a raspberry. Other then having to delete the rpi nodes in the second flow after import. I saw the same problem.

Hi @freds, welcome to the forum.

Firstly,

Your flow is not importable. it is important to surround your code with three backticks
```
like this
```

You can edit and correct your post by clicking the pencil icon.

See this post for more details - How to share code or flow json

Question. Do you have multiple MQTT configuration nodes with the same client ID set? Client ID must be unique or the broker will cause disconnects.

Almost certainly you have specified non-unique client IDs in the mqtt configs. They must be unique across the system. If you specified an id and then imported that flow to another system then the two may have the same id. Either make sure they are unique or leave them empty so that node red will provide unique values for you.
If you can't find them look in the mqtt server log and you should be able to see the offending systems.

I have edited my original post as suggested to correct the flows so that they should be importable now.

I also totally rebuilt the environment on a new Raspberry Pi and replicated the problem and found the magic invocation (workaround) to make it work correctly.

After importing three flows I have this under the mqtt-broker group.

The work around is to:

  1. Delete the extra MQTT configuration nodes that are added as a result of the import operation
  2. Visit each flow and configure each MQTT node to use a single broker.
  3. Deploy the modified flows.

As @Steve-Mcl and myself have pointed out, the connected/disconnected problem was not that you had multiple mqtt configuration nodes, but that you had multiple with the same client id, either in the same device or on other devices connected to the same broker.

If you had not filled in that field then you would not have had the problem.
It is better not to have multiple config nodes when they are not required, but that was not the cause of the symptom.

OK i understand that this is a bit of tribal knowledge that you have to learn.

My question is why does the import new flow process create multiple configuration nodes when there is an existing node of the same name?

Just because the node has the same name does not guarantee that it does not need to be imported. The fact that they have the same name may just be coincidence. For example you might import a flow that I have provided where I have given the config node the name 'mosquitto' but in that case it probably does need to be imported. However, I think that there is currently work in progress to make the import algorithm more intelligent in this area so things may improve at some point.

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