Sort data from electricity meter

Hi I´m trying to sort the data from my Emeters Han-port.
"0100010700FF": [908, [0, "W"]], 908 is current power.
I´m quite new to Nod-red so Help please!

"elapsedtime": 58526314,
"rssi": -88,
"mac": "F4:CF:A2:D0:7B:99",
"localip": "",
"ssid": "Idrott",
"hostname": "ESP-D07B99",
"header": {
"encoding": "A-XDR",
"frameformat": 3,
"segmentation": 0,
"datalength": 579,
"client": 65,
"server": 2179,
"control": 19,
"hcs": "eb85",
"fcs": "388e",
"llc": "e6e700"
"apdu": {
"tag": 15,
"liiap": "40000000",
"datetime": "00"
"payload": {
"0000010000FF": ["07E50B0505073300FF8000FF"],
"0100010700FF": [908, [0, "W"]],
"0100020700FF": [0, [0, "W"]],
"0100030700FF": [0, [0, "var"]],
"0100040700FF": [483, [0, "var"]],
"01001F0700FF": [10, [-1, "A"]],
"0100330700FF": [5, [-1, "A"]],
"0100470700FF": [27, [-1, "A"]],
"0100200700FF": [2349, [-1, "V"]],
"0100340700FF": [2335, [-1, "V"]],
"0100480700FF": [2333, [-1, "V"]],
"0100150700FF": [225, [0, "W"]],
"0100160700FF": [0, [0, "W"]],

What do you mean by sort?
do you want the path to the value?
here is some good ifo on how to obtain paths using the debug pane.
the value 908 is at msg.payload["0100010700FF"][0]

I wan´t to use the value to store it in influx and put it in a graph in Grafana.

Now I tried this in a function node!
I get this:

payload: "0100010700FF"

topic: ""

_msgid: "23cde9b951be24d8"

statusCode: 200

headers: object

responseUrl: ""

redirectList: array[0]

retry: 0

how? Maybe you could show us?

msg.payload = ["0100010700FF"] [0];
return msg;
msg.payload = msg.payload["0100010700FF"][0];
return msg;

TypeError: Cannot read property '0' of undefined

Then please copy the value of the object payload.
You can do this in the debug panel. hover your mouse to the right of the payload object and 3 icons will appear. One of them is copy value. paste the value here between backticks, press </> and you get
type or paste code here
You can also get the path to any value you want using the copy path button.

We need to see a clear representation of the incoming msg, or you need to learn how to find paths and work with messages. It may be a good idea to read this page and watch the videos
I suspect the path is

msg.payload = msg.payload.payload["0100010700FF"][0];
return msg;

but we can not keep guessing. So if that fails please show your incoming data properly formated and between backticks as shown above.


The origin of the problem is trying to sort out data from my Aidon electricity meter
I have used info from:

Ok the data is a string add a json node after the node that is receiving the data, to convert it to a object

The node you are using to receive the data may have a setting to output a parsed json object.

I finally found the solution: msg.payload = msg.payload ["payload"]["0100010700FF"][0]
Thank you for your help!

You can write that as msg.payload = msg.payload.payload["0100010700FF"][0]. I notice this was suggested by @E1cid three days ago.

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