this is the dubg set as complete msg object that is put at the end of the flow.
i receive:
{"topic":"cmnd/tasmota_mcp/event","payload_end":1,"part1":"topic=tasmota_mcp\npayload=MCPINT_D0=","part2":"topic=tasmota_mcp/eventpayload=MCPINT_D0=","part3":"cmnd/tasmota_mcp/eventpayload=MCPINT_D0=","parts":{"id":"94d4911b.ae57a","type":"string","ch":"payload=","index":0,"count":2},"_msgid":"93636837.391f28"}
and
{"topic":"MCPINT_D0=","payload_end":1,"part1":"topic=tasmota_mcp\npayload=MCPINT_D0=","part2":"topic=tasmota_mcp/eventpayload=MCPINT_D0=","part3":"cmnd/tasmota_mcp/eventpayload=MCPINT_D0=","parts":{"id":"94d4911b.ae57a","type":"string","ch":"payload=","index":1,"count":2},"_msgid":"1083342f.591abc","uno":"MCPINT_D0=","due":1,"payload":"MCPINT_D0=1"}
this is one example of json injected, where, if you would like to implement a function
node, i can write in a different way the description
field to pass to NodeRed value in a different way that can make easy implement the function
{"Battery":255,"RSSI":12,"description":"topic=tasmota_mcp\npayload=MCPINT_D0=","dtype":"Light/Switch","hwid":"6","id":"000140FE","idx":174,"name":"mcp_luce1","nvalue":1,"stype":"Switch","svalue1":"0","switchType":"On/Off","unit":1}
this is the flow with attached also the debug used and the injection flow on and off.
i think that i make too much complicate the flow tring to manipulate the description filed...maybe i have to change the approach
[{"id":"e8abadf6.0af268","type":"tab","label":"luci_tasmota_mcp","disabled":false,"info":""},{"id":"1b72beb2.950b01","type":"inject","z":"e8abadf6.0af268","name":"luce OFF","topic":"","payload":"{\"Battery\":255,\"RSSI\":12,\"description\":\"topic=tasmota_mcp\\npayload=MCPINT_D0=\",\"dtype\":\"Light/Switch\",\"hwid\":\"6\",\"id\":\"000140FE\",\"idx\":174,\"name\":\"mcp_luce1\",\"nvalue\":0,\"stype\":\"Switch\",\"svalue1\":\"0\",\"switchType\":\"On/Off\",\"unit\":1}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":120,"wires":[["7baccf6f.34fed"]]},{"id":"3001c820.f32988","type":"inject","z":"e8abadf6.0af268","name":"luce ON","topic":"","payload":"{\"Battery\":255,\"RSSI\":12,\"description\":\"topic=tasmota_mcp\\npayload=MCPINT_D0=\",\"dtype\":\"Light/Switch\",\"hwid\":\"6\",\"id\":\"000140FE\",\"idx\":174,\"name\":\"mcp_luce1\",\"nvalue\":1,\"stype\":\"Switch\",\"svalue1\":\"0\",\"switchType\":\"On/Off\",\"unit\":1}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":180,"wires":[["7baccf6f.34fed"]]},{"id":"7baccf6f.34fed","type":"switch","z":"e8abadf6.0af268","name":"","property":"payload.description","propertyType":"msg","rules":[{"t":"cont","v":"MCPINT","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":140,"wires":[["3da211e6.294ff6","29bb36a7.aba402"],[]]},{"id":"3da211e6.294ff6","type":"debug","z":"e8abadf6.0af268","name":"switch MCP","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":60,"wires":[]},{"id":"88458d05.3bb168","type":"mqtt in","z":"e8abadf6.0af268","name":"","topic":"domoticz/out","qos":"2","datatype":"json","broker":"f0a64cae.6413e","x":110,"y":60,"wires":[[]]},{"id":"354a9518.d5a8ba","type":"mqtt out","z":"e8abadf6.0af268","name":"","topic":"","qos":"","retain":"","broker":"f0a64cae.6413e","x":710,"y":300,"wires":[]},{"id":"29bb36a7.aba402","type":"change","z":"e8abadf6.0af268","name":"JSONata","rules":[{"t":"set","p":"payload_end","pt":"msg","to":"payload.nvalue","tot":"jsonata"},{"t":"set","p":"part1","pt":"msg","to":"payload.description","tot":"jsonata"},{"t":"set","p":"part2","pt":"msg","to":"$replace(part1,\"\\n\", \"/event\")","tot":"jsonata"},{"t":"set","p":"part3","pt":"msg","to":"$replace(part2,\"topic=\", \"cmnd/\")","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"part3","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":140,"wires":[["6ea782cb.746b34"]]},{"id":"6ea782cb.746b34","type":"split","z":"e8abadf6.0af268","name":"","splt":"payload=","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"exit","x":650,"y":140,"wires":[["cfc59d08.02d298"]]},{"id":"cfc59d08.02d298","type":"switch","z":"e8abadf6.0af268","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"cmnd","vt":"str"},{"t":"cont","v":"MCPINT","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":110,"y":320,"wires":[["499bd46e.8e3a44","3e4b7dfc.22e642"],["d89ddbfc.35c1e8","b7699cec.cdf1d"]]},{"id":"d89ddbfc.35c1e8","type":"change","z":"e8abadf6.0af268","name":"","rules":[{"t":"set","p":"uno","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"due","pt":"msg","to":"payload_end","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":380,"wires":[["133b3620.a1ded2","cf87192.6628e68","7c88c9e1.69df08"]]},{"id":"133b3620.a1ded2","type":"template","z":"e8abadf6.0af268","name":"","field":"union","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{{uno}}}{{due}}","output":"str","x":420,"y":380,"wires":[["12320b06.6152bd","3e4b7dfc.22e642"]]},{"id":"3608b2c4.c9ec26","type":"debug","z":"e8abadf6.0af268","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","x":560,"y":240,"wires":[]},{"id":"12320b06.6152bd","type":"debug","z":"e8abadf6.0af268","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"union","targetType":"msg","x":490,"y":460,"wires":[]},{"id":"3e4b7dfc.22e642","type":"change","z":"e8abadf6.0af268","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"topic","tot":"msg"},{"t":"move","p":"union","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":300,"wires":[["a8394405.0d81e8","5ece7020.f7f9c","3608b2c4.c9ec26"]]},{"id":"a8394405.0d81e8","type":"debug","z":"e8abadf6.0af268","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":660,"y":380,"wires":[]},{"id":"5ece7020.f7f9c","type":"debug","z":"e8abadf6.0af268","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":660,"y":460,"wires":[]},{"id":"b7699cec.cdf1d","type":"debug","z":"e8abadf6.0af268","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":200,"y":540,"wires":[]},{"id":"499bd46e.8e3a44","type":"debug","z":"e8abadf6.0af268","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":270,"y":280,"wires":[]},{"id":"cf87192.6628e68","type":"debug","z":"e8abadf6.0af268","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"uno","targetType":"msg","x":270,"y":460,"wires":[]},{"id":"7c88c9e1.69df08","type":"debug","z":"e8abadf6.0af268","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"due","targetType":"msg","x":270,"y":500,"wires":[]},{"id":"f0a64cae.6413e","type":"mqtt-broker","z":"","name":"mosquitto","broker":"192.168.0.105","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]