This is what @Colin was meaning:
[{"id":"b9924a74.4d98f8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"37cfbf3a.73feb","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"open","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":690,"y":960,"wires":[["b65e3427.d0f1a"]]},{"id":"b65e3427.d0f1a","type":"ui_switch","z":"b9924a74.4d98f8","name":"","label":"On/Off","tooltip":"","group":"4a387253.a6300c","order":33,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"open","onvalueType":"str","onicon":"","oncolor":"","offvalue":"close","offvalueType":"str","officon":"","offcolor":"","x":870,"y":990,"wires":[["2eb7254a.5392d2"]]},{"id":"69aef393.5aa95c","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"close","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":690,"y":1030,"wires":[["b65e3427.d0f1a"]]},{"id":"2eb7254a.5392d2","type":"debug","z":"b9924a74.4d98f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1030,"y":990,"wires":[]},{"id":"835c3a2c.a45628","type":"fs-ops-move","z":"b9924a74.4d98f8","name":"","sourcePath":"SourcePath","sourcePathType":"msg","sourceFilename":"SourceFile","sourceFilenameType":"msg","destPath":"Destination","destPathType":"msg","destFilename":"Month","destFilenameType":"msg","link":false,"x":590,"y":410,"wires":[[]]},{"id":"140ccd04.07e44b","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"Foo","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":410,"wires":[["74ce89f0.fe53d8"]]},{"id":"daedbe47.cc0ef8","type":"debug","z":"b9924a74.4d98f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":580,"y":360,"wires":[]},{"id":"74ce89f0.fe53d8","type":"function","z":"b9924a74.4d98f8","name":"","func":"msg = {\"_msgid\":\"cdbc874.5066578\",\"topic\":\"\",\"payload\":[\"AC_In.db\"],\"Month\":\"Jun_AC_In.db\",\"SourceFile\":\"AC_In.db\",\"directory\":\"2020\",\"path\":\"/home/me/TEMP/TEMP/\",\"SourcePath\":\"/home/me/TEMP/TEMP/\",\"Destination\":\"/home/me/TEMP/TEMP/2020\"}\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":410,"wires":[["835c3a2c.a45628","daedbe47.cc0ef8"]]},{"id":"51de51af.9d1848","type":"comment","z":"b9924a74.4d98f8","name":"Erase all data by using clearData command","info":"","x":277,"y":1949,"wires":[]},{"id":"8843ad3.515b5d","type":"comment","z":"b9924a74.4d98f8","name":"Format Table using ui_control","info":"","x":227,"y":2102,"wires":[]},{"id":"6f020d17.cd6e14","type":"ui_template","z":"b9924a74.4d98f8","group":"48d9dd9c.267f3c","name":"SETUP","order":32,"width":0,"height":0,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<style>\n :root {\n --dashboard-unit-width: 48px;\n --dashboard-unit-height: 48px;\n }\n /* This is the normal button definition */\n .GButton{\n background-color: black !important;\n color: #cccccc !important;\n /*height: 100%;*/\n height: var(--dashboard-unit-height);\n width: 100%;\n border-radius: 10px;\n font-size:1.0em;\n font-weight:normal;\n margin: 0;\n min-height: 36px;\n min-width: unset;\n line-height: unset;\n }\n /* This is for wide buttons */\n .GButtonW{\n background-color: black !important;\n color: white !important;\n height: var(--dashboard-unit-height);\n width: 100%;\n border-radius: 10px;\n font-size:0.7em;\n font-weight:bold;\n margin: 0;\n min-height: 36px;\n min-width: unset;\n line-height: unset;\n }\n .GButton2{\n background-color: black !important;\n color: #cccccc !important;\n /*height: calc(var(--dashboard-unit-height) * 2);*/\n height: calc((var(--dashboard-unit-height) * 2) + 6px);\n width: 100%;\n border-radius: 10px;\n font-size:1.0em;\n font-weight:normal;\n margin: 0;\n min-height: 36px;\n min-width: unset;\n line-height: unset;\n }\n .GButton3{\n background-color: black !important;\n color: #cccccc !important;\n /*height: calc(var(--dashboard-unit-height) * 2);*/\n height: calc((var(--dashboard-unit-height) * 3) + ((3 - 1) * 6px));\n width: 100%;\n border-radius: 10px;\n font-size:1.0em;\n font-weight:normal;\n margin: 0;\n min-height: 36px;\n min-width: unset;\n line-height: unset;\n }\n\n\n\n .nr-dashboard-theme-dark ui-card-panel {\n \tbackground-color: #222;\n \toutline: 1px solid #cccccc;\n }\n</style>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"global","x":300,"y":500,"wires":[[]]},{"id":"3a750c40.6e9f04","type":"ui_template","z":"b9924a74.4d98f8","group":"4a387253.a6300c","name":"","order":34,"width":"3","height":"3","format":"<div id=\"regular\">\n <md-button class=\"md-button GButton3\" style=\"background-color:#34495e\" ng-click=\"send({payload: 'toggle'})\"> \n Telemetry\n </md-button> \n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":190,"y":620,"wires":[[]]},{"id":"8133ada3.2c5108","type":"ui_template","z":"b9924a74.4d98f8","d":true,"group":"53792891.774238","name":"","order":6,"width":"2","height":"1","format":"<div id=\"{{'thediv_'+$id}}\"></div>\n<script>\n(function($scope) {\n setTimeout(function() {\n //debugger\n $scope.init();\n },100);\n \n $scope.init = function () {\n var d = document.getElementById('thediv_'+$scope.$id)\n var parent = d.parentElement\n console.log('width: '+parent.style.width)\n console.log('height: '+parent.style.height)\n }\n \n})(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":550,"y":540,"wires":[[]]},{"id":"c7de52e5.60838","type":"ui_template","z":"b9924a74.4d98f8","group":"48d9dd9c.267f3c","name":"MT","order":33,"width":0,"height":0,"format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":100,"y":500,"wires":[[]]},{"id":"ec35c74d.a1e47","type":"ui_template","z":"b9924a74.4d98f8","group":"4a387253.a6300c","name":"","order":35,"width":"3","height":"1","format":"<div id=\"regular\">\n <md-button class=\"md-button GButton\" style=\"background-color:#34495e\" ng-click=\"send({payload: 'toggle'})\"> \n Telemetry\n </md-button> \n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":390,"y":620,"wires":[[]]},{"id":"e55aed8d.46e4b8","type":"ui_template","z":"b9924a74.4d98f8","group":"4a387253.a6300c","name":"","order":36,"width":"3","height":"1","format":"<div id=\"regular\">\n <md-button class=\"md-button GButton\" style=\"background-color:#34495e\" ng-click=\"send({payload: 'toggle'})\"> \n Telemetry\n </md-button> \n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":390,"y":670,"wires":[[]]},{"id":"56efc78f.112d18","type":"ui_template","z":"b9924a74.4d98f8","group":"4a387253.a6300c","name":"","order":37,"width":"3","height":"1","format":"<div id=\"regular\">\n <md-button class=\"md-button GButton\" style=\"background-color:#34495e\" ng-click=\"send({payload: 'toggle'})\"> \n Telemetry\n </md-button> \n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":390,"y":720,"wires":[[]]},{"id":"6e34db77.2b6de4","type":"ui_template","z":"b9924a74.4d98f8","group":"533d5a60.43abdc","name":"style","order":3,"width":0,"height":0,"format":"<style id=\"dash-override\">\n :root{\n --dashboard-unit-height:48px\n }\n .scalebutton{\n background-color: black !important;\n color: #cccccc !important;\n height: unset;\n width: 100%;\n border-radius: 10px;\n font-size:1.0em;\n font-weight:normal;\n margin: 0;\n min-height: 36px;\n min-width: unset;\n line-height: unset;\n }\n .heightOne{\n height: calc((var(--dashboard-unit-height) * 1));\n }\n .heightTwo{\n height: calc((var(--dashboard-unit-height) * 2) + ((2 - 1) * 6px));\n }\n .heightThree{\n height: calc((var(--dashboard-unit-height) * 3) + ((3 - 1) * 6px));\n }\n</style>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"global","x":120,"y":1010,"wires":[[]]},{"id":"dc89ef3c.faf558","type":"ui_template","z":"b9924a74.4d98f8","group":"533d5a60.43abdc","name":"4x2","order":6,"width":"4","height":"2","format":"<div id=\"{{'thediv_'+$id}}\">\n <md-button id=\"{{'btn_'+$id}}\" class=\"md-button scalebutton\">\n BUTTON LABEL\n </md-button>\n</div>\n<script>\n(function($scope) {\n setTimeout(function() {\n //debugger\n $scope.init();\n },100);\n \n $scope.init = function () {\n var d = document.getElementById('thediv_'+$scope.$id)\n var parent = d.parentElement\n var size = parent.getAttribute('ui-card-size').split('x')\n console.log(size)\n var w = parseInt(size[0])\n var h = parseInt(size[1])\n var classToAdd = h == 1 ? 'heightOne' : h == 2 ? 'heightTwo' : 'heightThree'\n var b = document.getElementById('btn_'+$scope.$id)\n b.classList.add(classToAdd)\n \n\n }\n \n})(scope);\n</script>\n\n\n\n\n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":120,"y":890,"wires":[[]]},{"id":"2b8849e2.51dffe","type":"ui_template","z":"b9924a74.4d98f8","group":"533d5a60.43abdc","name":"2x3","order":6,"width":"2","height":"3","format":"<div id=\"{{'thediv_'+$id}}\">\n <md-button id=\"{{'btn_'+$id}}\" class=\"md-button scalebutton\">\n BUTTON LABEL\n </md-button>\n</div>\n<script>\n(function($scope) {\n setTimeout(function() {\n //debugger\n $scope.init();\n },100);\n \n $scope.init = function () {\n var d = document.getElementById('thediv_'+$scope.$id)\n var parent = d.parentElement\n var size = parent.getAttribute('ui-card-size').split('x')\n console.log(size)\n var w = parseInt(size[0])\n var h = parseInt(size[1])\n var classToAdd = h == 1 ? 'heightOne' : h == 2 ? 'heightTwo' : 'heightThree'\n var b = document.getElementById('btn_'+$scope.$id)\n b.classList.add(classToAdd)\n \n\n }\n \n})(scope);\n</script>\n\n\n\n\n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":120,"y":930,"wires":[[]]},{"id":"3206c3a3.7d9e74","type":"ui_template","z":"b9924a74.4d98f8","group":"533d5a60.43abdc","name":"3x1","order":6,"width":"3","height":"1","format":"<div id=\"{{'thediv_'+$id}}\">\n <md-button id=\"{{'btn_'+$id}}\" class=\"md-button scalebutton\">\n BUTTON LABEL\n </md-button>\n</div>\n<script>\n(function($scope) {\n setTimeout(function() {\n //debugger\n $scope.init();\n },100);\n \n $scope.init = function () {\n var d = document.getElementById('thediv_'+$scope.$id)\n var parent = d.parentElement\n var size = parent.getAttribute('ui-card-size').split('x')\n console.log(size)\n var w = parseInt(size[0])\n var h = parseInt(size[1])\n var classToAdd = h == 1 ? 'heightOne' : h == 2 ? 'heightTwo' : 'heightThree'\n var b = document.getElementById('btn_'+$scope.$id)\n b.classList.add(classToAdd)\n \n\n }\n \n})(scope);\n</script>\n\n\n\n\n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":120,"y":970,"wires":[[]]},{"id":"b00c2af6.fc2da","type":"comment","z":"b9924a74.4d98f8","name":"Interesting *","info":"From Hotnipi for different height buttons.","x":130,"y":850,"wires":[]},{"id":"982fbd3c.301c6","type":"moment","z":"b9924a74.4d98f8","name":"","topic":"","input":"","inputType":"msg","inTz":"Australia/Sydney","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYY-ww","locale":"en_AU","output":"","outputType":"msg","outTz":"Australia/Sydney","x":140,"y":1460,"wires":[["62aafd0e.362ca4"]]},{"id":"62aafd0e.362ca4","type":"change","z":"b9924a74.4d98f8","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"directory","tot":"msg"},{"t":"set","p":"path","pt":"msg","to":"log_paths","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":1460,"wires":[["3e82214c.4f5e56","74dc3090.9cd47"]]},{"id":"2951533c.fc233c","type":"inject","z":"b9924a74.4d98f8","name":"Weekly","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":1380,"wires":[["2dcb01c2.836abe","b387aa5e.e7d998"]]},{"id":"3e82214c.4f5e56","type":"template","z":"b9924a74.4d98f8","name":"add to paths","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{{path}}}reboot","output":"str","x":540,"y":1460,"wires":[["6be3a710.d9bf6","5df568be.38c1f"]]},{"id":"74dc3090.9cd47","type":"debug","z":"b9924a74.4d98f8","name":"RAW","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":380,"y":1420,"wires":[]},{"id":"6be3a710.d9bf6","type":"function","z":"b9924a74.4d98f8","name":"Build stuff","func":"//msg.SourcePath = msg.path + \"reboot\";\nmsg.SourcePath = msg.payload;\nmsg.Destination = msg.payload + \"/\" + msg.directory;\nreturn msg;","outputs":1,"noerr":0,"x":110,"y":1500,"wires":[["2b790b29.f00e74"]]},{"id":"5df568be.38c1f","type":"debug","z":"b9924a74.4d98f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":700,"y":1460,"wires":[]},{"id":"2b790b29.f00e74","type":"fs-ops-dir","z":"b9924a74.4d98f8","name":"","path":"SourcePath","pathType":"msg","filter":"Rebooted at*","filterType":"str","dir":"payload","dirType":"msg","x":330,"y":1500,"wires":[["2cc39458.0f7294"]]},{"id":"2cc39458.0f7294","type":"switch","z":"b9924a74.4d98f8","name":"","property":"payload[0]","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":520,"y":1500,"wires":[["84c35525.13d6d8"]]},{"id":"84c35525.13d6d8","type":"fan","z":"b9924a74.4d98f8","x":700,"y":1500,"wires":[["43b19e01.8af518","12daa301.5caa3d","cf2dee61.6eb37"]]},{"id":"43b19e01.8af518","type":"fs-ops-mkdir","z":"b9924a74.4d98f8","name":"","path":"SourcePath","pathType":"msg","dirname":"directory","dirnameType":"msg","mode":"777","fullpath":"directory","fullpathType":"msg","x":130,"y":1540,"wires":[["3bfacdcc.1f1f12"]]},{"id":"12daa301.5caa3d","type":"delay","z":"b9924a74.4d98f8","name":"Delay","pauseType":"delay","timeout":"2","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":100,"y":1580,"wires":[["9d56f252.d02b88","5bdf7e06.a9d24"]]},{"id":"cf2dee61.6eb37","type":"debug","z":"b9924a74.4d98f8","name":"OUT","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":890,"y":1500,"wires":[]},{"id":"3bfacdcc.1f1f12","type":"debug","z":"b9924a74.4d98f8","name":"1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":320,"y":1540,"wires":[]},{"id":"9d56f252.d02b88","type":"split","z":"b9924a74.4d98f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":320,"y":1580,"wires":[["454ab5ea.50fba4","a4d345c6.645068"]]},{"id":"454ab5ea.50fba4","type":"debug","z":"b9924a74.4d98f8","name":"1d","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":530,"y":1620,"wires":[]},{"id":"b387aa5e.e7d998","type":"change","z":"b9924a74.4d98f8","name":"TEMP/foo","rules":[{"t":"set","p":"log_paths","pt":"global","to":"/home/me/TEMP/foo/","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":1380,"wires":[[]]},{"id":"5bdf7e06.a9d24","type":"debug","z":"b9924a74.4d98f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":320,"y":1620,"wires":[]},{"id":"cbca0f4f.b40aa8","type":"exec","z":"b9924a74.4d98f8","command":"mv {{msg.SourcePath}}/Rebooted* {{msg.Destination}}","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":540,"y":1680,"wires":[[],[],[]]},{"id":"a1604aa7.b3fdb8","type":"template","z":"b9924a74.4d98f8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"mv {{SourcePath}}/Rebooted* {{Destination}}","output":"str","x":170,"y":1760,"wires":[["b37e39fa.564a88"]]},{"id":"b37e39fa.564a88","type":"debug","z":"b9924a74.4d98f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":370,"y":1760,"wires":[]},{"id":"9a4e8d9a.70665","type":"template","z":"b9924a74.4d98f8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"This is the payload: {{payload}} !","output":"str","x":250,"y":1820,"wires":[[]]},{"id":"a4d345c6.645068","type":"fs-ops-move","z":"b9924a74.4d98f8","name":"","sourcePath":"SourcePath","sourcePathType":"msg","sourceFilename":"payload","sourceFilenameType":"msg","destPath":"Destination","destPathType":"msg","destFilename":"payload","destFilenameType":"msg","link":false,"x":540,"y":1580,"wires":[[]]},{"id":"2dcb01c2.836abe","type":"delay","z":"b9924a74.4d98f8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":100,"y":1420,"wires":[["982fbd3c.301c6"]]},{"id":"b8b96a5a.b58a68","type":"comment","z":"b9924a74.4d98f8","name":"2020 06 10 Working.","info":"","x":520,"y":1350,"wires":[]},{"id":"101620da.dd9def","type":"inject","z":"b9924a74.4d98f8","name":"Your message","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":2630,"wires":[["ab588538.5d8fc8"]]},{"id":"77c3a40d.cf1914","type":"inject","z":"b9924a74.4d98f8","name":"Stop","topic":"control","payload":"Stop","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":2450,"wires":[["ab588538.5d8fc8"]]},{"id":"bfdfa379.3510d8","type":"inject","z":"b9924a74.4d98f8","name":"Go","topic":"control","payload":"Go","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":2500,"wires":[["ab588538.5d8fc8"]]},{"id":"5d54f15f.bd2fa8","type":"debug","z":"b9924a74.4d98f8","name":"Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":550,"y":2630,"wires":[]},{"id":"ab588538.5d8fc8","type":"function","z":"b9924a74.4d98f8","name":"","func":"if (msg.topic == \"control\")\n{\n context.set(\"allow\",msg.payload);\n return;\n}\nvar x = context.get(\"allow\")\nif (x == \"Stop\")\n{\n return;\n}\nelse\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":2630,"wires":[["5d54f15f.bd2fa8"]]},{"id":"1bde9e00.2cbbca","type":"comment","z":"b9924a74.4d98f8","name":"Phone","info":"","x":120,"y":3490,"wires":[]},{"id":"199b1fa.76c636","type":"comment","z":"b9924a74.4d98f8","name":"Computer","info":"","x":540,"y":3490,"wires":[]},{"id":"4d9e86f6.cedc7","type":"comment","z":"b9924a74.4d98f8","name":"Phone","info":"","x":840,"y":3490,"wires":[]},{"id":"a13d71bc.75cb5","type":"inject","z":"b9924a74.4d98f8","name":"Button 1","topic":"","payload":"Button 1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":3560,"wires":[["65b44057.d8c938"]]},{"id":"65b44057.d8c938","type":"mqtt out","z":"b9924a74.4d98f8","name":"","topic":"Button1","qos":"","retain":"","broker":"378c0403.8cda04","x":260,"y":3560,"wires":[]},{"id":"95f30a24.0a1808","type":"mqtt in","z":"b9924a74.4d98f8","name":"","topic":"Topic1","qos":"2","datatype":"auto","broker":"378c0403.8cda04","x":390,"y":3560,"wires":[["87adc0cb.0ea23"]]},{"id":"e843ca1a.d0efa","type":"mqtt out","z":"b9924a74.4d98f8","name":"","topic":"State1","qos":"","retain":"","broker":"378c0403.8cda04","x":680,"y":3560,"wires":[]},{"id":"7a45093b.a0367","type":"mqtt in","z":"b9924a74.4d98f8","name":"State1","topic":"State1","qos":"2","datatype":"auto","broker":"378c0403.8cda04","x":800,"y":3560,"wires":[["a3e0593e.a412f8"]]},{"id":"87adc0cb.0ea23","type":"function","z":"b9924a74.4d98f8","name":"Do stuff here","func":"\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":3560,"wires":[["e843ca1a.d0efa"]]},{"id":"a3e0593e.a412f8","type":"debug","z":"b9924a74.4d98f8","name":"Indicator 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":940,"y":3560,"wires":[]},{"id":"8dd4a8b0.631a68","type":"switch","z":"b9924a74.4d98f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"button 1","vt":"str"},{"t":"cont","v":"button 2","vt":"str"},{"t":"cont","v":"button 3","vt":"str"},{"t":"cont","v":"button 4","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":430,"y":3830,"wires":[[],[],[],[]]},{"id":"4a387253.a6300c","type":"ui_group","z":"","name":"SPARE","tab":"de5134a7.f0a0d","order":3,"disp":true,"width":"6","collapse":false},{"id":"48d9dd9c.267f3c","type":"ui_group","z":"","d":true,"name":"Full_Remote","tab":"b128eb09.9f681","order":1,"disp":false,"width":"3","collapse":false},{"id":"53792891.774238","type":"ui_group","name":"Group 7","tab":"de5134a7.f0a0d","order":4,"disp":true,"width":6},{"id":"533d5a60.43abdc","type":"ui_group","z":"","name":"Default","tab":"51cd257f.61873c","order":1,"disp":true,"width":"6","collapse":false},{"id":"378c0403.8cda04","type":"mqtt-broker","z":"","name":"MQTT HOST","broker":"192.168.0.99","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"de5134a7.f0a0d","type":"ui_tab","name":"Tab 6","icon":"dashboard","order":5},{"id":"b128eb09.9f681","type":"ui_tab","z":"","name":"HDMI_TV_control","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"51cd257f.61873c","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
As the idea.
(Oh and I goofed with the code you posted. I forgot to scroll and see it all.)
There is nothing wrong with what @Colin said and how it works.
Other than you will have to use another node to then determine if the button is uit
or aan
.
If you can find a way to add a topic
to the message being sent you can remove that need because there will be two parts to the message:
The topic
will identify the button and the payload
will be the state.
So as is, you have the first switch
node. That splits the incoming message into the 4 button states.
On each output of that switch
node, you (may) need another switch
to switch the message or a function
node to look at the message and act depending on the condition.
With a topic
you would send it into a node
and the conditional testing would not be needed.
Just saying.
It is a bit of "swings and roundabouts" (give and take) where you want to do what.
At the end of the day it has to be done somewhere.
Just one way the message has to parsed twice to determine the state.
The other way it is parsed once and the condition is given.