Insert data to Influxdb

Hi,

I am receiving data from an Aidon Energy meter via the Aidion-node, I am getting it into Node Red in the right format.

I have defined the message in a Function-node like this:

msg.payload = {
obis_list_version: msg.msghan.obis_list_version,
meter_ID: msg.msghan.meter_ID,
meter_model: msg.omsghan.meter_model,
act_pow_pos: msg.msghan.act_pow_pos,
act_pow_neg: msg.msghan.act_pow_neg,
react_pow_pos: msg.msghan.react_pow_pos,
react_pow_neg: msg.msghan.react_pow_neg,
curr_L1: msg.msghan.curr_L1,
curr_L2: msg.msghan.curr_L2,
curr_L3: msg.msghan.curr_L3,
volt_L1: msg.msghan.volt_L1,
volt_L2: msg.msghan.volt_L2,
volt_L3: msg.msghan.volt_L3
}
return msg;

This is sent to an Influxdb out node and I get this error:

Error: A 400 Bad Request error occurred: {"error":"unable to parse 'stations act_pow_neg=undefined,act_pow_pos=undefined,curr_L1=undefined,curr_L2=undefined,curr_L3=undefined,meter_ID=undefined,obis_list_version=undefined,react_pow_neg=undefined,react_pow_pos=undefined,volt_L1=undefined,volt_L2=undefined,volt_L3=undefined': invalid boolean"}

As you may notice I am not winning the next Nobel Price in programming... Is there anything in this attempt to get the message in to Influxdb which is correct...? What is wrong!?

Regards,
Joakim

Add a debug node showing what you are feeding to the influx node.
Then add a debug node showing what is going into your function node and try and work out what the problem is. Paste them both here if you can't work it out.

Yes,

This is what I get if I debug before the function node:

This is the debug after the function node:

It feels like there is something wrong with the code in the function node...
msg.payload = {
obis_list_version: msg.msghan.obis_list_version,
meter_ID: msg.msghan.meter_ID,
meter_model: msg.omsghan.meter_model,
act_pow_pos: msg.msghan.act_pow_pos,
act_pow_neg: msg.msghan.act_pow_neg,
react_pow_pos: msg.msghan.react_pow_pos,
react_pow_neg: msg.msghan.react_pow_neg,
curr_L1: msg.msghan.curr_L1,
curr_L2: msg.msghan.curr_L2,
curr_L3: msg.msghan.curr_L3,
volt_L1: msg.msghan.volt_L1,
volt_L2: msg.msghan.volt_L2,
volt_L3: msg.msghan.volt_L3
}
return msg;

Should I define the first three rows as string and the rest as value...? Or do I have to use a Influxdb node for each value?

//Joakim

Looking at the first debug there doesn't seem to be any data there, or an I missing something.

Looks like you have an extra "o" in that variable name...

1 Like