# Text to msg.payload to inject in influxdb

**URL:** <https://discourse.nodered.org/t/text-to-msg-payload-to-inject-in-influxdb/50353>\
**Category:** General\
**Created:** [29 August 2021 17:08 UTC](https://discourse.nodered.org/t/text-to-msg-payload-to-inject-in-influxdb/50353 "2021-08-29T17:08:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicuBioc](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@NicuBioc](https://discourse.nodered.org/u/NicuBioc)\
**Post date:** [29 August 2021 17:08 UTC](https://discourse.nodered.org/t/text-to-msg-payload-to-inject-in-influxdb/50353/1 "2021-08-29T17:08:50Z")

</div>

[bmsjk.txt](https://discourse.nodered.org/uploads/short-url/a86zYAOvdbFpRNb2oHPVgn7ZDlx.txt) (3.6 KB)

hallo,  
I am very new in node ...and I don't now how ?  
I wont to inject this file in influxdb via node red.  
any suggestion we apreciate.

Rgd Nicu

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 August 2021 18:28 UTC](https://discourse.nodered.org/t/text-to-msg-payload-to-inject-in-influxdb/50353/2 "2021-08-30T18:28:01Z")

</div>

Welcome to the forum @NicuBioc

Where is the data coming from? Usually there are better ways then going through files.

If you haven't done so then I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![NicuBioc](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@NicuBioc](https://discourse.nodered.org/u/NicuBioc)\
**Post date:** [5 September 2021 19:41 UTC](https://discourse.nodered.org/t/text-to-msg-payload-to-inject-in-influxdb/50353/3 "2021-09-05T19:41:58Z")

</div>

thx Colin, data come from BMS (battery management system ).  
Now is working,(i extract in json format data and I separated).  
I have more one problem... One data is string when I discharge bateryy and is necessary to by number.Flow stop.  
Now is madatary to transform this data in number.

rgd,Nicu

```auto
msg.topic=123

tmp=JSON.parse(msg.payload);

msg.payload = [
    {
        
            V01 :tmp.voltage_cell01,
            V02 :tmp.voltage_cell02,
            V03 :tmp.voltage_cell03,
            V04 :tmp.voltage_cell04,
            V05 :tmp.voltage_cell05,
            V06 :tmp.voltage_cell06,
            V07 :tmp.voltage_cell07,
            V08 :tmp.voltage_cell08,
            V09 :tmp.voltage_cell09,
            V10 :tmp.voltage_cell10,
            V11 :tmp.voltage_cell11,
            V12 :tmp.voltage_cell12,
            V13 :tmp.voltage_cell13,
            V14 :tmp.voltage_cell14,
            avr_V :tmp.average_cell_voltage,
            delta_v :tmp.delta_cell_voltage,
            bat_v :tmp.battery_voltage,
            bat_pwr :tmp.battery_power,
            bat_t1 :tmp.battery_t1,
            bat_t2 :tmp.battery_t2,
            mos_t :tmp.mos_temp,
            p_rmn :tmp.percent_remain,
            cap_rem :tmp.capacity_remain,
            i_inc :tmp.current_charge,
            i_des :tmp.current_discharge,
        },
       
];
return msg;

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 November 2021 19:42 UTC](https://discourse.nodered.org/t/text-to-msg-payload-to-inject-in-influxdb/50353/4 "2021-11-04T19:42:18Z")

</div>

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