Sorry folks. Seems the elephant is back in the room.
This is the bare bones of what I am wanting to do:
[{"id":"77182547.31a85c","type":"string","z":"d52027c9.60c9f8","name":"","methods":[{"name":"chompLeft","params":[{"type":"str","value":"COMMAND_REPLY"}]}],"prop":"topic","propout":"payload","object":"msg","objectout":"msg","x":430,"y":140,"wires":[["b4edeabd.882af"]]},{"id":"b4edeabd.882af","type":"debug","z":"d52027c9.60c9f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":600,"y":140,"wires":[]},{"id":"ec25ae89.d3cb7","type":"inject","z":"d52027c9.60c9f8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":140,"wires":[["957dca8c.5f4d88"]]},{"id":"957dca8c.5f4d88","type":"function","z":"d52027c9.60c9f8","name":"","func":"msg.topic = \"COMMAND_REPLY/TimePi\";\nmsg.payload = \"Test message\"\nreturn msg;","outputs":1,"noerr":0,"x":220,"y":140,"wires":[["77182547.31a85c"]]}]
Idea:
The topic is “COMMAND_REPLY/(device name)”
and I want to strip that to “device name”.
I use the STRING node and CHOMPLEFT COMMAND_REPLY/ of the topic.
But it doesn’t seem to be working.
Where’s the elephant?
AH!
STRING node returns its results in PAYLOAD irrespective of from where the input was sourced!
I was playing with (msg.)topic and expected the result to REMAIN in topic.
Seems it is put in payload.
Nice if that was declared a bit clearer. Is it?