I'm running into a problem with a function block to create fields for an InfluxDB connector. I use the JSON string to object conversion node in Node-RED and it correctly creates the object {"CF1":1,"CF2.5":1,"CF10":1,"PM1":1,"PM2.5":1,"PM10":1,"PB0.3":348,"PB0.5":89,"PB1":8,"PB2.5":0,"PB5":0,"PB10":0} which I then use as input to the function block below. The error is "a leading decimal point can be confused with a dot". I can see how this could be a problem but have no idea to pick up these values correctly. Any idea?
msg.payload = {
cf1: msg.PMS5003.cf1,
cf2.5: msg.PMS5003.cf2.5, <error
cf10: msg.PMS5003.cf10,
pm1: msg.PMS5003.pm1,
pm2.5: msg.PMS5003.pm2.5, <error
pm10: msg.PMS5003.pm10,
pb0.3: msg.PMS5003.pb0.3, <error
pb0.5: msg.PMS5003.pb0.5,
pb1: msg.PMS5003.pb1,
pb2.5: msg.PMS5003.pb2.5, <error
pb5: msg.PMS5003.pb5,
pb10: msg.PMS5003.pb10
}
return msg;