# Change msg.payload does not work

**URL:** https://discourse.nodered.org/t/change-msg-payload-does-not-work/93395
**Category:** General
**Created:** [23 November 2024 21:11 UTC](https://discourse.nodered.org/t/change-msg-payload-does-not-work/93395 "2024-11-23T21:11:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tillmario](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@Tillmario](https://discourse.nodered.org/u/Tillmario)
#### Post date: [23 November 2024 21:11 UTC](https://discourse.nodered.org/t/change-msg-payload-does-not-work/93395/1 "2024-11-23T21:11:39Z")

</div>

Hi there,

I'm a beginner and was hoping someone could help me.

I have a Tasoma IR-Reader for my digital electricity meter. I configured MQTT, set the topic to "smartmeter" and then added an mqtt in node.

I configured the server to the IP of the Raspberry Pi4 running Node-RED and set the topic to "tele/smartmeter/SENSOR".

(QoS = 2; Output= parsed JSON)

a debug node (msg.payload) shows me all the data, so I suppose it is working the way that it should.

```auto
object
Time: "2024-11-23T21:16:14"
SML: object
Total_in: 14886.8561
Total_out: 0
Power_curr: 256
Volt_p1: 231.5
[...]
)

```

Now I only want the Power\_curr. So I put a change node right to the mqtt in. that didn't work, and i found this thread: [Change msg.payload to msg.payload.ANYNAME](https://discourse.nodered.org/t/change-msg-payload-to-msg-payload-anyname/32180)

i tried to apply it to my situation

 ![rednode1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/c/7cfcdbaa2d69157f30a7ffaf1db3070e8b97a297.png)

so this is what i did.

but if i debug it with the output "msg.payload.SML.Power\_curr" i still get:

```auto
23.11.2024, 21:59:49node: debug 1
tele/smartmeter/SENSOR : msg.payload.SML.Power_curr : Object
object
Time: "2024-11-23T21:59:45"
SML: object
Total_in: 14887.1382
Total_out: 0
Power_curr: 284
Volt_p1: 231.8
Volt_p2: 231
Volt_p3: 231.2
Amperage_p1: 1.8
Amperage_p2: 0.6
Amperage_p3: 0.6
phase_angle_p1: -62
phase_angle_p2: -62
phase_angle_p3: -69
frequency: 50

```

What do i have to do to just get the value for "Power\_curr" (284)?

Greetings, Tom

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [23 November 2024 21:28 UTC](https://discourse.nodered.org/t/change-msg-payload-does-not-work/93395/2 "2024-11-23T21:28:50Z")

</div>

Welcome to the forum @Tillmario

Something like this should do it

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/d/1d21d655a6d6a858bcdde90e2fb109d389799607.png)

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path/value for any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [23 November 2024 21:30 UTC](https://discourse.nodered.org/t/change-msg-payload-does-not-work/93395/3 "2024-11-23T21:30:51Z")

</div>

Alternatively, there may be no need to extract it from the original payload in order to use it. What do you want to do with the value?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [21 February 2025 21:31 UTC](https://discourse.nodered.org/t/change-msg-payload-does-not-work/93395/4 "2025-02-21T21:31:09Z")

</div>

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