I dont use the function node I use a switch node to do the same thing with tasmota
here is my flow so you can se how switch and send via mqtt to the tasmota device.
hope it helps.
[{"id":"42679c25e0ab1dac","type":"group","z":"f6858fe416b029b9","name":"Temperature Control and Display","style":{"stroke":"#000000","fill":"#ff3f3f","fill-opacity":"0.5","label":true,"color":"#000000"},"nodes":["7b80bace1d0cd39c","61361f911b19a76e","4c217d7881d00220","3a2db2a0c7778fc8","881e4777b34ff769","5f1af4bdbb6329c1","f5fcd670b289ea0c","c1b01f876dc2ed36","a13f3a6176478861","bff7a59440748e61","ddf87a246001fa19","4a3d02db5f7634b3","f3ca0662edb2ae15","faf61f13c8219e63","41667d802010a9b4","73dc7c328fbbb9ef","bcaab2257d1000d8","3642f4dbd9bb6c6a","23c7fac620f2e72c","6e6da8a7b6f17e61","951c014c3ec56118","7ada087262a58bc0","f4cb4fb0be2e7308","3b552afa115ebb2a","6560000b22dea7bd"],"x":105.01174354553223,"y":508.68225145339966,"w":1572.445930480957,"h":315.0936346054077},{"id":"7b80bace1d0cd39c","type":"ui_digital_display","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","group":"10c36bea9197e264","order":3,"width":4,"height":1,"digits":5,"decimals":1,"x":849.5760822296143,"y":721.6171879768372,"wires":[]},{"id":"61361f911b19a76e","type":"change","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"set payload to Temperature value","rules":[{"t":"move","p":"payload.Temperature","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560.0207233428955,"y":632.6840825080872,"wires":[["7b80bace1d0cd39c","faf61f13c8219e63","73dc7c328fbbb9ef","bcaab2257d1000d8","3642f4dbd9bb6c6a"]]},{"id":"4c217d7881d00220","type":"split","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":312.1280879974365,"y":590.6588997840881,"wires":[["6e6da8a7b6f17e61","6560000b22dea7bd"]]},{"id":"3a2db2a0c7778fc8","type":"change","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Wtarget","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":339.92217445373535,"y":767.1319766044617,"wires":[["881e4777b34ff769","5f1af4bdbb6329c1"]]},{"id":"881e4777b34ff769","type":"debug","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":511.3086795806885,"y":782.7758860588074,"wires":[]},{"id":"5f1af4bdbb6329c1","type":"change","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","rules":[{"t":"set","p":"Wtarget","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":526.9379825592041,"y":745.3046374320984,"wires":[[]]},{"id":"f5fcd670b289ea0c","type":"switch","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","property":"Wtarget","propertyType":"global","rules":[{"t":"gte","v":"Wambient","vt":"global"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1033.6908283233643,"y":755.1046147346497,"wires":[["c1b01f876dc2ed36","bff7a59440748e61"],["a13f3a6176478861"]]},{"id":"c1b01f876dc2ed36","type":"change","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1192.1393146514893,"y":743.1761479377747,"wires":[["ddf87a246001fa19","41667d802010a9b4"]]},{"id":"a13f3a6176478861","type":"change","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1187.3099689483643,"y":777.0070195198059,"wires":[["4a3d02db5f7634b3","41667d802010a9b4"]]},{"id":"bff7a59440748e61","type":"debug","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1148.9682941436768,"y":686.6391606330872,"wires":[]},{"id":"ddf87a246001fa19","type":"debug","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1416.4327716827393,"y":699.5537724494934,"wires":[]},{"id":"4a3d02db5f7634b3","type":"debug","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1561.4576740264893,"y":773.5910649299622,"wires":[]},{"id":"f3ca0662edb2ae15","type":"ui_dropdown","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","label":"","tooltip":"","place":"Select option","group":"10c36bea9197e264","order":5,"width":4,"height":1,"passthru":true,"multiple":false,"options":[{"label":"Lager","value":"55","type":"str"},{"label":"Ale","value":"68","type":"str"},{"label":"Dyacetal Rest","value":"70","type":"str"},{"label":"Cold crash","value":"38","type":"str"},{"label":"Off","value":"200","type":"str"},{"label":"kolsch","value":"65","type":"str"}],"payload":"","topic":"target_temperature","x":191.01174354553223,"y":766.6822962760925,"wires":[["3a2db2a0c7778fc8"]]},{"id":"faf61f13c8219e63","type":"change","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","rules":[{"t":"set","p":"Wambient","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":833.4967365264893,"y":756.5100102424622,"wires":[["f5fcd670b289ea0c"]]},{"id":"41667d802010a9b4","type":"change","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"cmnd/Wferm/POWER","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1411.5079669952393,"y":746.4166874885559,"wires":[["3b552afa115ebb2a"]]},{"id":"73dc7c328fbbb9ef","type":"ui_template","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","group":"10c36bea9197e264","name":"West Fermenter","order":12,"width":6,"height":6,"format":"<div id=\"{{'gauge_'+$id}}\" class=\"g-container\" style=\"--gauge-value:0; --container-size:6; --gn-distance:14; --ga-tick-count:10; --ga-subtick-count:100; --g-unit:''\">\n <div id=\"bgr\" class=\"g-body\">\n <div class=\"g-ring\">\n <div class=\"g-rivets\">\n <div class=g-rivet></div>\n <div class=g-rivet></div>\n <div class=g-rivet></div>\n <div class=g-rivet></div>\n </div>\n <div class=\"g-plate\">\n <div class=\"g-ticks\">\n <div class=\"g-tick\" style=\"--ga-tick:1;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:3;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:5;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:7;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:9;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:11;\"></div>\n </div>\n <div class=\"g-ticks\">\n <div class=\"g-subtick\" style=\"--ga-tick:11;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:31;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:51;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:71;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:91;\"></div>\n </div>\n <div class=\"g-nums\">\n <div class=\"g-num\" style=\"--ga-tick:1;\" >0</div>\n <div class=\"g-num\" style=\"--ga-tick:3;\">20</div>\n <div class=\"g-num\" style=\"--ga-tick:5;\">40</div>\n <div class=\"g-num\" style=\"--ga-tick:7;\">60</div>\n <div class=\"g-num\" style=\"--ga-tick:9;\">80</div>\n <div class=\"g-num\" style=\"--ga-tick:11;\">100</div>\n </div>\n <div class=\"g-label\">West Fermenter</div>\n <div class=\"g-needle\"></div>\n <div class=\"g-needle-ring\"></div>\n <div id=\"{{'gauge_val_'+$id}}\" class=\"g-val\"></div>\n </div>\n </div>\n </div>\n</div>\n<script>\n(function(scope) {\n let min = 0;\n let max = 100;\n scope.$watch('msg', function(msg) {\n if (msg) {\n // Do something when msg arrives\n const v = Math.floor(((msg.payload - min) / (max - min)) * 100);\n document.getElementById('gauge_'+scope.$id).style.setProperty('--gauge-value', v);\n document.getElementById('gauge_val_'+scope.$id).innerText = v+\"°F\";\n }\n \n });\n})(scope);\n</script>\n","storeOutMessages":true,"fwdInMessages":false,"resendOnRefresh":true,"templateScope":"local","x":873.0204181671143,"y":688.6840214729309,"wires":[[]]},{"id":"bcaab2257d1000d8","type":"ui_digital_display","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","group":"3e395b874f5be5a8","order":3,"width":0,"height":0,"digits":5,"decimals":1,"x":806.0119953155518,"y":583.3489384651184,"wires":[]},{"id":"3642f4dbd9bb6c6a","type":"ui_template","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","group":"3e395b874f5be5a8","name":"4x4 - quater - top - left","order":4,"width":4,"height":4,"format":"<div class=\"g-wrapper g-wrapper-label-0\">\n\n<div id=\"{{'gauge_'+$id}}\" class=\"g-container\" style=\"--gauge-value:100; --container-size:4; --gn-distance:28; --ga-tick-count:10; --ga-subtick-count:100; --g-unit:'°F'\">\n <div id=\"bgr\" class=\"g-body quarter-top-left\">\n <div class=\"g-ring\">\n <div class=\"g-plate\">\n <div class=\"g-ticks\">\n <div class=\"g-tick\" style=\"--ga-tick:1;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:2;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:3;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:4;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:5;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:6;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:7;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:8;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:9;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:10;\"></div>\n <div class=\"g-tick\" style=\"--ga-tick:11;\"></div>\n </div>\n <div class=\"g-ticks\">\n <div class=\"g-subtick\" style=\"--ga-tick:2;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:3;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:4;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:5;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:6;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:7;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:8;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:9;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:10;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:12;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:13;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:14;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:15;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:16;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:17;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:18;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:19;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:20;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:22;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:23;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:24;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:25;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:26;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:27;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:28;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:29;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:30;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:32;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:33;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:34;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:35;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:36;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:37;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:38;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:39;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:40;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:42;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:43;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:44;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:45;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:46;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:47;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:48;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:49;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:50;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:52;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:53;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:54;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:55;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:56;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:57;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:58;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:59;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:60;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:62;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:63;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:64;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:65;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:66;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:67;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:68;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:69;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:70;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:72;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:73;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:74;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:75;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:76;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:77;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:78;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:79;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:80;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:82;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:83;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:84;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:85;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:86;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:87;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:88;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:89;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:90;\"></div>\n \n <div class=\"g-subtick\" style=\"--ga-tick:92;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:93;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:94;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:95;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:96;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:97;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:98;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:99;\"></div>\n <div class=\"g-subtick\" style=\"--ga-tick:100;\"></div>\n </div>\n <div class=\"g-nums\">\n <div class=\"g-num\" style=\"--ga-tick:1;\" >0</div>\n\n <div class=\"g-num\" style=\"--ga-tick:3;\">20</div>\n\n <div class=\"g-num\" style=\"--ga-tick:5;\">40</div>\n\n <div class=\"g-num\" style=\"--ga-tick:7;\">60</div>\n\n <div class=\"g-num\" style=\"--ga-tick:9;\">80</div>\n\n <div class=\"g-num\" style=\"--ga-tick:11;\">100</div>\n </div>\n <div class=\"g-label\">West FERM</div>\n <div class=\"g-needle\"></div>\n <div class=\"g-needle-ring\"></div>\n </div>\n <div class=\"g-val-ring\">\n <div class=\"g-val-plate\"></div>\n <div id=\"{{'gauge_val_'+$id}}\" class=\"g-val\"></div>\n </div>\n </div>\n </div>\n</div>\n</div>\n<script>\n(function(scope) {\n let min = 0;\n let max = 100;\n scope.$watch('msg', function(msg) {\n if (msg) {\n // Do something when msg arrives\n const val = msg.payload\n const v = max + (((val - min) / (max - min)) * 100);\n document.getElementById('gauge_'+scope.$id).style.setProperty('--gauge-value', v);\n document.getElementById('gauge_val_'+scope.$id).innerText = val.toFixed(1);\n }\n \n });\n})(scope);\n</script>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":825.6783771514893,"y":618.3489384651184,"wires":[[]]},{"id":"23c7fac620f2e72c","type":"link in","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"Sensor In","links":["8d94228d93e5b07b"],"x":210.51173973083496,"y":589.6295418739319,"wires":[["4c217d7881d00220"]]},{"id":"6e6da8a7b6f17e61","type":"debug","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490.51175117492676,"y":569.6822514533997,"wires":[]},{"id":"951c014c3ec56118","type":"debug","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":465.5117435455322,"y":682.6822552680969,"wires":[]},{"id":"7ada087262a58bc0","type":"comment","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"Display Tab UI's","info":"","x":807.0117511749268,"y":549.6822514533997,"wires":[]},{"id":"f4cb4fb0be2e7308","type":"comment","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"Brewery Tab Ui's","info":"","x":906.0117511749268,"y":654.6822514533997,"wires":[]},{"id":"3b552afa115ebb2a","type":"link out","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"Wferm to mqtt out","mode":"link","links":["fdde7cd3d4a6c237"],"x":1596.2675800323486,"y":623.8759354820252,"wires":[]},{"id":"6560000b22dea7bd","type":"switch","z":"f6858fe416b029b9","g":"42679c25e0ab1dac","name":"West","property":"payload.Id","propertyType":"msg","rules":[{"t":"cont","v":"3C01D607FD9D","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":255.01172065734863,"y":647.0156073570251,"wires":[["61361f911b19a76e"],[]]},{"id":"10c36bea9197e264","type":"ui_group","name":"WestFermenter2new","tab":"a74ffe3d.4eb73","order":5,"disp":true,"width":24,"collapse":false},{"id":"3e395b874f5be5a8","type":"ui_group","name":"Fermenter West","tab":"b9dd4549c2e0e031","order":6,"disp":true,"width":"6","collapse":false},{"id":"a74ffe3d.4eb73","type":"ui_tab","name":"Brewery","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"b9dd4549c2e0e031","type":"ui_tab","name":"Display","icon":"dashboard","disabled":false,"hidden":false}]