Unknown command: undefined

Hi Everyone,

i facing this undefined error can teach what miss take i did.
thanks

[{"id":"d84226f6b77e2c62","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"c1adc51e4988d703","type":"inject","z":"d84226f6b77e2c62","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"RED light","payload":"true","payloadType":"bool","x":290,"y":360,"wires":[["c57cdff808841490"]]},{"id":"ee1b02527654bc1d","type":"inject","z":"d84226f6b77e2c62","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Green light","payload":"false","payloadType":"bool","x":280,"y":400,"wires":[["c57cdff808841490"]]},{"id":"5a077f8f2b734b0c","type":"debug","z":"d84226f6b77e2c62","name":"debug 27","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1100,"y":380,"wires":[]},{"id":"9f4cdbf0a3a9e38b","type":"gate","z":"d84226f6b77e2c62","name":"","controlTopic":"control","defaultState":"open","openCmd":"start","closeCmd":"stop","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"memory","x":810,"y":380,"wires":[["94b3249155e4314d"]]},{"id":"94b3249155e4314d","type":"hourglass","z":"d84226f6b77e2c62","name":"","persistId":"","humanizeLocale":"","x":940,"y":380,"wires":[["5a077f8f2b734b0c"]]},{"id":"c57cdff808841490","type":"function","z":"d84226f6b77e2c62","name":"function 3","func":"// @ts-nocheck\n\nmsg.topic = String(msg.topic)\nif (msg.topic == \"RED light\" && msg.payload == true) {\n    msg.topic = \"RED light\"\n    msg.payload = {\n        \"OK\": 0,\n        \"Error\": 1,\n    }\n} else if (msg.topic == \"Green light\" && msg.payload == false) {\n    msg.topic = \"Green light\"\n    msg.payload = {\n        \"OK\": 1,\n        \"Error\": 0,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":380,"wires":[["5ec45f075837927b"]]},{"id":"5ec45f075837927b","type":"trigger","z":"d84226f6b77e2c62","name":"","op1":"true","op2":"false","op1type":"bool","op2type":"bool","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":680,"y":380,"wires":[["9f4cdbf0a3a9e38b"]]}]

What is undefined ?

Whatever nodes you are using, they expect certain input, if it does not exist they will tell you it is undefined.
You will need to define them/it.

@bakman2
actually mine is "Unknown command: undefined"
but even i change to boolean or string but still does't work

And which node produces that error. Does the node have documentation describing what it expects as input ?

  1. debug your flow - remove a node at a time till you determine what node is causing the error
  2. also add a catch node connected to a debug node - set to display the complete msg object and see what it tells you.
  3. when you determine what node is the issue, add a 'debug' node to the output node that is feeding the node in error. So if you have n1->n2->n3 and n3 is the bad node, add a debug
    to the output of n2 and see what it tells you
  4. Using your new found information, read the Help tab for the node causing the problem (n3) and see what it tells you

ok thanks

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.