Hello. In my project I use a temperature controller https://flows.nodered.org/node/node-red-contrib-heater-controller controller works but ...! I noticed that when you remove the sensor physicaly. controller still works. that is, in the absence of a sensor, it displays the last measured temperature and continues to chase the set temperature. This is not very correct about security, I must emphasize it! I tried to deal with the problem myself, but my knowledge is not that great. I have some achievements but it is not the expected result. I want to send a message inside the function before the controller to stop it. This is a half solution because I send the controller the required temperature of 0 degrees. Please review what I am sending you. Thanks. Greetings. Sorry for bad english.
[{"id":"a5956592.9081b8","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"9a784ad1.0f5d28","type":"sensor-ds18b20","z":"a5956592.9081b8","name":"currentTemp","topic":"","sensorid":"10-0008037d9f05","timer":"10","repeat":false,"x":250,"y":40,"wires":[["9d4223c9.0dbf7"]]},{"id":"1e2a54c0.d7197b","type":"ui_heater_controller","z":"a5956592.9081b8","name":"heater","group":"f0b2787.55ae588","unit":"C","order":1,"width":"6","height":"4","topic":"","title":"","sliderMinValue":10,"sliderMaxValue":35,"sliderStep":0.5,"thresholdRising":0.5,"thresholdFalling":0.5,"calendar":"{\n \"Monday\": {\n \"00:00\": 19,\n \"06:20\": 22,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Tuesday\": {\n \"00:00\": 19,\n \"06:20\": 22,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Wednesday\": {\n \"00:00\": 19,\n \"06:20\": 22,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Thursday\": {\n \"00:00\": 19,\n \"06:20\": 22,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Friday\": {\n \"00:00\": 19,\n \"06:20\": 23,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Saturday\": {\n \"00:00\": 19,\n \"08:00\": 20,\n \"20:00\": 22,\n \"23:59\": 19\n },\n \"Sunday\": {\n \"00:00\": 19,\n \"08:00\": 20,\n \"20:00\": 22,\n \"23:59\": 19\n }\n}","x":550,"y":140,"wires":[["1f322d40.ee2bf3"]]},{"id":"9d4223c9.0dbf7","type":"change","z":"a5956592.9081b8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":40,"wires":[["1e2a54c0.d7197b","3d51c838.cd3138"]]},{"id":"1f322d40.ee2bf3","type":"debug","z":"a5956592.9081b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":140,"wires":[]},{"id":"eba7d818.df8288","type":"inject","z":"a5956592.9081b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":120,"wires":[["9a784ad1.0f5d28"]]},{"id":"3d51c838.cd3138","type":"debug","z":"a5956592.9081b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":630,"y":40,"wires":[]},{"id":"505c3c82.30d184","type":"inject","z":"a5956592.9081b8","name":"","topic":"currentTemp","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":360,"wires":[["7e01ff6.b9fe4"]]},{"id":"1b0ff112.61f38f","type":"inject","z":"a5956592.9081b8","name":"","topic":"userTargetValue","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":300,"wires":[["2d985f8e.4da7a"]]},{"id":"2d985f8e.4da7a","type":"debug","z":"a5956592.9081b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":430,"y":260,"wires":[]},{"id":"44ad131d.a7f17c","type":"debug","z":"a5956592.9081b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":360,"wires":[]},{"id":"d412a09c.acf4","type":"inject","z":"a5956592.9081b8","name":"","topic":"userTargetValue","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":180,"wires":[["1e2a54c0.d7197b"]]},{"id":"7e01ff6.b9fe4","type":"function","z":"a5956592.9081b8","name":"","func":"if (msg.payload === false){\nmsg.payload = (\"userTargetValue\"=0);\nreturn msg;\n} else {\nmsg.payload = \"off\";\nreturn msg;\n}\n\n ","outputs":1,"noerr":7,"x":430,"y":360,"wires":[["44ad131d.a7f17c"]]},{"id":"47d620c8.95907","type":"inject","z":"a5956592.9081b8","name":"","topic":"currentTemp","payload":"23","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":400,"wires":[["7e01ff6.b9fe4"]]},{"id":"b0eeec20.32012","type":"inject","z":"a5956592.9081b8","name":"","topic":"currentTemp","payload":"23","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":260,"wires":[["2d985f8e.4da7a"]]},{"id":"f0b2787.55ae588","type":"ui_group","z":"","name":"Pool","tab":"940b8076.c9a17","order":1,"disp":true,"width":"6","collapse":false},{"id":"940b8076.c9a17","type":"ui_tab","z":"","name":"Nest Thermostat sample","icon":"dashboard","order":1}]