Output value "total" as well to FluxDB

I get this output in NodeRed
``
shellyplugs-KuehlschrankKueche/status/switch:0 : msg.payload : Object
object
id: 0
source: "init"
output: true
apower: 0.6
voltage: 229.1
current: 0.042
aenergy: object
total: 441.981
by_minute: array[3]
minute_ts: 1760705820
temperature: object
tC: 32.7
tF: 90.9


The String is:

{"id":0,"source":"init","output":true,"apower":0.6,"voltage":229.1,"current":0.042,"aenergy":{"total":441.981,"by_minute":[10.878,11.784,11.331],"minute_ts":1760705820},"temperature":{"tC":32.7,"tF":90.9}}

The Workflow is: MQTT-Input - FluxDB-Output

In FulxDB only the values are shown:
id: 0
source: "init"
output: true
apower: 0.6
voltage: 229.1
current: 0.042

I aspect to get the value "total:123" as well.

What can I do to get this value as well?

Thanks for any idee

Welcome to the forum @nkellner

What node have you installed to write to the db? Look in Manage Palette in the dropdown menu to see the nodes you have installed.

Have you checked in the node's help text to see whether nested objects are allowed? The property total is nested inside the aenergy property.

Hi,
the use NODE to wirt Data to DB is "influxdb out".
I checked the help but I don´t understand it right for me.
My idea was to set the nested value "total" to the "mainstream" Payload. Hopefully we can do that?
I get in InfluxDB only the valus of "msg.payload"

Sorry for the bad stupid question and thanks for supporting me.

If I test with the DebugNode I can set the Output to "msg.payload.aenergy". Here I get the value "total". But it´s only a debug message?
May be there is a posibilty to convert "total" from "msg.payload.aenergy" to "msg.payload"?

Blockquote
{"total":1091.908,"by_minute":[296.415,292.789,293.696],"minute_ts":1760881920}

Influxdb does not allow nested properties, so you need to move total out of the aenergy property to the top level. I suggest that you then also remove the properties aenergy and temperature so it is clear what you want. I am surprised that the database does not throw an error the way you have it at the moment.

You should be able to do what you want using a Change node configured like this

Feed that into a debug node and make sure that the payload contains only the properties that you want. When it looks good, connect it to the db node.

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path/value for any data item, which is what you need when moving properties about.

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

cool, thanks - it works fine.
I´ll check out the page - thanks for the tip an help

Can you mark the post with the solution as the fix please (the checkbox at the bottom) then others will know that it is sorted. Thanks.