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
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"
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"?
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.