Hello.
I’m trying to store the battery data that is captured every second in a Influxdb database. The battery can have a number of cells ranging from 0 to 256, which have their own parameters. I managed to create a flow in Node RED that boils down to the object that looks like this:
{
"topic": "InputData",
"payload": "Bms 13",
"ip": "::ffff:192.168.1.111",
"port": 3755,
"_session": {
"type": "tcp",
"id": "199dd01a.f1d44"
},
"_msgid": "39ce8762.80f7f8",
"IsBmsState": true,
"BmsInfo": {
"State": 13,
"CellInfos": {
"0": {
"Num": 0,
"Voltage": 4.043,
"Temp": 53,
"TempBal": 19,
"CellTemp": 6
},
"1": {
"Num": 1,
"Voltage": 4.088,
"Temp": 24.2,
"TempBal": 19,
"CellTemp": 6
},
"2": {
"Num": 2,
"Voltage": 4.073,
"Temp": 19.3,
"TempBal": 19,
"CellTemp": 6
},
"3": {
"Num": 3,
"Voltage": 4.052,
"Temp": 15,
"TempBal": 19,
"CellTemp": 6
},
"length": 4
}
}
}
This represents a single measurement from the battery. Now I need to store it in the database. And this is where I need your help. After googling around I found out that it’s not possible to store nested JSON object in Influxdb and I’m currently out of ideas how this can be done.
What would be the appropriate schema design for this?
I’m sure there is the right way to do it, but i’m completely new to the time series databases and databases in general.
Any help is really appreciated.