welcome @Andresc4
I have had issues with my esp8266's losing connection with either the pressure transducers connected and or my one wire temp sensors.
I created a "babysitting " flow that monitors my "sensor" mqtt messages.
if it gets the message like it is supposed to in a trigger node it waits 60 seconds before it sends a trigger saying mqtt messages stopped coming in. however if it keeps coming in like it is supposed to it does nothing.
I actuallly set it up to send an email to me when its back up and when it goes down.
I set up a gmail email just for monitoring errors.
I am fairly new to node red but I do run a brewing system from it and love Node-Red.
It's been addicting learning all the capabilities of node-red on how it can help me and help me help others.
attached is a flow.
I can walk you through what you need to change if needed. but this will get you going on monitoring your specific mqtt messages that seem to stop working.
also not this is also set to reboot the esp8266 so it can resync with your input devices connected to the esp8266
Keep in mind i use tasmota with my esp8266's so i didnt have to upload a code with arduino ide.
[{"id":"fe9d6e7861d88d65","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"683bee9bf72b5c31","type":"group","z":"fe9d6e7861d88d65","name":"Temp Sensor Baby sitting","style":{"stroke":"#000000","fill":"#bfdbef","label":true,"color":"#000000"},"nodes":["f716f8c2fdec4f8f","132a36d56fc6365a","b28545a0e6840e56","65d999f28ddb3c3e","806af3511ad100b6","fe44a097296be644","efc35da4f5ca30c3","d1d474e913e03daf","ef35a4d5efef66c6","bfb15d230e8b5b4d","bf095db852075129","e872f76981f1a2b9","87b5769933375420","1f26f5396fa01acf","e793aea4f5277060","7f21a7afae815ec8","063216bb1e227704","8b0d0f21b7085c35","808d3b57149f3e41","98dd613b6546063b","27b346e939184dfa","bf0deb414ca42770","5338d248d38744ad","6803e2d1d44b10b7","544c4fa49d3cab53","680d37e51c4f4b9a"],"x":30,"y":98,"w":1349.4999380111694,"h":476.829083442688},{"id":"fe44a097296be644","type":"e-mail","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"railhoperrors@gmail.com","dname":"","credentials":{},"x":659.7011022567749,"y":190.25610637664795,"wires":[]},{"id":"ef35a4d5efef66c6","type":"e-mail","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"railhoperrors@gmail.com","dname":"","credentials":{},"x":1243.4999380111694,"y":441.82908153533936,"wires":[]},{"id":"f716f8c2fdec4f8f","type":"inject","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"must change topic","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cmnd/YOURTOPIC/RESTART","payload":"1","payloadType":"num","x":609.5000905990601,"y":344.162410736084,"wires":[["132a36d56fc6365a"]]},{"id":"132a36d56fc6365a","type":"ui_button","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"needs your topic","group":"f5e2c3bf3d5a99b2","order":1,"width":0,"height":0,"passthru":true,"label":"REBOOT","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"str","topic":"cmnd/YOURTOPIC/RESTART","x":860.5000905990601,"y":217.1623821258545,"wires":[["d1d474e913e03daf"]]},{"id":"b28545a0e6840e56","type":"trigger","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"","op1":"Make a statement that works and makesense","op2":"On","op1type":"str","op2type":"str","duration":"60","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":328.5000066757202,"y":210.82907485961914,"wires":[["806af3511ad100b6","7f21a7afae815ec8","544c4fa49d3cab53"],["65d999f28ddb3c3e","132a36d56fc6365a","bf095db852075129","bf0deb414ca42770"]]},{"id":"65d999f28ddb3c3e","type":"debug","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"badsensor","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":526.5000905990601,"y":300.1623821258545,"wires":[]},{"id":"806af3511ad100b6","type":"debug","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"sensor good","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":426.1543912887573,"y":139,"wires":[]},{"id":"efc35da4f5ca30c3","type":"link in","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"either link or replace with mqtt in","links":["7c4cbc1a995ee8c7"],"x":71,"y":211.82907485961914,"wires":[["b28545a0e6840e56","808d3b57149f3e41"]]},{"id":"d1d474e913e03daf","type":"mqtt out","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"your topic needs to go here","topic":"cmnd/YOURTOPIC/RESTART","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"31a99116.50a74e","x":1129.50009059906,"y":222.1623821258545,"wires":[]},{"id":"bfb15d230e8b5b4d","type":"gate","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"default","x":1055.4999685287476,"y":418.8291301727295,"wires":[["8b0d0f21b7085c35","680d37e51c4f4b9a"]]},{"id":"bf095db852075129","type":"mytimeout","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"Close the Gate after a single message","outtopic":"","outsafe":"Sensor Failed your comments that tells you its not working","outwarning":"","outunsafe":"off","warning":"5","timer":"10","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":571.5000905990601,"y":512.8291301727295,"wires":[["bfb15d230e8b5b4d","e872f76981f1a2b9"],["87b5769933375420"]]},{"id":"e872f76981f1a2b9","type":"debug","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"After Timer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":977.4999380111694,"y":363.8290796279907,"wires":[]},{"id":"87b5769933375420","type":"change","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"Close the Gate","rules":[{"t":"set","p":"payload","pt":"msg","to":"Close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":914.4999303817749,"y":533.829083442688,"wires":[["bfb15d230e8b5b4d"]]},{"id":"1f26f5396fa01acf","type":"link in","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"Fermenter (East) Gate Control In","links":["e793aea4f5277060"],"x":926.4999380111694,"y":469.82907581329346,"wires":[["bfb15d230e8b5b4d"]]},{"id":"e793aea4f5277060","type":"link out","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"Fermenter (East) Out to Gate Control","mode":"link","links":["1f26f5396fa01acf"],"x":1037.4999990463257,"y":159.8290548324585,"wires":[]},{"id":"7f21a7afae815ec8","type":"change","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"Open The Gate after a Good Temperature Read","rules":[{"t":"set","p":"payload","pt":"msg","to":"Open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":727.4999380111694,"y":153.82910346984863,"wires":[["e793aea4f5277060"]]},{"id":"063216bb1e227704","type":"inject","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"Test Flow","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":169.50008296966553,"y":172.162446975708,"wires":[["b28545a0e6840e56"]]},{"id":"8b0d0f21b7085c35","type":"debug","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"After Gate","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1202.5001058578491,"y":398.16241455078125,"wires":[]},{"id":"808d3b57149f3e41","type":"debug","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":173.16674709320068,"y":259.8290777206421,"wires":[]},{"id":"98dd613b6546063b","type":"change","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":925.1668386459351,"y":261.8291301727295,"wires":[["d1d474e913e03daf","27b346e939184dfa"]]},{"id":"27b346e939184dfa","type":"debug","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1118.1667165756226,"y":271.829008102417,"wires":[]},{"id":"bf0deb414ca42770","type":"link out","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"Restart Out Link","mode":"link","links":["5338d248d38744ad"],"x":493.1667776107788,"y":246.829008102417,"wires":[]},{"id":"5338d248d38744ad","type":"link in","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"restart in link","links":["bf0deb414ca42770"],"x":809.1668386459351,"y":258.829008102417,"wires":[["98dd613b6546063b"]]},{"id":"6803e2d1d44b10b7","type":"comment","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","name":"Temp Sensor Babysitting","info":"this section controls email notifications if the temperature sensor stops reporting to the esp8266\nemails should be sent to railhoperrors@gmail.com\nths section of flow should also restart the esp8266\nto refresh connection with the ds18b20 temp sensor.","x":173.16680812835693,"y":523.8290548324585,"wires":[]},{"id":"544c4fa49d3cab53","type":"e-mail","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"","dname":"","x":590.51171875,"y":187.9238375,"wires":[]},{"id":"680d37e51c4f4b9a","type":"e-mail","z":"fe9d6e7861d88d65","g":"683bee9bf72b5c31","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"","dname":"","x":1205.5078010559082,"y":486.9277563095093,"wires":[]},{"id":"f5e2c3bf3d5a99b2","type":"ui_group","name":"Default","tab":"450ac4c9b5c2acc6","order":1,"disp":true,"width":"11","collapse":false},{"id":"31a99116.50a74e","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"450ac4c9b5c2acc6","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]