From 9c8586ecd25f496859cbab573c859d257cf1e46c Mon Sep 17 00:00:00 2001 From: Dastine Date: Mon, 18 May 2026 15:26:31 -0600 Subject: [PATCH 1/2] Update telemetry dashboards and Grafana configuration - Updated `docker-compose.yml` to include additional environment variables for MQTT and PostgreSQL configuration. - Modified `datasources.yaml` to set unique IDs for MQTT and PostgreSQL datasources and adjusted connection settings. --- README.md | 13 +- grafana/.env.example | 7 +- grafana/DASHBOARD_WORKFLOW.md | 55 + ...s Telemetry Base Dashboard (History).json} | 154 +- ...elemetry Base Dashboard-1763418239880.json | 1395 ----------------- .../Das Telemetry Base Dashboard.json | 660 ++++++++ ...997.json => Telemetry Base Dashboard.json} | 30 +- grafana/docker-compose.yml | 3 + .../provisioning/datasources/datasources.yaml | 19 +- 9 files changed, 862 insertions(+), 1474 deletions(-) create mode 100644 grafana/DASHBOARD_WORKFLOW.md rename grafana/dashboards/{Das Telemetry Base Dashboard (History)-1769897898291.json => Das Telemetry Base Dashboard (History).json} (85%) delete mode 100644 grafana/dashboards/Das Telemetry Base Dashboard-1763418239880.json create mode 100644 grafana/dashboards/Das Telemetry Base Dashboard.json rename grafana/dashboards/{Telemetry Base Dashboard-1752806086997.json => Telemetry Base Dashboard.json} (96%) diff --git a/README.md b/README.md index e45f2e2..2be1243 100644 --- a/README.md +++ b/README.md @@ -79,18 +79,9 @@ This allows real-time monitoring of vehicle performance, with Discord serving as - Enter the topic you want to subscribe to (e.g., `packet`). - Click on **Run Query** to see the telemetry data. -1. **Import Dashboard**: - - - Navigate to **Dashboards** > **Manage**. - - Click on **Import**. - - Upload the JSON file for the dashboard or paste the JSON content directly. - -1. **Select Data Source**: - - - When prompted, select the MQTT data source you configured earlier. - 1. **View Dashboard**: - - Navigate to the dashboard you imported to view the telemetry data. + - Navigate to **Dashboards** to view the telemetry dashboards. Dashboards are automatically synced from `grafana/dashboards/` in this repository via Grafana Git Sync. + - To update a dashboard, see [grafana/DASHBOARD_WORKFLOW.md](grafana/DASHBOARD_WORKFLOW.md). ### Helpful Commands diff --git a/grafana/.env.example b/grafana/.env.example index 9f11bcf..dd0cd16 100644 --- a/grafana/.env.example +++ b/grafana/.env.example @@ -1,5 +1,8 @@ -MQTT_PASSWORD=yourpassword MQTT_USERNAME=yourusername +MQTT_PASSWORD=yourpassword +MQTT_HOST=yourhost:1883 + POSTGRES_USERNAME=yourusername POSTGRES_PASSWORD=yourpassword -POSTGRES_HOST=yourhost \ No newline at end of file +POSTGRES_HOST=yourhost +POSTGRES_SSLMODE=disable diff --git a/grafana/DASHBOARD_WORKFLOW.md b/grafana/DASHBOARD_WORKFLOW.md new file mode 100644 index 0000000..a6605b1 --- /dev/null +++ b/grafana/DASHBOARD_WORKFLOW.md @@ -0,0 +1,55 @@ +# Dashboard Update Workflow + +Edit dashboards locally, commit to `main`, and Grafana Cloud updates automatically via Git Sync. +You can also edit dashboards directly in Grafana Cloud — changes are committed back to this repo automatically. + +## Updating a dashboard from local + +### 1. Start local Grafana + +```bash +cd grafana +docker compose up -d +``` + +Open http://localhost:3000 (admin / admin). + +### 2. Edit the dashboard locally + +Make your changes in local Grafana as usual. + +### 3. Export the dashboard JSON + +Save the dashboard in Grafana first (Ctrl+S), then export — this ensures the +exported JSON reflects your latest changes. + +1. Open the dashboard in local Grafana +2. Click the **Share icon** (top right) +3. Select the **Export** tab +4. Click **Copy to clipboard** + +### 4. Replace the file in git + +Open the corresponding file in `grafana/dashboards/` and paste the clipboard +content, replacing the entire file contents. The filename should stay the same. + +### 5. Commit and push to `main` + +Grafana Cloud syncs from the `main` branch every 60 seconds and picks up the changes automatically. + +--- + +## Editing directly in Grafana Cloud + +1. Edit the dashboard in Grafana Cloud as usual +2. When saving, choose **Open pull request** to create a PR, or commit directly to `main` +3. The change is reflected in the repo automatically + +--- + +## Common mistakes + +| Mistake | Result | +| --- | --- | +| Using "Share externally" instead of "Export" | Creates a public URL link — not what you want | +| Editing a dashboard in Grafana Cloud without Git Sync active | Changes may be overwritten on next sync | diff --git a/grafana/dashboards/Das Telemetry Base Dashboard (History)-1769897898291.json b/grafana/dashboards/Das Telemetry Base Dashboard (History).json similarity index 85% rename from grafana/dashboards/Das Telemetry Base Dashboard (History)-1769897898291.json rename to grafana/dashboards/Das Telemetry Base Dashboard (History).json index 9a49a62..23c3392 100644 --- a/grafana/dashboards/Das Telemetry Base Dashboard (History)-1769897898291.json +++ b/grafana/dashboards/Das Telemetry Base Dashboard (History).json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 8, + "id": 7, "links": [], "panels": [ { @@ -35,6 +35,32 @@ "type": "row" }, { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "grafana-postgresql-datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, "gridPos": { "h": 8, "w": 6, @@ -42,17 +68,53 @@ "y": 1 }, "id": 3, - "libraryPanel": { - "name": "Pack State Of Charge", - "uid": "efagvhn0selfkc" + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "sizing": "auto" }, + "pluginVersion": "12.3.1", + "targets": [ + { + "dataset": "tsdb", + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "grafana-postgresql-datasource" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT \"timestamp\", \"PackStateOfCharge\"\nFROM telemetry_packet\nWHERE $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [], + "limit": 50 + } + } + ], "title": "Pack State Of Charge", - "type": "library-panel-ref" + "type": "gauge" }, { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -136,12 +198,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"Timestamp\", \"PackCurrent\", \"PackVoltage\", \"PackStateOfCharge\", \"PackAmphours\", \"RegenBraking\" \nFROM telemetry_packet\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"timestamp\", \"PackCurrent\", \"PackVoltage\", \"PackStateOfCharge\", \"PackAmphours\", \"RegenBraking\" \nFROM telemetry_packet\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -168,7 +230,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -223,12 +285,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"Timestamp\", \"EnergyConsumed\" \nFROM lap\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"timestamp\", \"EnergyConsumed\" \nFROM lap\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -255,7 +317,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -310,12 +372,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT\n \"Timestamp\" AS time,\n \"TotalPowerIn\"\nFROM lap\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT\n \"timestamp\" AS time,\n \"TotalPowerIn\"\nFROM lap\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -342,7 +404,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -397,12 +459,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"Timestamp\", \"AveragePackCurrent\"\nFROM lap \nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"timestamp\", \"AveragePackCurrent\"\nFROM lap \nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -429,7 +491,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -484,12 +546,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"TotalPowerOut\" \nFROM lap\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"TotalPowerOut\" \nFROM lap\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -516,7 +578,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -542,7 +604,7 @@ "overrides": [] }, "gridPos": { - "h": 7, + "h": 8, "w": 6, "x": 0, "y": 17 @@ -571,12 +633,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"Timestamp\", \"BatterySecondsRemaining\" \nFROM lap \nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"timestamp\", \"BatterySecondsRemaining\" \nFROM lap \nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -622,7 +684,7 @@ "h": 1, "w": 24, "x": 0, - "y": 24 + "y": 25 }, "id": 16, "panels": [], @@ -632,7 +694,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -661,7 +723,7 @@ "h": 7, "w": 6, "x": 0, - "y": 25 + "y": 26 }, "id": 17, "options": { @@ -687,12 +749,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"Timestamp\", \"AverageSpeed\" \nFROM lap\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"timestamp\", \"AverageSpeed\" \nFROM lap\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -719,7 +781,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -749,7 +811,7 @@ "h": 7, "w": 6, "x": 6, - "y": 25 + "y": 26 }, "id": 18, "options": { @@ -775,12 +837,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"Timestamp\", \"LapTime\" \nFROM lap \nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"timestamp\", \"LapTime\" \nFROM lap \nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -810,7 +872,7 @@ "h": 1, "w": 24, "x": 0, - "y": 32 + "y": 33 }, "id": 8, "panels": [], @@ -820,7 +882,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -882,7 +944,7 @@ "h": 8, "w": 12, "x": 0, - "y": 33 + "y": 34 }, "id": 7, "options": { @@ -904,12 +966,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"Timestamp\", \"Acceleration\", \"BrakeSwitchDigital\", \"LeftSignalStatus\", \"RightSignalStatus\" \nFROM telemetry_packet \nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"timestamp\", \"Acceleration\", \"BrakeSwitchDigital\", \"LeftSignalStatus\", \"RightSignalStatus\" \nFROM telemetry_packet \nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -936,7 +998,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "description": "Critical system errors or safety trips within the battery management system.", "fieldConfig": { @@ -999,7 +1061,7 @@ "h": 8, "w": 12, "x": 12, - "y": 33 + "y": 34 }, "id": 9, "options": { @@ -1021,12 +1083,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"ProximitySensor1\", \"Timestamp\", \"ProtectionTrip\", \"MalfunctionIndicatorActive\", \"ArrayContactorError\"\nFROM telemetry_packet \nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"ProximitySensor1\", \"timestamp\", \"ProtectionTrip\", \"MalfunctionIndicatorActive\", \"ArrayContactorError\"\nFROM telemetry_packet \nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ @@ -1053,7 +1115,7 @@ { "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "fieldConfig": { "defaults": { @@ -1082,7 +1144,7 @@ "h": 6, "w": 6, "x": 0, - "y": 41 + "y": 42 }, "id": 15, "options": { @@ -1108,12 +1170,12 @@ "dataset": "tsdb", "datasource": { "type": "grafana-postgresql-datasource", - "uid": "ffbv3rpe7yy2oc" + "uid": "grafana-postgresql-datasource" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \"Timestamp\", \"Distance\" \nFROM lap \nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY \"Timestamp\" ASC", + "rawSql": "SELECT \"timestamp\", \"Distance\" \nFROM lap \nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY \"timestamp\" ASC", "refId": "A", "sql": { "columns": [ diff --git a/grafana/dashboards/Das Telemetry Base Dashboard-1763418239880.json b/grafana/dashboards/Das Telemetry Base Dashboard-1763418239880.json deleted file mode 100644 index 8ee4aa6..0000000 --- a/grafana/dashboards/Das Telemetry Base Dashboard-1763418239880.json +++ /dev/null @@ -1,1395 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 2, - "links": [], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 2, - "panels": [], - "title": "Range and Efficiency", - "type": "row" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "FanSpeed" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [] - } - ] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 0, - "y": 1 - }, - "id": 3, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "refId": "A", - "topic": "packet" - } - ], - "title": "Pack State Of Charge", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "PackStateOfCharge" - } - ], - "keepTime": false, - "replace": true, - "source": "Battery" - } - } - ], - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "showValues": false, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "PackCurrent" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 6, - "y": 1 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "refId": "A", - "topic": "packet" - } - ], - "title": "Packet (History)", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "PackVoltage" - }, - { - "path": "PackCurrent" - }, - { - "alias": "PackStateOfCharge (SOC)", - "path": "PackStateOfCharge" - }, - { - "alias": "PackAmphours (Ah)", - "path": "PackAmphours" - } - ], - "keepTime": false, - "replace": false, - "source": "Battery" - } - }, - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "RegenBraking" - } - ], - "keepTime": false, - "replace": false, - "source": "B3" - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "kwatth" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 0, - "y": 9 - }, - "id": 11, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "golioth-websocket-datasource", - "uid": "bf4fqic90e41se" - }, - "fields": [ - { - "jsonPath": "$.data.data", - "language": "jsonpath", - "name": "" - } - ], - "path": "", - "refId": "A", - "topic": "lapdata", - "withStreaming": true - } - ], - "title": "Energy Consumed", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "energyConsumed" - } - ], - "replace": true, - "source": "data" - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "kwatth" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 6, - "x": 6, - "y": 9 - }, - "id": 13, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "golioth-websocket-datasource", - "uid": "bf4fqic90e41se" - }, - "fields": [ - { - "jsonPath": "$.data.data", - "language": "jsonpath", - "name": "" - } - ], - "path": "", - "refId": "A", - "topic": "lapdata", - "withStreaming": true - } - ], - "title": "Total Power In", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "totalPowerIn" - } - ], - "replace": true, - "source": "data" - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "amph" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 7, - "x": 12, - "y": 9 - }, - "id": 10, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "golioth-websocket-datasource", - "uid": "bf4fqic90e41se" - }, - "fields": [ - { - "jsonPath": "$.data.data", - "language": "jsonpath", - "name": "" - } - ], - "path": "", - "refId": "A", - "topic": "lapdata", - "withStreaming": true - } - ], - "title": "Average Pack Current", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "averagePackCurrent" - } - ], - "replace": true, - "source": "data" - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "kwatt" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 6, - "x": 6, - "y": 13 - }, - "id": 14, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "golioth-websocket-datasource", - "uid": "bf4fqic90e41se" - }, - "fields": [ - { - "jsonPath": "$.data.data", - "language": "jsonpath", - "name": "" - } - ], - "path": "", - "refId": "A", - "topic": "lapdata", - "withStreaming": true - } - ], - "title": "Total Power Out", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "totalPowerOut" - } - ], - "replace": true, - "source": "data" - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 0, - "y": 17 - }, - "id": 12, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "golioth-websocket-datasource", - "uid": "bf4fqic90e41se" - }, - "fields": [ - { - "jsonPath": "$.data.data", - "language": "jsonpath", - "name": "" - } - ], - "path": "", - "refId": "A", - "topic": "lapdata", - "withStreaming": true - } - ], - "title": "Battery Seconds Remaining", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "batterySecondsRemaining" - } - ], - "replace": true, - "source": "data" - } - } - ], - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 24 - }, - "id": 16, - "panels": [], - "title": "Speed & Performance", - "type": "row" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "velocitykmh" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 0, - "y": 25 - }, - "id": 17, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "golioth-websocket-datasource", - "uid": "bf4fqic90e41se" - }, - "fields": [ - { - "jsonPath": "$.data.data", - "language": "jsonpath", - "name": "" - } - ], - "path": "", - "refId": "A", - "topic": "lapdata", - "withStreaming": true - } - ], - "title": "Average Speed", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "averageSpeed" - } - ], - "replace": true, - "source": "data" - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "dtdurations" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 6, - "y": 25 - }, - "id": 18, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "golioth-websocket-datasource", - "uid": "bf4fqic90e41se" - }, - "fields": [ - { - "jsonPath": "$.data.data", - "language": "jsonpath", - "name": "" - } - ], - "path": "", - "refId": "A", - "topic": "lapdata", - "withStreaming": true - } - ], - "title": "Lap Time", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "lapTime" - } - ], - "keepTime": false, - "replace": true, - "source": "data" - } - } - ], - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 32 - }, - "id": 8, - "panels": [], - "title": "Driving Behavior and Safety", - "type": "row" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "showValues": false, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "RightSignalStatus" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 33 - }, - "id": 7, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "refId": "A", - "topic": "packet" - } - ], - "title": "Driving Behavior", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "Acceleration" - }, - { - "path": "BrakeSwitchDigital" - }, - { - "path": "LeftSignalStatus" - }, - { - "path": "RightSignalStatus" - } - ], - "keepTime": false, - "replace": false, - "source": "B3" - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "description": "Critical system errors or safety trips within the battery management system.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "showValues": false, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "MalfunctionIndicatorActive" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 33 - }, - "id": 9, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "refId": "A", - "topic": "packet" - } - ], - "title": "Safety", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "ProximitySensor1" - } - ], - "source": "ProximitySensors" - } - }, - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "ProtectionTrip" - } - ], - "source": "MBMS" - } - }, - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "MalfunctionIndicatorActive" - } - ], - "source": "Battery" - } - }, - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "Error" - } - ], - "source": "Contactor" - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "lengthkm" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 6, - "x": 0, - "y": 41 - }, - "id": 15, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.3.1", - "targets": [ - { - "datasource": { - "type": "golioth-websocket-datasource", - "uid": "bf4fqic90e41se" - }, - "fields": [ - { - "jsonPath": "$.data.data", - "language": "jsonpath", - "name": "" - } - ], - "path": "", - "refId": "A", - "topic": "lapdata", - "withStreaming": true - } - ], - "title": "Total Distance", - "transformations": [ - { - "id": "extractFields", - "options": { - "delimiter": ",", - "format": "json", - "jsonPaths": [ - { - "path": "distance" - } - ], - "replace": true, - "source": "data" - } - } - ], - "type": "stat" - } - ], - "preload": false, - "refresh": "1m", - "schemaVersion": 42, - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "Das Telemetry Base Dashboard", - "uid": "40c53014-a3c2-47e8-8c8b-3ce15a6ecc61", - "version": 14 -} \ No newline at end of file diff --git a/grafana/dashboards/Das Telemetry Base Dashboard.json b/grafana/dashboards/Das Telemetry Base Dashboard.json new file mode 100644 index 0000000..b1ee908 --- /dev/null +++ b/grafana/dashboards/Das Telemetry Base Dashboard.json @@ -0,0 +1,660 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "panels": [], + "title": "Range and Efficiency", + "type": "row" + }, + { + "datasource": { + "type": "grafana-mqtt-datasource", + "uid": "grafana-mqtt-datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "FanSpeed" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [] + } + ] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 1 + }, + "id": 3, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-mqtt-datasource", + "uid": "grafana-mqtt-datasource" + }, + "refId": "A", + "topic": "packet" + } + ], + "title": "Pack State Of Charge", + "transformations": [ + { + "id": "extractFields", + "options": { + "delimiter": ",", + "format": "json", + "jsonPaths": [ + { + "path": "PackStateOfCharge" + } + ], + "keepTime": false, + "replace": true, + "source": "Battery" + } + } + ], + "type": "gauge" + }, + { + "datasource": { + "type": "grafana-mqtt-datasource", + "uid": "grafana-mqtt-datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "PackCurrent" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": true, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 6, + "y": 1 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-mqtt-datasource", + "uid": "grafana-mqtt-datasource" + }, + "refId": "A", + "topic": "packet" + } + ], + "title": "Packet (History)", + "transformations": [ + { + "id": "extractFields", + "options": { + "delimiter": ",", + "format": "json", + "jsonPaths": [ + { + "path": "PackVoltage" + }, + { + "path": "PackCurrent" + }, + { + "alias": "PackStateOfCharge (SOC)", + "path": "PackStateOfCharge" + }, + { + "alias": "PackAmphours (Ah)", + "path": "PackAmphours" + } + ], + "keepTime": false, + "replace": false, + "source": "Battery" + } + }, + { + "id": "extractFields", + "options": { + "delimiter": ",", + "format": "json", + "jsonPaths": [ + { + "path": "RegenBraking" + } + ], + "keepTime": false, + "replace": false, + "source": "B3" + } + } + ], + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 16, + "panels": [], + "title": "Speed & Performance", + "type": "row" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 8, + "panels": [], + "title": "Driving Behavior and Safety", + "type": "row" + }, + { + "datasource": { + "type": "grafana-mqtt-datasource", + "uid": "grafana-mqtt-datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "RightSignalStatus" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": true, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 11 + }, + "id": 7, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-mqtt-datasource", + "uid": "grafana-mqtt-datasource" + }, + "refId": "A", + "topic": "packet" + } + ], + "title": "Driving Behavior", + "transformations": [ + { + "id": "extractFields", + "options": { + "delimiter": ",", + "format": "json", + "jsonPaths": [ + { + "path": "Acceleration" + }, + { + "path": "BrakeSwitchDigital" + }, + { + "path": "LeftSignalStatus" + }, + { + "path": "RightSignalStatus" + } + ], + "keepTime": false, + "replace": false, + "source": "B3" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-mqtt-datasource", + "uid": "grafana-mqtt-datasource" + }, + "description": "Critical system errors or safety trips within the battery management system.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "MalfunctionIndicatorActive" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": true, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 11 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "grafana-mqtt-datasource", + "uid": "grafana-mqtt-datasource" + }, + "refId": "A", + "topic": "packet" + } + ], + "title": "Safety", + "transformations": [ + { + "id": "extractFields", + "options": { + "delimiter": ",", + "format": "json", + "jsonPaths": [ + { + "path": "ProximitySensor1" + } + ], + "source": "ProximitySensors" + } + }, + { + "id": "extractFields", + "options": { + "delimiter": ",", + "format": "json", + "jsonPaths": [ + { + "path": "ProtectionTrip" + } + ], + "source": "MBMS" + } + }, + { + "id": "extractFields", + "options": { + "delimiter": ",", + "format": "json", + "jsonPaths": [ + { + "path": "MalfunctionIndicatorActive" + } + ], + "source": "Battery" + } + }, + { + "id": "extractFields", + "options": { + "delimiter": ",", + "format": "json", + "jsonPaths": [ + { + "path": "ArrayContactorError" + } + ], + "source": "Contactor" + } + } + ], + "type": "timeseries" + } + ], + "preload": false, + "refresh": "1m", + "schemaVersion": 42, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Das Telemetry Base Dashboard", + "uid": "40c53014-a3c2-47e8-8c8b-3ce15a6ecc61", + "version": 7 +} \ No newline at end of file diff --git a/grafana/dashboards/Telemetry Base Dashboard-1752806086997.json b/grafana/dashboards/Telemetry Base Dashboard.json similarity index 96% rename from grafana/dashboards/Telemetry Base Dashboard-1752806086997.json rename to grafana/dashboards/Telemetry Base Dashboard.json index 1e6c5df..50fcf29 100644 --- a/grafana/dashboards/Telemetry Base Dashboard-1752806086997.json +++ b/grafana/dashboards/Telemetry Base Dashboard.json @@ -24,7 +24,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" + "uid": "grafana-mqtt-datasource" }, "fieldConfig": { "defaults": { @@ -123,7 +123,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" + "uid": "grafana-mqtt-datasource" }, "fieldConfig": { "defaults": { @@ -238,7 +238,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "${DS_GRAFANA-MQTT-DATASOURCE}" + "uid": "grafana-mqtt-datasource" }, "refId": "A", "topic": "packet" @@ -270,7 +270,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" + "uid": "grafana-mqtt-datasource" }, "fieldConfig": { "defaults": { @@ -333,7 +333,9 @@ "id": "byNames", "options": { "mode": "exclude", - "names": ["MotorCurrent"], + "names": [ + "MotorCurrent" + ], "prefix": "All except:", "readOnly": true } @@ -376,7 +378,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "${DS_GRAFANA-MQTT-DATASOURCE}" + "uid": "grafana-mqtt-datasource" }, "refId": "A", "topic": "packet" @@ -411,7 +413,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" + "uid": "grafana-mqtt-datasource" }, "fieldConfig": { "defaults": { @@ -473,7 +475,9 @@ "id": "byNames", "options": { "mode": "exclude", - "names": ["ArrayChargeCurrent"], + "names": [ + "ArrayChargeCurrent" + ], "prefix": "All except:", "readOnly": true } @@ -516,7 +520,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "${DS_GRAFANA-MQTT-DATASOURCE}" + "uid": "grafana-mqtt-datasource" }, "hide": false, "refId": "A", @@ -541,7 +545,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "P51B197A508373975" + "uid": "grafana-mqtt-datasource" }, "fieldConfig": { "defaults": { @@ -603,7 +607,9 @@ "id": "byNames", "options": { "mode": "exclude", - "names": ["AverageCellVoltage"], + "names": [ + "AverageCellVoltage" + ], "prefix": "All except:", "readOnly": true } @@ -646,7 +652,7 @@ { "datasource": { "type": "grafana-mqtt-datasource", - "uid": "${DS_GRAFANA-MQTT-DATASOURCE}" + "uid": "grafana-mqtt-datasource" }, "refId": "A", "topic": "packet" diff --git a/grafana/docker-compose.yml b/grafana/docker-compose.yml index bede113..5a6b5df 100644 --- a/grafana/docker-compose.yml +++ b/grafana/docker-compose.yml @@ -13,9 +13,12 @@ services: - GF_SECURITY_ADMIN_USER=admin - GF_SECURITY_ADMIN_PASSWORD=admin - GF_INSTALL_PLUGINS=grafana-mqtt-datasource + - MQTT_HOST=${MQTT_HOST} - MQTT_USERNAME=${MQTT_USERNAME} - MQTT_PASSWORD=${MQTT_PASSWORD} - POSTGRES_USERNAME=${POSTGRES_USERNAME} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_HOST=${POSTGRES_HOST} + - POSTGRES_SSLMODE=${POSTGRES_SSLMODE} volumes: grafana-storage: diff --git a/grafana/provisioning/datasources/datasources.yaml b/grafana/provisioning/datasources/datasources.yaml index 270d717..a0b1feb 100644 --- a/grafana/provisioning/datasources/datasources.yaml +++ b/grafana/provisioning/datasources/datasources.yaml @@ -1,8 +1,9 @@ apiVersion: 1 datasources: - # configruation setup viewable here: https://github.com/grafana/mqtt-datasource/blob/main/src/ConfigEditor.tsx + # configuration setup viewable here: https://github.com/grafana/mqtt-datasource/blob/main/src/ConfigEditor.tsx - name: MQTT + uid: grafana-mqtt-datasource type: grafana-mqtt-datasource editable: true isDefault: true @@ -10,23 +11,25 @@ datasources: password: ${MQTT_PASSWORD} jsonData: username: ${MQTT_USERNAME} - uri: host.docker.internal:1883 + uri: ${MQTT_HOST} - name: grafana-postgresql-datasource + uid: grafana-postgresql-datasource type: postgres url: ${POSTGRES_HOST} - database: tsdb + database: postgres user: ${POSTGRES_USERNAME} secureJsonData: password: ${POSTGRES_PASSWORD} jsonData: - sslmode: "require" - postgresVersion: 9.3 - timescaledb: true + sslmode: ${POSTGRES_SSLMODE} + postgresVersion: 1500 + timescaledb: false minInterval: 1m - maxOpenConns: 100 - maxIdleConns: 100 + maxOpenConns: 10 + maxIdleConns: 10 maxLifetime: 14400 + connMaxIdleTime: 300 editable: true # - name: Postgres # type: postgres From 0a8bcd56a08f177cb8438ca24d01f73c2ee3bae8 Mon Sep 17 00:00:00 2001 From: Dastine Date: Sat, 23 May 2026 12:02:21 -0600 Subject: [PATCH 2/2] fix: update MQTT and PostgreSQL host configurations in .env.example --- grafana/.env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grafana/.env.example b/grafana/.env.example index dd0cd16..18e08bc 100644 --- a/grafana/.env.example +++ b/grafana/.env.example @@ -1,8 +1,8 @@ MQTT_USERNAME=yourusername MQTT_PASSWORD=yourpassword -MQTT_HOST=yourhost:1883 +MQTT_HOST=host.docker.internal:1883 POSTGRES_USERNAME=yourusername POSTGRES_PASSWORD=yourpassword -POSTGRES_HOST=yourhost +POSTGRES_HOST=host.docker.internal:5432 POSTGRES_SSLMODE=disable