From 439fa0ff476e5b910704f9ade25f660985e977fe Mon Sep 17 00:00:00 2001 From: Adrian Kumpf Date: Thu, 13 Jun 2019 16:55:09 +0200 Subject: [PATCH] Add grafana dashboards --- .gitignore | 1 + README.md | 33 +- dashboards/adressen.json | 344 ++++++++++++++++++++ dashboards/degradation.json | 177 ++++++++++ dashboards/effizienz.json | 521 ++++++++++++++++++++++++++++++ dashboards/home.json | 98 ++++++ dashboards/kilometerstand.json | 169 ++++++++++ dashboards/ladehistorie.json | 412 +++++++++++++++++++++++ dashboards/laden.json | 227 +++++++++++++ dashboards/position.json | 108 +++++++ dashboards/soc-ladestatistik.json | 160 +++++++++ dashboards/trips.json | 515 +++++++++++++++++++++++++++++ dashboards/updates.json | 167 ++++++++++ dashboards/vampire-drain.json | 363 +++++++++++++++++++++ dashboards/verbrauch.json | 337 +++++++++++++++++++ dashboards/visited.json | 106 ++++++ dashboards/zustande.json | 501 ++++++++++++++++++++++++++++ 17 files changed, 4228 insertions(+), 11 deletions(-) create mode 100644 dashboards/adressen.json create mode 100644 dashboards/degradation.json create mode 100644 dashboards/effizienz.json create mode 100644 dashboards/home.json create mode 100644 dashboards/kilometerstand.json create mode 100644 dashboards/ladehistorie.json create mode 100644 dashboards/laden.json create mode 100644 dashboards/position.json create mode 100644 dashboards/soc-ladestatistik.json create mode 100644 dashboards/trips.json create mode 100644 dashboards/updates.json create mode 100644 dashboards/vampire-drain.json create mode 100644 dashboards/verbrauch.json create mode 100644 dashboards/visited.json create mode 100644 dashboards/zustande.json diff --git a/.gitignore b/.gitignore index 14b736c4..93708e63 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ npm-debug.log config/*.env /deploy/ +conf/wizzy.json diff --git a/README.md b/README.md index 0dfdccde..2fe8086c 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,30 @@ To start your Phoenix server: - * Install dependencies with `mix deps.get` - * Create and migrate your database with `mix ecto.setup` - * Install Node.js dependencies with `cd assets && npm install` - * Start Phoenix endpoint with `mix phx.server` +- Install dependencies with `mix deps.get` +- Create and migrate your database with `mix ecto.setup` +- Install Node.js dependencies with `cd assets && npm install` +- Start Phoenix endpoint with `mix phx.server` Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. -Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html). +## Dashboards -## Learn more +### Prerequisites - * Official website: http://www.phoenixframework.org/ - * Guides: https://hexdocs.pm/phoenix/overview.html - * Docs: https://hexdocs.pm/phoenix - * Mailing list: http://groups.google.com/group/phoenix-talk - * Source: https://github.com/phoenixframework/phoenix +1. Download and install wizzy: [Installation](https://utkarshcmu.github.io/wizzy-site/home/getting-started/) +2. Configure grafana properties: + +```bash +wizzy set grafana url http://localhost:3000 +wizzy set grafana username admin +wizzy set grafana password password +``` + +### Backup Dashboards + +To backup (import) all dashboards from grafana run: `wizzy import dashboards`. + +### Restore Dashboards + +To restore (export) all dashboards to grafana run: `wizzy export dashboards`. diff --git a/dashboards/adressen.json b/dashboards/adressen.json new file mode 100644 index 00000000..0c5601be --- /dev/null +++ b/dashboards/adressen.json @@ -0,0 +1,344 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "columns": [], + "fontSize": "100%", + "gridPos": { + "h": 14, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 4, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Name", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "display_name", + "type": "string" + }, + { + "alias": "Besuche", + "colorMode": "value", + "colors": [ + "rgb(136, 138, 136)", + "#96D98D", + "#37872D" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "visited", + "thresholds": [ + "2", + "10", + "100000000000" + ], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n\tcount(*) AS visited,\n\tdisplay_name\nFROM\n\ttrips t\nINNER JOIN addresses a ON end_address_id = a.id\nGROUP BY\n\tdisplay_name\nORDER BY\n\tvisited desc\nLIMIT 15", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Top 15", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "fontSize": "100%", + "gridPos": { + "h": 21, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 2, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 7, + "desc": true + }, + "styles": [ + { + "alias": "Aktualisiert", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "updated_at", + "type": "date" + }, + { + "alias": "Name", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "link": true, + "linkTargetBlank": true, + "linkUrl": "https://www.google.com/maps/search/?api=1&query=${__cell_0},${__cell_1}", + "mappingType": 1, + "pattern": "name", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Stadtteil", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "neighbourhood", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Stadt", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "city", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Bundesland", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "state", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Land", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "country", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "latitude", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "longitude", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select\nlatitude,\nlongitude,\nCOALESCE(name, CONCAT(road, ' ', house_number)) as name,\nneighbourhood,\ncity,\nstate,\ncountry,\nupdated_at\nfrom addresses\nwhere $__timeFilter(updated_at)", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Destinationen", + "transform": "table", + "type": "table" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30d", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Adressen", + "uid": "ZzhF-aRWz" +} \ No newline at end of file diff --git a/dashboards/degradation.json b/dashboards/degradation.json new file mode 100644 index 00000000..48c53826 --- /dev/null +++ b/dashboards/degradation.json @@ -0,0 +1,177 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "TeslaMate", + "decimals": 2, + "fill": 1, + "gridPos": { + "h": 21, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Kilometerstand", + "fill": 0, + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "", + "format": "time_series", + "group": [], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n\t$__time(start_date),\n\tcalculated_max_range as \"Maximalreichweite\",\n\tpositions.odometer as \"Kilometerstand\"\nFROM\n\tcharging_processes\n\tINNER JOIN positions ON positions.id = charging_processes.position_id\n\tWHERE\n\t\t$__timeFilter(start_date);", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Degradation", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 1, + "format": "lengthkm", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "lengthkm", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now/M", + "to": "now/M" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Degradation", + "uid": "riqUfXgRz" +} \ No newline at end of file diff --git a/dashboards/effizienz.json b/dashboards/effizienz.json new file mode 100644 index 00000000..06491ab1 --- /dev/null +++ b/dashboards/effizienz.json @@ -0,0 +1,521 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "decimals": 2, + "format": "kwatth", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 8, + "x": 0, + "y": 0 + }, + "id": 4, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "pluginVersion": "6.1.1", + "postfix": " / 100km", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "?column?", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n sum(\"consumption_kWh\") / sum(distance) * 100\nfrom trips \nwhere \n distance is not null \n and \"consumption_kWh\" is not null\n and car_id = 1", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Ø-Verbrauch (netto)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "decimals": 2, + "format": "kwatth", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 8, + "x": 8, + "y": 0 + }, + "id": 8, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": " / 100km", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "?column?", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "WITH d1 AS (\n\tSELECT\n\t\tc.car_id,\n\t\tlag(end_range_km) OVER (ORDER BY start_date) - start_range_km AS range_loss,\n\t\tp.odometer - lag(p.odometer) OVER (ORDER BY start_date) AS distance\n\tFROM\n\t\tcharging_processes c\n\tLEFT JOIN positions p ON p.id = c.position_id \n\tWHERE\n\t end_date IS NOT NULL\n\tORDER BY\n\t\tstart_date\n),\nd2 AS (\nSELECT\n\tcar_id,\n\tsum(range_loss) AS range_loss,\n\tsum(distance) AS distance\nFROM\n\td1\nWHERE\n\tdistance >= 0 AND range_loss >= 0\nGROUP BY\n\tcar_id\n)\nSELECT\n\trange_loss * c.efficiency / distance * 100\nFROM\n\td2\n\tLEFT JOIN cars c ON c.id = car_id", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Ø-Verbrauch (brutto) ", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "decimals": 1, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 8, + "x": 16, + "y": 0 + }, + "id": 6, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": " km", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "sum", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select sum(distance) from trips where car_id = 1;", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Geloggte Distanz", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "columns": [], + "fontSize": "100%", + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 3 + }, + "id": 2, + "links": [], + "options": {}, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Temperatur", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "outside_temp", + "type": "number", + "unit": "celsius" + }, + { + "alias": "Ø Effizienz", + "colorMode": "value", + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "efficiency", + "thresholds": [ + "1.05", + "1.5" + ], + "type": "number", + "unit": "percentunit" + }, + { + "alias": "Distanz", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "total_distance", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "Ø Verbrauch/100km", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "consumption", + "thresholds": [], + "type": "number", + "unit": "kwatth" + }, + { + "alias": "Ø Geschwindigkeit", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "avg_speed", + "thresholds": [], + "type": "number", + "unit": "velocitykmh" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "WITH t AS (\n\tSELECT\n\t\tROUND(cast(outside_temp_avg AS numeric) / 5, 0) * 5 AS outside_temp,\n\t\tsum(\"consumption_kWh\") AS total_consumption,\n\t\tsum(distance) AS total_distance,\n\t\tsum(duration_min) as duration,\n\t\tcar_id\n\tFROM\n\t\ttrips\n\tWHERE\n\t\tdistance IS NOT NULL\n\t\tAND \"consumption_kWh\" IS NOT NULL\n\t\tAND car_id = 1\n\tGROUP BY\n\t\t1,\n\t\tcar_id\n)\n\nSELECT\n\toutside_temp,\n\ttotal_consumption / total_distance * 100 AS consumption,\n\t(total_consumption / total_distance) / c.efficiency AS efficiency,\n\ttotal_distance,\n\t(total_distance / duration) * 60 as avg_speed\nFROM\n\tt\nJOIN cars c ON t.car_id = c.id", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Temperatur – Effizienz", + "transform": "table", + "type": "table" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "hidden": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Effizienz", + "uid": "fu4SiQgWz" +} \ No newline at end of file diff --git a/dashboards/home.json b/dashboards/home.json new file mode 100644 index 00000000..bdccdb20 --- /dev/null +++ b/dashboards/home.json @@ -0,0 +1,98 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "content": "
\n TeslaMate\n
", + "editable": true, + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "links": [], + "mode": "html", + "style": {}, + "title": "", + "transparent": true, + "type": "text" + }, + { + "folderId": 0, + "gridPos": { + "h": 16, + "w": 24, + "x": 0, + "y": 3 + }, + "headings": false, + "id": 3, + "limit": 30, + "links": [], + "query": "", + "recent": false, + "search": true, + "starred": false, + "tags": [], + "title": "", + "type": "dashlist" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "hidden": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ], + "type": "timepicker" + }, + "timezone": "browser", + "title": "Home", + "uid": "m1DDO66mz" +} \ No newline at end of file diff --git a/dashboards/kilometerstand.json b/dashboards/kilometerstand.json new file mode 100644 index 00000000..45bca45f --- /dev/null +++ b/dashboards/kilometerstand.json @@ -0,0 +1,169 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "TeslaMate", + "fill": 1, + "gridPos": { + "h": 21, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "", + "format": "time_series", + "group": [], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT $__time(date), odometer as \"Kilometerstand\" from positions where $__timeFilter(date) order by date desc;\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Kilometerstand", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 1, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "locale", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6M", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Kilometerstand", + "uid": "NjtMTFggz" +} \ No newline at end of file diff --git a/dashboards/ladehistorie.json b/dashboards/ladehistorie.json new file mode 100644 index 00000000..59358efa --- /dev/null +++ b/dashboards/ladehistorie.json @@ -0,0 +1,412 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "columns": [], + "datasource": "TeslaMate", + "fontSize": "100%", + "gridPos": { + "h": 26, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 6, + "links": [], + "options": {}, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 2, + "desc": true + }, + "styles": [ + { + "alias": "Startdatum", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": true, + "linkUrl": "d/BHhxFeZRz/laden?orgId=1&from=${__cell_0}&to=${__cell_1}&&var-charging_process_id=${__cell_12}", + "pattern": "start_date", + "type": "date" + }, + { + "alias": "Enddatum", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "end_date", + "thresholds": [], + "type": "date", + "unit": "short" + }, + { + "alias": "geladen", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "charge_energy_added", + "thresholds": [], + "type": "number", + "unit": "kwatth" + }, + { + "alias": "TR Start", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "start_range_km", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "TR End", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "end_range_km", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "SOC Start", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "start_battery_level", + "thresholds": [], + "type": "number", + "unit": "percent" + }, + { + "alias": "SOC End", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "end_battery_level", + "thresholds": [], + "type": "number", + "unit": "percent" + }, + { + "alias": "TR 100%", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "calculated_max_range", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "Dauer", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "duration_min", + "thresholds": [], + "type": "number", + "unit": "m" + }, + { + "alias": "Temperatur", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "outside_temp_avg", + "thresholds": [], + "type": "number", + "unit": "celsius" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": ".*_ts", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "id", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "Ort", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "address", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "gefahrene km", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": null, + "mappingType": 1, + "pattern": "distance", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "verbraucht (s. l. L.)", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "consumption_kwh", + "thresholds": [], + "type": "number", + "unit": "kwatth" + }, + { + "alias": "Verbrauch (brutto)", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "consumption_kwh_100km", + "thresholds": [], + "type": "number", + "unit": "kwatth" + }, + { + "alias": "kWh / h (Ø)", + "colorMode": "value", + "colors": [ + "#96D98D", + "#56A64B", + "#37872D" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "charge_energy_added_per_hour", + "thresholds": [ + "20", + "55" + ], + "type": "number", + "unit": "kwatth" + }, + { + "alias": "km / h (Ø)", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "range_added_per_hour", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "WITH data AS (\n\tSELECT\n\t\textract(epoch FROM start_date) * 1000 AS start_date_ts,\n\t\textract(epoch FROM end_date) * 1000 AS end_date_ts,\n\t\tstart_date,\n\t\tend_date,\n\t\tCONCAT_WS(', ', COALESCE(addresses.name, CONCAT_WS(' ', addresses.road, addresses.house_number)), addresses.city) AS address,\n\t\tcharge_energy_added,\n\t\tduration_min,\n\t\tstart_battery_level,\n\t\tend_battery_level,\n\t\tstart_range_km,\n\t\tend_range_km,\n\t\tcalculated_max_range,\n\t\toutside_temp_avg,\n\t\tc.id,\n\t\tlag(end_range_km) OVER (ORDER BY start_date) - start_range_km AS range_loss,\n\t\tp.odometer - lag(p.odometer) OVER (ORDER BY start_date) AS distance,\n\t\tcars.efficiency\n\tFROM\n\t\tcharging_processes c\n\tLEFT JOIN positions p ON p.id = c.position_id\n\tLEFT JOIN cars ON cars.id = c.car_id\n\tLEFT JOIN addresses ON addresses.id = address_id\nWHERE\n\tc.car_id = 1\n\t/* where $__timeFilter(start_date) */\n\tORDER BY\n\t\tstart_date\n)\n\nSELECT\n\tstart_date_ts,\n\tend_date_ts,\n\tstart_date,\n\tend_date,\n\taddress,\n\tcharge_energy_added,\n\tcharge_energy_added * 60 / NULLIF(duration_min, 0) as charge_energy_added_per_hour,\n\t(end_range_km - start_range_km) * 60 / NULLIF(duration_min, 0) as range_added_per_hour,\n\tduration_min,\n\tstart_battery_level,\n\tend_battery_level,\n\tstart_range_km,\n\tend_range_km,\n\tdistance,\n\trange_loss * efficiency AS consumption_kWh,\n\trange_loss * efficiency / NULLIF(distance, 0) * 100 AS consumption_kWh_100km,\n\tcalculated_max_range,\n\toutside_temp_avg,\n\tid\nFROM\n\tdata\nWHERE\n\tdistance >= 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Ladehistorie", + "transform": "table", + "type": "table" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-1y", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Ladehistorie", + "uid": "TSmNYvRRk" +} \ No newline at end of file diff --git a/dashboards/laden.json b/dashboards/laden.json new file mode 100644 index 00000000..b85cb029 --- /dev/null +++ b/dashboards/laden.json @@ -0,0 +1,227 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "TeslaMate", + "decimals": 2, + "fill": 1, + "gridPos": { + "h": 20, + "w": 16, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Reichweite [km]", + "yaxis": 2 + }, + { + "alias": "Ladespannung [V]", + "fill": 0, + "yaxis": 2 + }, + { + "alias": "SOC [%]", + "yaxis": 1 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "", + "format": "time_series", + "group": [], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n $__time(date),\n battery_level as \"SOC [%]\",\n charger_power as \"Leistung [kW]\",\n ideal_battery_range_km as \"Reichweite [km]\",\n charger_voltage as \"Ladespannung [V]\",\n charger_phases as \"Phasen\",\n charger_actual_current as \"Stromstärke [A]\",\n charger_pilot_current as \"Stromstärke (pilot) [A]\",\n outside_temp as \"Außentemperatur [°C]\"\n \nFROM\n charges\nWHERE\n $__timeFilter(date)\nORDER BY\n date ASC", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Laden", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "autoZoom": true, + "datasource": "TeslaMate", + "gridPos": { + "h": 20, + "w": 8, + "x": 16, + "y": 0 + }, + "id": 4, + "lineColor": "red", + "links": [], + "maxDataPoints": 500, + "pointColor": "royalblue", + "targets": [ + { + "alias": "", + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n $__time(c.start_date),\n p.latitude as lat,\n p.longitude as lng\nFROM charging_processes c\nleft join positions p on p.id = c.position_id\nWHERE $__timeFilter(c.start_date)\nORDER BY c.start_date ASC", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Map", + "type": "pr0ps-trackmap-panel" + } + ], + "refresh": "10s", + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now/d", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Laden", + "uid": "BHhxFeZRz" +} \ No newline at end of file diff --git a/dashboards/position.json b/dashboards/position.json new file mode 100644 index 00000000..f5036ab2 --- /dev/null +++ b/dashboards/position.json @@ -0,0 +1,108 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "autoZoom": true, + "gridPos": { + "h": 16, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "lineColor": "red", + "links": [], + "maxDataPoints": 500, + "pointColor": "royalblue", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n$__time(date),\nlatitude,\nlongitude\nfrom positions\norder by date desc\nlimit 1;", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Position", + "transparent": true, + "type": "pr0ps-trackmap-panel" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Position", + "uid": "Dz6UUdzWk" +} \ No newline at end of file diff --git a/dashboards/soc-ladestatistik.json b/dashboards/soc-ladestatistik.json new file mode 100644 index 00000000..592be660 --- /dev/null +++ b/dashboards/soc-ladestatistik.json @@ -0,0 +1,160 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "columns": [], + "fontSize": "100%", + "gridPos": { + "h": 19, + "w": 7, + "x": 0, + "y": 0 + }, + "id": 2, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "SOC", + "colorMode": "value", + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "soc", + "thresholds": [ + "80", + "91" + ], + "type": "number", + "unit": "percent" + }, + { + "alias": "Anzahl Ladungen", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "n", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 0, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "locale" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n\tROUND(end_battery_level / 5, 0) * 5 AS SOC,\n\tcount(*) AS n\nFROM\n\tcharging_processes\nWHERE\n\t$__timeFilter(start_date)\n\tAND duration_min > 3\nGROUP BY\n\tROUND(end_battery_level / 5, 0) * 5\nORDER BY\n\tSOC DESC", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "SOC Ladestatistik", + "transform": "table", + "type": "table" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6M", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "SOC Ladestatistik", + "uid": "-pkIkhmRz" +} \ No newline at end of file diff --git a/dashboards/trips.json b/dashboards/trips.json new file mode 100644 index 00000000..ce9d95d5 --- /dev/null +++ b/dashboards/trips.json @@ -0,0 +1,515 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "columns": [], + "fontSize": "100%", + "gridPos": { + "h": 22, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "links": [], + "options": {}, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 2, + "desc": true + }, + "styles": [ + { + "alias": "Start", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "link": true, + "linkTooltip": "", + "linkUrl": "d/zm7wN6Zgz/verbrauch?orgId=1&from=${__cell_0}&to=${__cell_1}", + "mappingType": 1, + "pattern": "start_date", + "thresholds": [], + "type": "date", + "unit": "short" + }, + { + "alias": "Ende", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "end_date", + "thresholds": [], + "type": "date", + "unit": "short" + }, + { + "alias": "Ø Verbrauch", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "consumption_kWh_100km", + "thresholds": [], + "type": "number", + "unit": "kwatth" + }, + { + "alias": "km", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "distance", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "Verbraucht", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "consumption_kWh", + "thresholds": [], + "type": "number", + "unit": "kwatth" + }, + { + "alias": "Start", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "link": true, + "linkTargetBlank": true, + "linkTooltip": "", + "linkUrl": "https://www.google.com/maps/search/?api=1&query=${__cell_4},${__cell_5}", + "mappingType": 1, + "pattern": "start_address", + "preserveFormat": false, + "sanitize": false, + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Ziel", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "link": true, + "linkTargetBlank": true, + "linkTooltip": "", + "linkUrl": "https://www.google.com/maps/search/?api=1&query=${__cell_6},${__cell_7}", + "mappingType": 1, + "pattern": "end_address", + "thresholds": [], + "type": "string", + "unit": "short", + "valueMaps": [] + }, + { + "alias": "Ø Außentemp.", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "outside_temp_avg", + "thresholds": [], + "type": "number", + "unit": "celsius" + }, + { + "alias": "max. Geschw.", + "colorMode": "value", + "colors": [ + "#d8d9da", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "speed_max", + "thresholds": [ + "151", + "200" + ], + "type": "number", + "unit": "velocitykmh" + }, + { + "alias": "max. Leistung", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "power_max", + "thresholds": [], + "type": "number", + "unit": "kwatt" + }, + { + "alias": "min. Leistung", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "power_min", + "thresholds": [], + "type": "number", + "unit": "kwatt" + }, + { + "alias": "Ø Leistung", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "power_avg", + "thresholds": [], + "type": "number", + "unit": "kwatt" + }, + { + "alias": "Dauer", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "duration_min", + "thresholds": [], + "type": "number", + "unit": "m" + }, + { + "alias": "TR-Verlust", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "rangediff", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "Effizienz", + "colorMode": "value", + "colors": [ + "#73BF69", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "efficiency", + "thresholds": [ + "1.05", + "1.5" + ], + "type": "number", + "unit": "percentunit" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": ".*_ts", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "Ø Geschw.", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "speed_avg", + "thresholds": [], + "type": "number", + "unit": "velocitykmh" + }, + { + "alias": "Ø Innentemp.", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "inside_temp_avg", + "thresholds": [], + "type": "number", + "unit": "celsius" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "(latitude|longitude)", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "TR Start", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "start_range_km", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "TR Ende", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "end_range_km", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "km Start", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "start_km", + "thresholds": [], + "type": "number", + "unit": "none" + }, + { + "alias": "km Ende", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "end_km", + "thresholds": [], + "type": "number", + "unit": "none" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "alias": "", + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n\textract(epoch from start_date) * 1000 as start_date_ts,\n extract(epoch from end_date) * 1000 as end_date_ts,\n\tstart_date,\n end_date,\n start_address.latitude,\n start_address.longitude,\n end_address.latitude,\n end_address.longitude,\n CONCAT_WS(', ', COALESCE(start_address.name, CONCAT_WS(' ', start_address.road, start_address.house_number)), start_address.city) as start_address,\n CONCAT_WS(', ', COALESCE(end_address.name, CONCAT_WS(' ', end_address.road, end_address.house_number)), end_address.city) as end_address,\n duration_min,\n\tdistance,\n\tstart_range_km - end_range_km AS RangeDiff,\n\tdistance / duration_min * 60 as speed_avg,\n\t\"consumption_kWh_100km\",\n\t\"consumption_kWh\",\n\tefficiency,\n\toutside_temp_avg,\n\tinside_temp_avg,\n\tspeed_max,\n\tpower_max,\n\tpower_min,\n\tpower_avg,\n\tstart_range_km,\n\tend_range_km,\n\tstart_km,\n\tend_km\nFROM\n\ttrips\nLEFT JOIN addresses start_address on start_address_id = start_address.id\nLEFT JOIN addresses end_address on end_address_id = end_address.id\nWHERE\n\t$__timeFilter(start_date) \n\tAND (duration_min > 1 OR end_date IS NULL)\nORDER BY\n\tstart_date DESC", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Trip", + "transform": "table", + "type": "table" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-90d", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Trips", + "uid": "Y8upc6ZRk" +} \ No newline at end of file diff --git a/dashboards/updates.json b/dashboards/updates.json new file mode 100644 index 00000000..4f015d10 --- /dev/null +++ b/dashboards/updates.json @@ -0,0 +1,167 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "columns": [], + "fontSize": "100%", + "gridPos": { + "h": 26, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Startdatum", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "start_date", + "type": "date" + }, + { + "alias": "Enddatum", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "end_date", + "thresholds": [], + "type": "date", + "unit": "short" + }, + { + "alias": "Installierte Version", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "version", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select start_date, end_date, version from updates where $__timeFilter(start_date);", + "refId": "A", + "select": [ + [ + { + "params": [ + "efficiency" + ], + "type": "column" + } + ] + ], + "table": "cars", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Updates", + "transform": "table", + "type": "table" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now/y", + "to": "now/y" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Updates", + "uid": "IiC07mgWz" +} \ No newline at end of file diff --git a/dashboards/vampire-drain.json b/dashboards/vampire-drain.json new file mode 100644 index 00000000..676b3764 --- /dev/null +++ b/dashboards/vampire-drain.json @@ -0,0 +1,363 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "iteration": 1560370443688, + "links": [], + "panels": [ + { + "columns": [], + "fontSize": "100%", + "gridPos": { + "h": 21, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "links": [], + "options": {}, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Startdatum", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "link": true, + "linkTooltip": "", + "linkUrl": "d/zm7wN6Zgz/verbrauch?orgId=1&from=${__cell_0}&to=${__cell_1}", + "mappingType": 1, + "pattern": "start_date", + "thresholds": [], + "type": "date", + "unit": "short" + }, + { + "alias": "Enddatum", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "end_date", + "thresholds": [], + "type": "date", + "unit": "short" + }, + { + "alias": "TR Start", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "start_range", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "TR Ende", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "end_range", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "TR-Verlust", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "range_diff", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "Zeitspanne", + "colorMode": "value", + "colors": [ + "rgb(133, 142, 133)", + "#56A64B", + "#C4162A" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "duration", + "thresholds": [ + "43200" + ], + "type": "number", + "unit": "s" + }, + { + "alias": "TR-Verlust / h", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "range_lost_per_hour", + "thresholds": [], + "type": "number", + "unit": "lengthkm" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": ".*_ts", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "Standby", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "standby", + "thresholds": [], + "type": "number", + "unit": "percentunit" + }, + { + "alias": "Verbrauch", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "consumption", + "thresholds": [], + "type": "number", + "unit": "kwatth" + }, + { + "alias": "Ø-Leistung", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "avg_power", + "thresholds": [], + "type": "number", + "unit": "watt" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "alias": "", + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n\textract(epoch FROM v.start_date) * 1000 AS start_date_ts,\n\textract(epoch FROM v.end_date) * 1000 AS end_date_ts,\n\tv.start_date,\n\tv.end_date,\n\tv.duration,\n\ts.sleep / v.duration as standby,\n\tv.start_range - v.end_range AS range_diff,\n\t(v.start_range - v.end_range) * c.efficiency AS consumption,\t\n\t((v.start_range - v.end_range) * c.efficiency) / (v.duration / 3600) * 1000 as avg_power,\n\t(v.start_range - v.end_range) / (v.duration / 3600) AS range_lost_per_hour,\n\tv.start_range,\n\tv.end_range\nFROM (\n\tSELECT\n\t\tlag(t.end_date)\n\t\tOVER (ORDER BY t.id ASC) AS start_date,\n\t\tt.start_date AS end_date,\n\t\tlag(t.end_range_km)\n\t\tOVER (ORDER BY t.id ASC) AS start_range,\n\t\tt.start_range_km AS end_range,\n\t\tlag(t.end_km) OVER (ORDER BY t.id ASC) AS start_km,\n\t\tt.start_km AS end_km,\n\t\tEXTRACT(EPOCH FROM age(t.start_date, lag(t.end_date) OVER (ORDER BY t.id ASC))) AS duration\n\tFROM\n\t\ttrips t\n\tWHERE\n\t\tcar_id = 1\n\tORDER BY\n\t\tid DESC) v,\n\t\tLATERAL (\n\t\t SELECT \n\t\t EXTRACT(EPOCH FROM sum(age(end_date, start_date))) as sleep\n\t\t FROM \n states s\n\t\t WHERE \n state = 'asleep' \n\t\t AND v.start_date <= s.start_date \n\t\t AND s.end_date <= v.end_date\n\t\t) s,\n\t\tLATERAL (select efficiency from cars where id = 1) c\nWHERE\n\tv.duration > ($duration * 60 * 60)\n\tAND v.start_range - v.end_range >= 0\n\tAND v.end_km - v.start_km < 1;\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Vampir Drain", + "transform": "table", + "type": "table" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "tags": [], + "text": "6", + "value": "6" + }, + "hide": 0, + "includeAll": false, + "label": "min. Standzeit (h)", + "multi": false, + "name": "duration", + "options": [ + { + "selected": false, + "text": "0", + "value": "0" + }, + { + "selected": false, + "text": "1", + "value": "1" + }, + { + "selected": false, + "text": "3", + "value": "3" + }, + { + "selected": true, + "text": "6", + "value": "6" + }, + { + "selected": false, + "text": "12", + "value": "12" + }, + { + "selected": false, + "text": "18", + "value": "18" + }, + { + "selected": false, + "text": "24", + "value": "24" + } + ], + "query": "0,1,3,6,12,18,24", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-3M", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Vampire Drain", + "uid": "zhHx2Fggk" +} \ No newline at end of file diff --git a/dashboards/verbrauch.json b/dashboards/verbrauch.json new file mode 100644 index 00000000..fd492ed1 --- /dev/null +++ b/dashboards/verbrauch.json @@ -0,0 +1,337 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "limit": 100, + "name": "Annotations & Alerts", + "showIn": 0, + "type": "dashboard" + }, + { + "datasource": "TeslaMate", + "enable": true, + "hide": false, + "iconColor": "rgba(255, 96, 96, 1)", + "limit": 100, + "name": "Laden", + "rawQuery": "SELECT\n\t$__time(start_date),\n\tconcat('Laden: ',charge_energy_added,\n\t\t' kWh') AS text\nFROM\n\tcharging_processes\nWHERE\n\t$__timeFilter(start_date) AND duration_min > 5\nORDER BY\n\tstart_date DESC", + "showIn": 0, + "tags": [], + "type": "tags" + }, + { + "datasource": "TeslaMate", + "enable": true, + "hide": false, + "iconColor": "#508642", + "limit": 100, + "name": "Laden fertig", + "rawQuery": "SELECT\n\t$__time(end_date),\n\tconcat('Laden: ',charge_energy_added,\n\t\t' kWh') AS text\nFROM\n\tcharging_processes\nWHERE\n\t$__timeFilter(start_date) AND duration_min > 5\nORDER BY\n\tstart_date DESC", + "showIn": 0, + "tags": [], + "type": "tags" + }, + { + "datasource": "TeslaMate", + "enable": true, + "hide": false, + "iconColor": "#64b0c8", + "limit": 100, + "name": "Schlafen", + "rawQuery": "SELECT $__time(start_date),\nstate as text \nFROM states\nWHERE $__timeFilter(start_date) and state = 'asleep'\norder by start_date desc\n", + "showIn": 0, + "tags": [], + "type": "tags" + }, + { + "datasource": "TeslaMate", + "enable": true, + "hide": false, + "iconColor": "#ba43a9", + "limit": 100, + "name": "Online", + "rawQuery": "SELECT $__time(start_date),\nstate as text \nFROM states\nWHERE $__timeFilter(start_date) and state = 'online'\norder by start_date desc\n", + "showIn": 0, + "tags": [], + "type": "tags" + }, + { + "datasource": "TeslaMate", + "enable": true, + "hide": false, + "iconColor": "rgb(158, 154, 154)", + "limit": 100, + "name": "Offline", + "rawQuery": "SELECT $__time(start_date),\nstate as text \nFROM states\nWHERE $__timeFilter(start_date) and state = 'offline'\norder by start_date desc\n", + "showIn": 0, + "tags": [], + "type": "tags" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "TeslaMate", + "fill": 1, + "gridPos": { + "h": 19, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "alignAsTable": false, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Reichweite [km]", + "fill": 0, + "yaxis": 2 + }, + { + "alias": "Höhe [m]", + "yaxis": 2 + }, + { + "alias": "SOC [%]" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "", + "format": "time_series", + "group": [], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n\t$__time(date),\n\tspeed AS \"Geschwindigkeit [km/h]\",\n\tpower AS \"Leistung [kW]\",\n\tideal_battery_range_km AS \"Reichweite [km]\",\n\tbattery_level AS \"SOC [%]\",\n\toutside_temp AS \"Außentemperatur [°C]\",\n\tinside_temp AS \"Innentemperatur [°C]\",\n\tdriver_temp_setting,\n\tpassenger_temp_setting,\n\tis_climate_on::integer,\n\tfan_status\nFROM\n\tpositions\nWHERE\n $__timeFilter(date)\nORDER BY\n\tdate ASC", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "charging", + "timeColumn": "Datum", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Verbrauch", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 1, + "format": "locale", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "autoZoom": true, + "gridPos": { + "h": 19, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 4, + "lineColor": "red", + "links": [], + "maxDataPoints": 50000, + "pointColor": "royalblue", + "targets": [ + { + "alias": "", + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "none" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\r\n $__time(date),\r\n latitude,\r\n longitude\r\n FROM positions\r\nWHERE $__timeFilter(date)\r\n\r\nORDER BY date ASC", + "refId": "A", + "select": [ + [ + { + "params": [ + "lat" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "lat" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "lng" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "lat" + ], + "type": "alias" + } + ] + ], + "table": "pos", + "timeColumn": "Datum", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Map", + "type": "pr0ps-trackmap-panel" + } + ], + "refresh": false, + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-12h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Verbrauch", + "uid": "zm7wN6Zgz" +} \ No newline at end of file diff --git a/dashboards/visited.json b/dashboards/visited.json new file mode 100644 index 00000000..4dfce22b --- /dev/null +++ b/dashboards/visited.json @@ -0,0 +1,106 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "autoZoom": true, + "gridPos": { + "h": 21, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "lineColor": "red", + "links": [], + "maxDataPoints": 10000000, + "pointColor": "royalblue", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n\tto_timestamp(floor((extract('epoch' FROM date) / 30)) * 30) AT TIME ZONE 'UTC' AS time,\n\tavg(latitude) AS lat,\n\tavg(longitude) AS lng\nFROM\n\tpositions\nWHERE\n\t$__timeFilter(date)\nGROUP BY\n\t1\nORDER BY\n\t1 ASC", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "charging", + "timeColumn": "Datum", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "MAP", + "type": "pr0ps-trackmap-panel" + } + ], + "refresh": false, + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6M", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Visited", + "uid": "RG_DxSmgk" +} \ No newline at end of file diff --git a/dashboards/zustande.json b/dashboards/zustande.json new file mode 100644 index 00000000..fcff47d3 --- /dev/null +++ b/dashboards/zustande.json @@ -0,0 +1,501 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "dateTimeAsIso", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "time", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select $__time(start_date), state from states order by start_date desc limit 1;", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Letzte Zustandsänderung", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 6, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "state", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select $__time(start_date), state from states order by start_date desc limit 1;", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Aktueller Zustand", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "format": "percentunit", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 8, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "?column?", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select 1 - sum(duration_min) / (EXTRACT(EPOCH FROM (max(end_date) - min(start_date))) / 60), 1 as time from trips", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Standzeit (%)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "backgroundColor": "rgba(128,128,128,0.1)", + "colorMaps": [ + { + "color": "#CCC", + "text": "N/A" + } + ], + "crosshairColor": "#8F070C", + "display": "timeline", + "expandFromQueryS": 0, + "extendLastValue": true, + "gridPos": { + "h": 4, + "w": 24, + "x": 0, + "y": 3 + }, + "highlightOnMouseover": true, + "id": 4, + "legendSortBy": "-ms", + "lineColor": "rgba(0,0,0,0.1)", + "links": [], + "metricNameColor": "#000000", + "options": {}, + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "rowHeight": 50, + "showLegend": true, + "showLegendCounts": false, + "showLegendNames": true, + "showLegendPercent": true, + "showLegendTime": true, + "showLegendValues": true, + "showTimeAxis": true, + "showTransitionCount": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select\n$__time(start_date),\ncase \n when state = 'offline' then 0\n when state = 'asleep' then 1\n when state = 'online' then 2\nend as \"Zustand\"\nfrom states\nwhere $__timeFilter(start_date);", + "refId": "A", + "select": [ + [ + { + "params": [ + "latitude" + ], + "type": "column" + } + ] + ], + "table": "addresses", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "textSize": 24, + "textSizeTime": 12, + "timeFrom": null, + "timeOptions": [ + { + "name": "Years", + "value": "years" + }, + { + "name": "Months", + "value": "months" + }, + { + "name": "Weeks", + "value": "weeks" + }, + { + "name": "Days", + "value": "days" + }, + { + "name": "Hours", + "value": "hours" + }, + { + "name": "Minutes", + "value": "minutes" + }, + { + "name": "Seconds", + "value": "seconds" + }, + { + "name": "Milliseconds", + "value": "milliseconds" + } + ], + "timePrecision": { + "name": "Minutes", + "value": "minutes" + }, + "timeShift": null, + "timeTextColor": "#d8d9da", + "title": "Zustandsverlauf", + "type": "natel-discrete-panel", + "units": "short", + "useTimePrecision": false, + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueTextColor": "#000000", + "writeAllValues": false, + "writeLastValue": true, + "writeMetricNames": false + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-2d", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Zustände", + "uid": "xo4BNRkZz" +} \ No newline at end of file