Yeah, ok.
Thanks.
But (I know: I'm taking this too literally) when I did what you said, it crashed and burned.
(No offense)
But it throws a spanner in the works for me.
Using your node as best I can understand.
My node
Code:
[{"id":"12e8f83cb0ca06a5","type":"function","z":"9dc4f25c091456e7","name":"function 8","func":"msg = \n { \"delay\": 120000, \"origPayload\": \"[\\\"Marys_Farm_2.4\\\", \\\"Marys_Farm_2.4\\\", \\\"Optus_ABA172_5GHz\\\", \\\"Marys_Farm_5\\\", \\\"Optus_ABA172\\\", \\\"TelstraCA5E31\\\", \\\"\\\\\\\\x00\\\\\\\\x00\\\\\\\\x00\\\\\\\\x00\\\\\\\\x00\\\\\\\\x00\\\\\\\\x00\\\\\\\\x00\\\\\\\\x00\\\", \\\"WiFi-AFB6\\\", \\\"PiNet\\\", \\\"MyRepublic 49D9\\\", \\\"WiFi-F852-5G\\\", \\\"WiFi-F852\\\", \\\"WiFi-AFB6-5G\\\"]\", \"settings\": { \"input\": \"2022-12-29T01:05:09.987Z\", \"input_format\": \"\", \"input_tz\": \"Australia/Sydney\", \"output_format\": \"YYYY-MM-DD HH:mm:ss\", \"output_locale\": \"en_AU\", \"output_tz\": \"Australia/Sydney\" }, \"time\": \"2022-12-29 12:05:09\", \"payload\": \"2022-12-29 12:05:09 Main - Up\", \"parts\": { \"id\": \"65a01a72889a1b8b\", \"type\": \"string\", \"ch\": \",\", \"index\": 1, \"count\": 13 }, \"_msgid\": \"78d70cd5afd842b2\", \"_event\": \"node:59d4324dd537c9e8\", \"state\": \"Up\", \"filename\": \"/media/pi/9020-9C27/events/main.db\", \"device\": \"Main\" }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":480,"wires":[["5ba78680e4db67c3","3ac66f31b7991a30","a0ad6fcbc14eefed","4d22b8e3dfa753bc"]]},{"id":"c611da12474cc64f","type":"inject","z":"9dc4f25c091456e7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":480,"wires":[["12e8f83cb0ca06a5"]]},{"id":"5ba78680e4db67c3","type":"debug","z":"9dc4f25c091456e7","name":"Payload","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":400,"wires":[]},{"id":"f01425be1c6b6365","type":"mqtt out","z":"9dc4f25c091456e7","name":"","topic":"test","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"8941f4c3.0f151","x":690,"y":480,"wires":[]},{"id":"f626d563d1d359cd","type":"mqtt in","z":"9dc4f25c091456e7","name":"","topic":"test","qos":"2","datatype":"auto-detect","broker":"8941f4c3.0f151","nl":false,"rap":true,"rh":0,"inputs":0,"x":840,"y":480,"wires":[["0bbde8f77929d592","e1d27bc5107c467e"]]},{"id":"97e5c5e6f7b8313a","type":"debug","z":"9dc4f25c091456e7","name":"debug 55","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1150,"y":480,"wires":[]},{"id":"3ac66f31b7991a30","type":"debug","z":"9dc4f25c091456e7","name":"FULL","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":540,"y":360,"wires":[]},{"id":"4d22b8e3dfa753bc","type":"function","z":"9dc4f25c091456e7","name":"My function node here","func":"let msg2 = {};\nmsg2.payload = {\"payload\":msg.payload,\"state\":msg.state};\nreturn msg2;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":560,"wires":[["ad528e22a4e5ca79","f01425be1c6b6365"]]},{"id":"0bbde8f77929d592","type":"debug","z":"9dc4f25c091456e7","name":"debug 56","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":980,"y":430,"wires":[]},{"id":"ad528e22a4e5ca79","type":"debug","z":"9dc4f25c091456e7","name":"My effort on what to send.","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1000,"y":610,"wires":[]},{"id":"a0ad6fcbc14eefed","type":"debug","z":"9dc4f25c091456e7","name":"State","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"state","targetType":"msg","statusVal":"","statusType":"auto","x":540,"y":440,"wires":[]},{"id":"e1d27bc5107c467e","type":"function","z":"9dc4f25c091456e7","name":"function 12","func":"let text = msg.payload;\nlet msg2 = {};\nmsg2 = msg.payload;\n\nnode.warn(msg2);\n\n//node.warn(text);\n\n//let position = text.search(\"Up\");\n\n//node.warn(position);\n\nreturn msg2;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":990,"y":480,"wires":[["97e5c5e6f7b8313a"]]},{"id":"42cc99af2bd04069","type":"function","z":"9dc4f25c091456e7","name":"Your function node here.","func":"msg = { \"payload\": msg.payload, \"state\": msg.state };\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":610,"wires":[["f01425be1c6b6365","ad528e22a4e5ca79"]]},{"id":"8941f4c3.0f151","type":"mqtt-broker","name":"Local","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":""}]
Sorry, but what am I missing?
(But I do have it working now.)
Though for the sake of learning, I now want to understand what your code is supposed to do.