If the subject line hasn’t lost you hopefully you can help me out
Forgive the babble below, I am an “enthusiast” at best and probably am not using the correct terms.
AIM:
Setup a Raspberry Pi to poll my Profilux (say every minute) and store the data and present it in a more customisable, user-friendly manner that GHL offer.
HOW:
To this end I have created a JSON file (output below, but I can modify it once I understand exactly what I need).
I am polling the following from Profilux (using TOKENS) and grouping data into the 6 types I want to store: Sensors, Illumination, Switches, LevelSensors, 1-10V and Dosing.
Each object in the same type returns the same data sets however different types will return different elements: (eg.)
I am having an issue getting my head around the InfluxDB database structure. Would I be right in understanding I want 1 database (lets name it AQUARIUM).
What’s the equivalent in influxDB to a table for SQL? I assume I want 6 of these (1 for each type)
Each “table” would have different fields based on the elements for each
Is this how the structure of InfluxDB works?
Here is a copy of my JSON output
Forgive the babble below, I am an “enthusiast” at best and probably am not using the correct terms.
AIM:
Setup a Raspberry Pi to poll my Profilux (say every minute) and store the data and present it in a more customisable, user-friendly manner that GHL offer.
HOW:
To this end I have created a JSON file (output below, but I can modify it once I understand exactly what I need).
I am polling the following from Profilux (using TOKENS) and grouping data into the 6 types I want to store: Sensors, Illumination, Switches, LevelSensors, 1-10V and Dosing.
Each object in the same type returns the same data sets however different types will return different elements: (eg.)
- All sensors (I have 5) will return Description, CurrentVal, Control, NominalValue, Limits, Name, Format
- All Dosing Pumps (I have 16 active) will return Name, Description, FillLevel, DaysLeft, AlarmThreashold, Capacity
I am having an issue getting my head around the InfluxDB database structure. Would I be right in understanding I want 1 database (lets name it AQUARIUM).
What’s the equivalent in influxDB to a table for SQL? I assume I want 6 of these (1 for each type)
Each “table” would have different fields based on the elements for each
- “Sensors” table would have timestamp + 7 – so 8 columns in total. And each write to the DB would create 5 rows in this table
- “Dosing” table would have timestamp + 6 – so 7 columns in total. And each write to the DB would create 16 rows
Is this how the structure of InfluxDB works?
Here is a copy of my JSON output
{
"sensors":
[
{
"Description":"pH probe",
"CurrentVal":" 7.82pH",
"Control":"+ ",
"NominalValue":" 8.10pH",
"Limits":"4.500...9.500",
"Name":"pH-value 1",
"Format":"2:2:pH"
},
{
"Description":"Temperature",
"CurrentVal":" 25.3C",
"Control":" ",
"NominalValue":" 25.3C",
"Limits":"1.000...36.000",
"Name":"Temperature 1",
"Format":"2:1:C"
},
{
"Description":"ORP",
"CurrentVal":" 443mV",
"Control":"- ",
"NominalValue":" 200mV",
"Limits":"-300.000...600.000",
"Name":"Redox 1",
"Format":"3:0:mV"
},
{
"Description":"Voltage_in_1",
"CurrentVal":" 0.00V",
"Control":"+ ",
"NominalValue":" 5.00V",
"Limits":"0.000...10.000",
"Name":"Voltage 1",
"Format":"2:2:V"
},
{
"Description":"Voltage_in_2",
"CurrentVal":" 0.00V",
"Control":"+ ",
"NominalValue":" 5.00V",
"Limits":"0.000...10.000",
"Name":"Voltage 2",
"Format":"2:2:V"
},
],
"Illumination":
[
{
"Name":"Illumina. 1",
"Description":"Blue",
"Value":"100%",
"Color":"16767491"
},
{
"Name":"Illumina. 2",
"Description":"Royal Blue",
"Value":"100%",
"Color":"16744196"
},
{
"Name":"Illumina. 3",
"Description":"White",
"Value":" 30%",
"Color":"11534013"
},
{
"Name":"Illumina. 4",
"Description":"Red",
"Value":" 10%",
"Color":"32255"
},
{
"Name":"Illumina. 5",
"Description":"Green",
"Value":" 69%",
"Color":"1245043"
},
{
"Name":"Illumina. 6",
"Description":"Hyper Red",
"Value":" 33%",
"Color":"70399"
},
{
"Name":"Illumina. 7",
"Description":"Yellow",
"Value":" 53%",
"Color":"126975"
},
{
"Name":"Illumina. 8",
"Description":"Warm White",
"Value":" 67%",
"Color":"7793919"
},
{
"Name":"Illumina. 9",
"Description":"Hyper Violet",
"Value":"100%",
"Color":"16715110"
},
],
"switches":
[
{
"Name":"S 5",
"Description":"Lanthium",
"State":"Off",
"CurrentDraw":"0.0 A",
"Function":"Dosing pump 1",
"Used":"u",
"Mode":"0"
},
{
"Name":"S 6",
"Description":"Spare Dosing",
"State":"Off",
"CurrentDraw":"0.0 A",
"Function":"Dosing pump 2",
"Used":"u",
"Mode":"0"
},
{
"Name":"S 7",
"Description":"Spare Dosing",
"State":"Off",
"CurrentDraw":"0.0 A",
"Function":"Dosing pump 3",
"Used":"u",
"Mode":"0"
},
{
"Name":"S 8",
"Description":"Phytoblast",
"State":"Off",
"CurrentDraw":"0.0 A",
"Function":"Dosing pump 4",
"Used":"u",
"Mode":"0"
},
{
"Name":"S 9",
"Description":"00",
"State":"Off",
"CurrentDraw":"0.0 A",
"Function":"Temperature 1 +",
"Used":"u",
"Mode":"0"
},
{
"Name":"S10",
"Description":"Return",
"State":"On ",
"CurrentDraw":"0.0 A",
"Function":"Always on",
"Used":"u",
"Mode":"0"
},
{
"Name":"S11",
"Description":"Avast",
"State":"Off",
"CurrentDraw":"0.0 A",
"Function":"Timer 2",
"Used":"u",
"Mode":"0"
},
{
"Name":"S12",
"Description":"600W Heater",
"State":"Off",
"CurrentDraw":"0.0 A",
"Function":"Temperature 1 ++",
"Used":"u",
"Mode":"0"
},
{
"Name":"S13",
"Description":"WebCam",
"State":"On ",
"CurrentDraw":"0.0 A",
"Function":"Always on",
"Used":"u",
"Mode":"0"
},
{
"Name":"S14",
"Description":"Sulphur",
"State":"On ",
"CurrentDraw":"0.0 A",
"Function":"Always on",
"Used":"u",
"Mode":"0"
},
{
"Name":"S15",
"Description":"v1 Doser",
"State":"On ",
"CurrentDraw":"0.0 A",
"Function":"Always on",
"Used":"u",
"Mode":"0"
},
{
"Name":"S16",
"Description":"ehiem feeder 1",
"State":"Off",
"CurrentDraw":"0.0 A",
"Function":"Programab.logic 3",
"Used":"u",
"Mode":"0"
},
{
"Name":"S17",
"Description":"Skimmer",
"State":"On ",
"CurrentDraw":"0.0 A",
"Function":"Programab.logic 4",
"Used":"u",
"Mode":"0"
},
{
"Name":"S18",
"Description":"Mitras - white",
"State":"On ",
"CurrentDraw":"0.2 A",
"Function":"Always on",
"Used":"u",
"Mode":"0"
},
{
"Name":"S19",
"Description":"Mitras - Middle",
"State":"On ",
"CurrentDraw":"0.2 A",
"Function":"Always on",
"Used":"u",
"Mode":"0"
},
{
"Name":"S20",
"Description":"Mitras - black",
"State":"On ",
"CurrentDraw":"0.3 A",
"Function":"Always on",
"Used":"u",
"Mode":"0"
},
],
"LevelSensors":
[
{
"Name":"Level 1",
"Value":"Off"
},
{
"Name":"Level 2",
"Value":"On "
},
],
"1-10V":
[
{
"Voltage":"5.52 V"
},
{
"Voltage":"0.80 V"
},
{
"Voltage":"4.74 V"
},
{
"Voltage":"3.68 V"
},
{
"Voltage":"2.30 V"
},
{
"Voltage":"10.00 V"
},
],
"Dosing":
[
{
"Name":"Dosing pump 1",
"Description":"PhytoMix",
"FillLevel":"149",
"DaysLeft":"104.8479611.1",
"AlarmThreashold":"100",
"Capacity":"800"
},
{
"Name":"Dosing pump 2",
"Description":"Unused",
"FillLevel":"0",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"200",
"Capacity":"30000"
},
{
"Name":"Dosing pump 3",
"Description":"Unused",
"FillLevel":"0",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"50",
"Capacity":"500"
},
{
"Name":"Dosing pump 4",
"Description":"Lanth",
"FillLevel":"43",
"DaysLeft":"7.3161411.1",
"AlarmThreashold":"100",
"Capacity":"1000"
},
{
"Name":"Dosing pump 5",
"Description":"Alk",
"FillLevel":"4883",
"DaysLeft":"30.5240061.1",
"AlarmThreashold":"200",
"Capacity":"10000"
},
{
"Name":"Dosing pump 6",
"Description":"Mg",
"FillLevel":"1872",
"DaysLeft":"24.9647871.1",
"AlarmThreashold":"200",
"Capacity":"4000"
},
{
"Name":"Dosing pump 7",
"Description":"Calcium",
"FillLevel":"4063",
"DaysLeft":"21.1652641.1",
"AlarmThreashold":"200",
"Capacity":"10000"
},
{
"Name":"Dosing pump 8",
"Description":"Vinegar",
"FillLevel":"1517",
"DaysLeft":"101.1559911.1",
"AlarmThreashold":"200",
"Capacity":"2000"
},
{
"Name":"Dosing pump 9",
"Description":"",
"FillLevel":"0",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"100",
"Capacity":"0"
},
{
"Name":"Dosing pump10",
"Description":"",
"FillLevel":"0",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"100",
"Capacity":"0"
},
{
"Name":"Dosing pump11",
"Description":"",
"FillLevel":"0",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"200",
"Capacity":"1000"
},
{
"Name":"Dosing pump12",
"Description":"",
"FillLevel":"0",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"200",
"Capacity":"1000"
},
{
"Name":"Dosing pump13",
"Description":"",
"FillLevel":"0",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"200",
"Capacity":"1000"
},
{
"Name":"Dosing pump14",
"Description":"",
"FillLevel":"0",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"200",
"Capacity":"1000"
},
{
"Name":"Dosing pump15",
"Description":"Heater",
"FillLevel":"354",
"DaysLeft":"-1.0000001.1",
"AlarmThreashold":"9000",
"Capacity":"9000"
},
{
"Name":"Dosing pump16",
"Description":"NSW Storage",
"FillLevel":"398",
"DaysLeft":"26.5794681.1",
"AlarmThreashold":"100",
"Capacity":"2000"
},
]
}