Connection Lost After Some Time

Since the reading is every 9 seconds now, it is not smooth. What can I do to solve this? The liquid can heat up fast, if the fans don't work for 9 seconds.

Edit: Also, I couldn't fix the OK/Cancel notification. Both options are shutting down the Pi. Here is the shutdown flow:

[{"id":"b699b242.275aa","type":"ui_button","z":"4cdd06f6.faf528","name":"","group":"843bc78a.c5b078","order":5,"width":0,"height":0,"passthru":false,"label":"Shutdown","tooltip":"","color":"","bgcolor":"","icon":"","payload":" ","payloadType":"str","topic":"Shutdown?","x":650,"y":520,"wires":[["4d82c2f5.fd5f2c"]]},{"id":"4d82c2f5.fd5f2c","type":"ui_toast","z":"4cdd06f6.faf528","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"Yes","cancel":"No","raw":false,"topic":"","name":"","x":810,"y":520,"wires":[["1415437.5d64bbd"]]},{"id":"1415437.5d64bbd","type":"exec","z":"4cdd06f6.faf528","command":"sudo shutdown -h now","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":1040,"y":520,"wires":[[],[],[]]},{"id":"843bc78a.c5b078","type":"ui_group","z":"","name":"logo","tab":"43cae785.290cd8","order":2,"disp":false,"width":"6","collapse":false},{"id":"43cae785.290cd8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

Edit: Carried this question alone to another post. If anyone is interested, here it is: