Skip to content

Grafana Battery Template

{
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"builtIn": true,
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"query": {
"datasource": {
"name": "-- Grafana --"
},
"group": "grafana",
"kind": "DataQuery",
"spec": {},
"version": "v0"
}
}
}
],
"cursorSync": "Tooltip",
"editable": true,
"elements": {
"panel-4": {
"kind": "Panel",
"spec": {
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"hidden": false,
"query": {
"datasource": {
"name": "grafanacloud-logs"
},
"group": "loki",
"kind": "DataQuery",
"spec": {
"direction": "backward",
"editorMode": "code",
"expr": "{source=\"withthegrid-teleport\"} | assetIdentifier = `$assetIdentifier` | baseType = `batteryPower`",
"queryType": "range"
},
"version": "v0"
},
"refId": "A"
}
}
],
"queryOptions": {},
"transformations": [
{
"group": "extractFields",
"kind": "Transformation",
"spec": {
"options": {
"delimiter": ",",
"format": "json",
"jsonPaths": [
{
"alias": "measuredAt",
"path": "measuredAt"
},
{
"alias": "confirmed setpoint",
"path": "setpoints.confirmed.activePower"
},
{
"alias": "effective setpoint",
"path": "setpoints.effective.activePower"
},
{
"alias": "active power",
"path": "activePower"
}
],
"replace": true,
"source": "Line"
}
}
},
{
"group": "convertFieldType",
"kind": "Transformation",
"spec": {
"options": {
"conversions": [
{
"destinationType": "time",
"targetField": "measuredAt"
},
{
"destinationType": "number",
"targetField": "confirmed setpoint"
},
{
"destinationType": "number",
"targetField": "effective setpoint"
},
{
"destinationType": "number",
"targetField": "active power"
}
],
"fields": {}
}
}
},
{
"group": "prepareTimeSeries",
"kind": "Transformation",
"spec": {
"options": {
"format": "multi"
}
}
}
]
}
},
"description": "Monitors bidirectional power flow (positive = discharge, negative = charge).",
"id": 4,
"links": [],
"title": "Battery Power",
"vizConfig": {
"group": "timeseries",
"kind": "VizConfig",
"spec": {
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": true,
"drawStyle": "line",
"fillOpacity": 10,
"lineWidth": 2,
"showPoints": "auto"
},
"unit": "watt"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
"version": "13.2.0-28666480772"
}
}
},
"panel-5": {
"kind": "Panel",
"spec": {
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"hidden": false,
"query": {
"datasource": {
"name": "grafanacloud-logs"
},
"group": "loki",
"kind": "DataQuery",
"spec": {
"direction": "backward",
"editorMode": "code",
"expr": "{source=\"withthegrid-teleport\"} | assetIdentifier = `$assetIdentifier` | baseType = `batteryPower`",
"queryType": "range"
},
"version": "v0"
},
"refId": "A"
}
}
],
"queryOptions": {},
"transformations": [
{
"group": "extractFields",
"kind": "Transformation",
"spec": {
"options": {
"delimiter": ",",
"format": "json",
"jsonPaths": [
{
"alias": "measuredAt",
"path": "measuredAt"
},
{
"alias": "State of Charge",
"path": "stateOfCharge"
},
{
"alias": "State of Health",
"path": "stateOfHealth"
}
],
"replace": true,
"source": "Line"
}
}
},
{
"group": "convertFieldType",
"kind": "Transformation",
"spec": {
"options": {
"conversions": [
{
"destinationType": "time",
"targetField": "measuredAt"
},
{
"destinationType": "number",
"targetField": "State of Charge"
},
{
"destinationType": "number",
"targetField": "State of Health"
}
],
"fields": {}
}
}
},
{
"group": "prepareTimeSeries",
"kind": "Transformation",
"spec": {
"options": {
"format": "multi"
}
}
}
]
}
},
"description": "Battery capacity and health tracking.",
"links": [],
"id": 5,
"title": "SOC & SOH",
"vizConfig": {
"group": "timeseries",
"kind": "VizConfig",
"spec": {
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"lineWidth": 2
},
"min": 0,
"max": 100,
"unit": "percent"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
"version": "13.2.0-28666480772"
}
}
},
"panel-6": {
"kind": "Panel",
"spec": {
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"hidden": false,
"query": {
"datasource": {
"name": "grafanacloud-logs"
},
"group": "loki",
"kind": "DataQuery",
"spec": {
"direction": "backward",
"editorMode": "code",
"expr": "{source=\"withthegrid-teleport\"} | assetIdentifier = `$assetIdentifier` | baseType = `batteryPower`",
"queryType": "range"
},
"version": "v0"
},
"refId": "A"
}
}
],
"queryOptions": {},
"transformations": [
{
"group": "extractFields",
"kind": "Transformation",
"spec": {
"options": {
"delimiter": ",",
"format": "json",
"jsonPaths": [
{
"alias": "measuredAt",
"path": "measuredAt"
},
{
"alias": "Max Cell Temp",
"path": "batteryEnergyStorageSystems[0].cellTemperature.max"
},
{
"alias": "Min Cell Temp",
"path": "batteryEnergyStorageSystems[0].cellTemperature.min"
}
],
"replace": true,
"source": "Line"
}
}
},
{
"group": "convertFieldType",
"kind": "Transformation",
"spec": {
"options": {
"conversions": [
{
"destinationType": "time",
"targetField": "measuredAt"
},
{
"destinationType": "number",
"targetField": "Max Cell Temp"
},
{
"destinationType": "number",
"targetField": "Min Cell Temp"
}
],
"fields": {}
}
}
},
{
"group": "prepareTimeSeries",
"kind": "Transformation",
"spec": {
"options": {
"format": "multi"
}
}
}
]
}
},
"description": "Internal cell temperatures for thermal management.",
"links": [],
"id": 6,
"title": "Cell Temperatures",
"vizConfig": {
"group": "timeseries",
"kind": "VizConfig",
"spec": {
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"lineWidth": 2
},
"unit": "celsius"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
"version": "13.2.0-28666480772"
}
}
}
},
"layout": {
"kind": "GridLayout",
"spec": {
"items": [
{
"kind": "GridLayoutItem",
"spec": {
"element": {
"kind": "ElementReference",
"name": "panel-4"
},
"height": 12,
"width": 24,
"x": 0,
"y": 0
}
},
{
"kind": "GridLayoutItem",
"spec": {
"element": {
"kind": "ElementReference",
"name": "panel-5"
},
"height": 10,
"width": 12,
"x": 0,
"y": 12
}
},
{
"kind": "GridLayoutItem",
"spec": {
"element": {
"kind": "ElementReference",
"name": "panel-6"
},
"height": 10,
"width": 12,
"x": 12,
"y": 12
}
}
]
}
},
"links": [],
"liveNow": false,
"preload": false,
"tags": [],
"timeSettings": {
"autoRefresh": "",
"autoRefreshIntervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"fiscalYearStartMonth": 0,
"from": "now-6h",
"hideTimepicker": false,
"timezone": "browser",
"to": "now"
},
"title": "Battery BMS Overview",
"variables": [
{
"kind": "CustomVariable",
"spec": {
"allowCustomValue": false,
"current": {
"text": "alfen-123",
"value": "alfen-123"
},
"hide": "dontHide",
"includeAll": false,
"multi": false,
"name": "assetIdentifier",
"options": [],
"query": "alfen-123,alfen-456",
"skipUrlSync": false,
"valuesFormat": "csv"
}
}
]
}