Rename the payload coming from MQTT-IN node?

Good Morning,

as Topic says, how can i rename a msg.payload to eg. msg.payload2 coming from a MQTT OUT Node ?

From a Inject Node its no Problem here can i directly rename it in the Node but in MQTT Node not.

change node...


i have tried the Change Node before but gettin this Info from Debug Node:

msg.payload2 : undefined

The MQTT Message is analyzed JSON like:


Did you mean to say a MQTT-OUT node or should it have been a MQTT-IN node (like the one below)??


If you set the option in your MQTT-In node to 'a parsed JSON object' you can filter out the data you need.
For example to get the voltage value you can do this in a function node or change node...

msg.payload = msg.payload.ENERGY.Voltage;

return msg;


Are you sure you specified Move in the Change node and not Set?

If you still can't get it to work then add a debug node showing what is coming out of the MQTT node and what is coming out of the function node. Give the debug nodes names and set them to Output complete message.


Yes sorry i meant MQTT-IN and yes its a parsed JSON Object

Debug from MQTT IN:


Debug from the Change Node (I set it to --> msg.payload2 to see the Data from changed payload2):

tele/tasmota_772430/SENSOR : msg.payload2 : undefined

Debug with Output complete Message at the Change Node:


Show us how you have configured the Change node.

Here is the complete Flow of these 3 Nodes:

        "id": "7b9af3bf34a743f2",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
        "id": "e4b0ff793fb1f945",
        "type": "inject",
        "z": "7b9af3bf34a743f2",
        "name": "",
        "props": [
                "p": "payload"
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"Time\":1667726362,\"Switch1\":\"OFF\",\"ENERGY\":{\"TotalStartTime\":\"2022-10-29T18:30:48\",\"Total\":0,\"Yesterday\":0.018,\"Today\":0.344,\"Period\":6,\"Power\":0.01,\"ApparentPower\":375,\"ReactivePower\":0,\"Factor\":1,\"Voltage\":235,\"Current\":0}}",
        "payloadType": "json",
        "x": 450,
        "y": 180,
        "wires": [
        "id": "94071c8fcaf238e4",
        "type": "change",
        "z": "7b9af3bf34a743f2",
        "name": "",
        "rules": [
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload2",
                "tot": "msg",
                "dc": true
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 670,
        "y": 180,
        "wires": [
        "id": "7caf94504c0e21b3",
        "type": "debug",
        "z": "7b9af3bf34a743f2",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload2",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 960,
        "y": 180,
        "wires": []

The change node can sometimes be a little confusing, when you "set" a property, think of it like:
create new property: msg.payload2 and get the value from msg.payload

so you have to switch them around.

As I said in my earlier post

1 Like

Thats the Solution, thanks Colin.

I must have read it again.

Move Mode did the work :grinning:

1 Like

Hope you don't mind.
I've edited the title of your post to help people who might search for this topic/issue in the future.

Yes, that's great, thanks everyone

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