@zenofmud and @molesworth you are correct about always returning the one msg. The issue was and still is, when that node gets a msg from the mqtt node I get no output. So I added the last piece to see if my logic was failing or what. Turns out it is not a logic issue, the node receives the msg but doesn't out put anything,
@Steve-Mcl I googled destroy object and while I am confident I can blow up small villages now I still don't understand the nuances of your statement.
Also, I'm not sure how you can test my flow since it works with the inject nodes but not with mqtt. Do you have someway to input into the mqtt node?
Here's the flow..
[{"id":"3202129f.965a9e","type":"tab","label":"Garage","disabled":false,"info":""},{"id":"2911c558.0e32ba","type":"mqtt in","z":"3202129f.965a9e","name":"temp c","topic":"Gout_tempC","qos":"2","datatype":"auto","broker":"6fbbc66a.737958","x":210,"y":160,"wires":[["be401294.d77ab8"]]},{"id":"be401294.d77ab8","type":"function","z":"3202129f.965a9e","name":"temp C","func":"let z = Number(msg.payload);\nz = z.toFixed(2); \nmsg = {\n payload: 'Deg C ' + z,\n topic: 'tempC',\n}\n\nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":160,"wires":[["10192b9d.7462ec"]]},{"id":"e9152864.b9f088","type":"mqtt in","z":"3202129f.965a9e","name":"temp F","topic":"Gout_tempF","qos":"2","datatype":"auto","broker":"6fbbc66a.737958","nl":false,"rap":false,"x":210,"y":240,"wires":[["d272cf84.0923e"]]},{"id":"d272cf84.0923e","type":"function","z":"3202129f.965a9e","name":"temp F","func":"let z = Number(msg.payload);\nz = z.toFixed(2); \nmsg = {\n payload: 'Deg F ' + z,\n topic: 'tempF',\n}\n \n \nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":240,"wires":[["6accbfac.669eb"]]},{"id":"9669f95d.519588","type":"mqtt in","z":"3202129f.965a9e","name":"limit switch","topic":"OnLimitSwitch","qos":"2","datatype":"auto","broker":"6fbbc66a.737958","nl":false,"rap":false,"x":220,"y":300,"wires":[["80dec21e.e4b18","f3b571fd5059739f"]]},{"id":"80dec21e.e4b18","type":"function","z":"3202129f.965a9e","name":"limit switch","func":"var message = msg.payload;\nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\nif(message == \"on\"){\n msg.payload = \"door open\";\n}\nif (message == \"off\") {\n msg.payload = \"door closed\";\n}\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":300,"wires":[["17f7d5f9.bbddf2"]]},{"id":"17f7d5f9.bbddf2","type":"ui_template","z":"3202129f.965a9e","group":"b2e45b14.e88998","name":"limit switch","order":1,"width":0,"height":0,"format":"<div>\n <md-button class=\"md-button mine-button\"\n data-topic=\"target\"\n data-payload=\"1\">{{msg.payload}}\n </md-button>\n</div>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":930,"y":300,"wires":[[]]},{"id":"39de04a9.004564","type":"function","z":"3202129f.965a9e","name":"humid","func":"let z = Number(msg.payload);\nz = z.toFixed(2); \nmsg = {\n payload: 'RH% ' + z,\n topic: 'humid',\n}\n\nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":100,"wires":[["cca0f12e.33553"]]},{"id":"14be87a5.d6e988","type":"mqtt in","z":"3202129f.965a9e","name":"humid","topic":"Gout_humid","qos":"2","datatype":"auto","broker":"6fbbc66a.737958","nl":false,"rap":false,"x":210,"y":100,"wires":[["39de04a9.004564"]]},{"id":"10192b9d.7462ec","type":"ui_template","z":"3202129f.965a9e","group":"b2e45b14.e88998","name":"temp C","order":3,"width":0,"height":0,"format":"<div>\n <md-button class=\"md-button mine-button\"\n data-topic=\"target\"\n data-payload=\"1\">{{msg.payload}}\n </md-button>\n</div>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":920,"y":160,"wires":[[]]},{"id":"cca0f12e.33553","type":"ui_template","z":"3202129f.965a9e","group":"b2e45b14.e88998","name":"humid","order":2,"width":0,"height":0,"format":"<div>\n <md-button class=\"md-button mine-button\"\n data-topic=\"target\"\n data-payload=\"1\">{{msg.payload}}\n </md-button>\n</div>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":910,"y":100,"wires":[[]]},{"id":"6accbfac.669eb","type":"ui_template","z":"3202129f.965a9e","group":"b2e45b14.e88998","name":"temp F","order":4,"width":0,"height":0,"format":"<div>\n <md-button class=\"md-button mine-button\"\n data-topic=\"target\"\n data-payload=\"1\">{{msg.payload}}\n </md-button>\n</div>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":920,"y":240,"wires":[[]]},{"id":"f3b571fd5059739f","type":"function","z":"3202129f.965a9e","name":"test","func":"\n node.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":360,"wires":[[]]},{"id":"ea573274bafe4774","type":"inject","z":"3202129f.965a9e","name":"off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":140,"y":400,"wires":[["80dec21e.e4b18"]]},{"id":"d839df954907737a","type":"inject","z":"3202129f.965a9e","name":"on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":110,"y":360,"wires":[["80dec21e.e4b18"]]},{"id":"6fbbc66a.737958","type":"mqtt-broker","name":"127.0.0.1","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"b2e45b14.e88998","type":"ui_group","name":"Door","tab":"16fd26cf.f8ed21","order":1,"disp":false,"width":6,"collapse":false},{"id":"16fd26cf.f8ed21","type":"ui_tab","name":"Garage","icon":"fa-heart","order":10,"disabled":false,"hidden":false}]
Thanks everyone