diff --git a/dashboard.json b/dashboard.json new file mode 100644 index 0000000..9ce434b --- /dev/null +++ b/dashboard.json @@ -0,0 +1,283 @@ +{ + "__inputs": [ + { + "name": "DS_MYSQL_- OWNTRACKS", + "label": "MySQL - owntracks", + "description": "", + "type": "datasource", + "pluginId": "mysql", + "pluginName": "MySQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "geomap", + "name": "Geomap", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.2.2" + }, + { + "type": "datasource", + "id": "mysql", + "name": "MySQL", + "version": "1.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": null, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "mysql", + "uid": "${DS_MYSQL_- OWNTRACKS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "orange", + "value": 30 + }, + { + "color": "yellow", + "value": 50 + }, + { + "color": "green", + "value": 70 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 20, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "basemap": { + "config": {}, + "name": "Layer 0", + "type": "default" + }, + "controls": { + "mouseWheelZoom": true, + "showAttribution": true, + "showDebug": false, + "showMeasure": false, + "showScale": false, + "showZoom": true + }, + "layers": [ + { + "config": { + "arrow": 1, + "style": { + "color": { + "field": "batt", + "fixed": "dark-green" + }, + "lineWidth": 2, + "opacity": 1, + "rotation": { + "fixed": 0, + "max": 360, + "min": -360, + "mode": "mod" + }, + "size": { + "fixed": 5, + "max": 15, + "min": 2 + }, + "symbol": { + "fixed": "img/icons/marker/circle.svg", + "mode": "fixed" + }, + "symbolAlign": { + "horizontal": "center", + "vertical": "center" + }, + "text": { + "fixed": "", + "mode": "field" + }, + "textConfig": { + "fontSize": 12000, + "offsetX": 0, + "offsetY": 0, + "textAlign": "left", + "textBaseline": "top" + } + } + }, + "filterData": { + "id": "byRefId", + "options": "A" + }, + "name": "Akku", + "opacity": 1, + "tooltip": true, + "type": "route" + } + ], + "tooltip": { + "mode": "details" + }, + "view": { + "allLayers": true, + "id": "fit", + "lat": 52.2013, + "lon": 10.114725, + "zoom": 15 + } + }, + "pluginVersion": "10.2.2", + "targets": [ + { + "dataset": "owntracks", + "datasource": { + "type": "mysql", + "uid": "${DS_MYSQL_- OWNTRACKS}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n dt AS \"time\",\n lat,\n lon,\n batt\nFROM owntracks.locations\nWHERE\n $__timeFilter(dt) AND\n user = $user AND\n device = $device\nORDER BY dt", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "lat", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "recordings" + } + ], + "title": "Geräte", + "type": "geomap" + } + ], + "refresh": "5s", + "schemaVersion": 38, + "tags": [], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_MYSQL_- OWNTRACKS}" + }, + "definition": "SELECT\n device\nFROM\n owntracks.locations", + "hide": 0, + "includeAll": false, + "label": "Gerät", + "multi": true, + "name": "device", + "options": [], + "query": "SELECT\n device\nFROM\n owntracks.locations", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_MYSQL_- OWNTRACKS}" + }, + "definition": "SELECT\n user\nFROM\n owntracks.locations", + "description": "", + "hide": 0, + "includeAll": false, + "label": "Benutzer", + "multi": true, + "name": "user", + "options": [], + "query": "SELECT\n user\nFROM\n owntracks.locations", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Owntracks", + "uid": "dbb80681-ef8e-4ce9-a47c-3c1fb432f4e9", + "version": 16, + "weekStart": "" +} \ No newline at end of file