Skip to content

Instantly share code, notes, and snippets.

@adrianlzt
Created October 12, 2021 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianlzt/a9b96482009fabdb89b94ec029d09ba5 to your computer and use it in GitHub Desktop.
Save adrianlzt/a9b96482009fabdb89b94ec029d09ba5 to your computer and use it in GitHub Desktop.
LiFePo4 310Ah/12V + Daly BMS connection and load test
{
"__inputs": [],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "8.2.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": null,
"graphTooltip": 1,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 25,
"panels": [],
"title": "Debug",
"type": "row"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 3,
"x": 0,
"y": 1
},
"id": 21,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^status_load_running chip$/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"status_load_running\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"title": "Status load",
"type": "stat"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 4,
"x": 5,
"y": 1
},
"id": 16,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^mosfet_status_charging_mosfet chip$/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"mosfet_status_charging_mosfet\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"title": "Status charging mosfet",
"type": "stat"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 2,
"x": 11,
"y": 1
},
"id": 18,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^status_states_DI1 chip$/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"status_states_DI1\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"title": "State D1",
"type": "stat"
},
{
"datasource": null,
"description": "Número de errores",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "dark-red",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 10,
"x": 14,
"y": 1
},
"id": 27,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"fields": "/^content chip$/",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"errors\")\n |> filter(fn: (r) => r[\"_field\"] == \"content\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"title": "Errors",
"type": "stat"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 3,
"x": 0,
"y": 4
},
"id": 20,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^status_charger_running chip$/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"status_charger_running\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"title": "Status charger",
"type": "stat"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 4,
"x": 5,
"y": 4
},
"id": 17,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^mosfet_status_discharging_mosfet chip$/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"mosfet_status_discharging_mosfet\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"title": "Status discharging mosfet",
"type": "stat"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 2,
"x": 11,
"y": 4
},
"id": 19,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^status_states_DI2 chip$/",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"status_states_DI2\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"title": "State D2",
"type": "stat"
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 7
},
"id": 23,
"panels": [],
"title": "LiFePo4",
"type": "row"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 2,
"w": 5,
"x": 0,
"y": 8
},
"id": 15,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^mosfet_status_mode chip$/",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"mosfet_status_mode\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"type": "stat"
},
{
"datasource": null,
"description": "Número de errores",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 1
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 2,
"w": 5,
"x": 5,
"y": 8
},
"id": 26,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^count chip$/",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"errors\")\n |> filter(fn: (r) => r[\"_field\"] == \"count\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")",
"refId": "A"
}
],
"title": "Errors",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "amph"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 10,
"y": 8
},
"id": 7,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"mosfet_status_capacity_ah\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Capacidad",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "volt"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 5,
"x": 15,
"y": 8
},
"id": 8,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"soc_total_voltage\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Voltaje",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "celsius"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 20,
"y": 8
},
"id": 10,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"temperature_range_highest_temperature\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Max",
"type": "stat"
},
{
"datasource": null,
"description": "Nos muestra la energía consumida en el periodo seleccionado",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "watth"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 5,
"x": 0,
"y": 10
},
"id": 5,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "myWindow = 300.0 //unit is seconds !!\nmyDuration = duration(v:(string(v:myWindow)+\"s\"))\n\nfrom(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"soc_power\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: myDuration, fn: mean)\n |> map(fn: (r) => ({ _value: r._value * myWindow / 3600.0 , _time:r._time, _field:\"WattHour\" }))\n |> cumulativeSum(columns: [\"_value\"])\n\n\n\n",
"refId": "A"
}
],
"title": "Energía",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 5,
"x": 5,
"y": 10
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"soc_soc_percent\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "State of charge",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "amp"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 5,
"x": 15,
"y": 12
},
"id": 9,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"soc_current\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Intensidad",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "celsius"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 20,
"y": 12
},
"id": 11,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"temperature_range_lowest_temperature\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Min",
"type": "stat"
},
{
"datasource": null,
"description": "Potencia positiva significa descargando.\nPotencia negativa, cargando.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMin": 0,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "watt"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "soc_power chip"
},
"properties": [
{
"id": "displayName",
"value": "power"
}
]
},
{
"__systemRef": "hideSeriesFrom",
"matcher": {
"id": "byNames",
"options": {
"mode": "exclude",
"names": [
"power"
],
"prefix": "All except:",
"readOnly": true
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": false,
"tooltip": false,
"viz": true
}
}
]
}
]
},
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 16
},
"id": 4,
"options": {
"legend": {
"calcs": [
"last",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"soc_power\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Potencia",
"type": "timeseries"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "line"
}
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 3.65
}
]
},
"unit": "volt"
},
"overrides": []
},
"gridPos": {
"h": 13,
"w": 19,
"x": 0,
"y": 23
},
"id": 2,
"options": {
"legend": {
"calcs": [
"last",
"max",
"min",
"range",
"mean"
],
"displayMode": "table",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"cell_voltages_1\" or r[\"_field\"] == \"cell_voltages_2\" or r[\"_field\"] == \"cell_voltages_3\" or r[\"_field\"] == \"cell_voltages_4\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Voltajes células",
"type": "timeseries"
},
{
"datasource": null,
"description": "Diferencia de voltaje entre la célula con más voltaje y la que menos",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 0.005
},
{
"color": "red",
"value": 0.1
}
]
},
"unit": "volt"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 5,
"x": 19,
"y": 23
},
"id": 12,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"cell_voltage_range_max_diff\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Diff cell max-min",
"type": "stat"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "volt"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 5,
"x": 19,
"y": 30
},
"id": 13,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"cell_voltage_range_highest_voltage\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Max voltaje",
"type": "stat"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "volt"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 5,
"x": 19,
"y": 33
},
"id": 14,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.0",
"targets": [
{
"query": "from(bucket: \"adrianlzt's Bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"exec_daly\")\n |> filter(fn: (r) => r[\"_field\"] == \"cell_voltage_range_lowest_voltage\")\n |> filter(fn: (r) => r[\"host\"] == \"chip\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Min voltaje",
"type": "stat"
}
],
"refresh": "30s",
"schemaVersion": 31,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "LiFePo4 - Daly BMS",
"uid": "4gK0vsv7z",
"version": 13
}
[agent]
interval = "30s"
[[inputs.exec]]
## Commands array
commands = [
"docker exec daly daly-bms-cli -d /dev/ttyUSB0 --uart --all"
]
timeout = "25s"
name_suffix = "_daly"
data_format = "json"
json_string_fields = [
"mosfet_status_mode",
"mosfet_status_charging_mosfet",
"mosfet_status_discharging_mosfet",
"status_charger_running",
"status_load_running",
"status_states_DI1",
"status_states_DI2"
]
[[processors.starlark]]
source = '''
load('math.star', 'math')
def apply(metric):
metric.fields["soc_power"] = metric.fields.get('soc_total_voltage') * metric.fields.get('soc_current')
metric.fields["cell_voltage_range_max_diff"] = metric.fields.get('cell_voltage_range_highest_voltage') - metric.fields.get('cell_voltage_range_lowest_voltage')
status = metric.fields.get('mosfet_status_mode')
if status == "stationary":
metric.fields["mosfet_status_mode_value"] = 0
elif status == "charging":
metric.fields["mosfet_status_mode_value"] = 1
elif status == "discharging":
metric.fields["mosfet_status_mode_value"] = -1
return metric
'''
[[outputs.file]]
files = ["stdout"]
[[outputs.influxdb_v2]]
urls = ["https://europe-west1-1.gcp.cloud2.influxdata.com"]
token = "TOBEFILLED"
organization = "TOBEFILLED"
bucket = "TOBEFILLED"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment