Skip to content

Commit

Permalink
Trip monthly statistics with yearly statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmaster187 committed Oct 2, 2024
1 parent e15834d commit c8c9bee
Showing 1 changed file with 290 additions and 11 deletions.
301 changes: 290 additions & 11 deletions TeslaLogger/Grafana/Trip Monatsstatistik.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
Expand All @@ -12,7 +15,7 @@
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
"type": "dashboard"
},
"type": "dashboard"
}
Expand All @@ -21,7 +24,6 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"iteration": 1664891370966,
"links": [
{
"icon": "external link",
Expand All @@ -47,7 +49,10 @@
},
"custom": {
"align": "auto",
"displayMode": "auto"
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [],
"thresholds": {
Expand Down Expand Up @@ -221,18 +226,68 @@
"id": "custom.align"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Jahr/Monat"
},
"properties": [
{
"id": "custom.width",
"value": 125
}
]
},
{
"matcher": {
"id": "byName",
"options": "Ø Verbrauch [kWh]"
},
"properties": [
{
"id": "custom.width",
"value": 163
}
]
},
{
"matcher": {
"id": "byName",
"options": "Verbrauch [kWh]"
},
"properties": [
{
"id": "custom.width",
"value": 166
}
]
},
{
"matcher": {
"id": "byName",
"options": "Ø °C"
},
"properties": [
{
"id": "custom.width",
"value": 117
}
]
}
]
},
"gridPos": {
"h": 15,
"w": 14,
"w": 10,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": [
"sum_duration_h",
"sum_consumption_kwh",
Expand All @@ -249,12 +304,16 @@
{
"desc": true,
"displayName": "Jahr/Monat"
}
}
]
},
"pluginVersion": "8.3.2",
"pluginVersion": "10.0.1",
"targets": [
{
"datasource": {
"type": "mysql",
"uid": "000000001"
},
"format": "table",
"group": [],
"metricColumn": "none",
Expand Down Expand Up @@ -293,17 +352,237 @@
}
],
"type": "table"
},
{
"datasource": {
"type": "mysql",
"uid": "000000001"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"decimals": 1,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "date"
},
"properties": [
{
"id": "custom.width",
"value": 100
},
{
"id": "displayName",
"value": "Jahr"
},
{
"id": "custom.align",
"value": "left"
},
{
"id": "decimals",
"value": 0
},
{
"id": "custom.minWidth",
"value": 100
}
]
},
{
"matcher": {
"id": "byName",
"options": "sum_duration_h"
},
"properties": [
{
"id": "custom.width",
"value": 174
},
{
"id": "displayName",
"value": "Fahrzeit [h]"
}
]
},
{
"matcher": {
"id": "byName",
"options": "sum_km"
},
"properties": [
{
"id": "custom.width",
"value": 158
},
{
"id": "displayName",
"value": "Strecke [km]"
}
]
},
{
"matcher": {
"id": "byName",
"options": "sum_consumption_kwh"
},
"properties": [
{
"id": "custom.width",
"value": 168
},
{
"id": "displayName",
"value": "Verbrauch [kWh]"
}
]
},
{
"matcher": {
"id": "byName",
"options": "avg_consumption_kwh"
},
"properties": [
{
"id": "custom.width",
"value": 170
},
{
"id": "displayName",
"value": "Ø Verbrauch [kWh]"
}
]
},
{
"matcher": {
"id": "byName",
"options": "avg_outside_temp"
},
"properties": [
{
"id": "custom.width",
"value": 105
},
{
"id": "displayName",
"value": "Ø °C"
}
]
},
{
"matcher": {
"id": "byName",
"options": "cnt"
},
"properties": [
{
"id": "displayName",
"value": "Anzahl Trips"
},
{
"id": "decimals",
"value": 0
}
]
}
]
},
"gridPos": {
"h": 11,
"w": 10,
"x": 0,
"y": 15
},
"id": 3,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": [
"sum_duration_h",
"sum_km",
"sum_consumption_kwh",
"cnt"
],
"reducer": [
"sum"
],
"show": true
},
"showHeader": true,
"sortBy": []
},
"pluginVersion": "10.0.1",
"targets": [
{
"datasource": {
"type": "mysql",
"uid": "000000001"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT year(StartDate) as date, \r\nsum(DurationMinutes)/60 as sum_duration_h, \r\nsum(km_diff) as sum_km,\r\nsum(consumption_kWh) as sum_consumption_kwh, \r\nsum(consumption_kWh) / sum(km_diff) * 100 as avg_consumption_kwh,\r\navg(outside_temp_avg) as avg_outside_temp,\r\ncount(*) as cnt\r\nfrom trip WHERE \r\n km_diff < 1000 and CarID = $Car \r\n group by year(StartDate)\r\n\r\norder by date desc\r\n",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Trip Jahresstatistik",
"type": "table"
}
],
"schemaVersion": 33,
"refresh": false,
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Two weeks",
"selected": true,
"text": "Teslarossa",
"value": "1"
},
"datasource": {
Expand Down Expand Up @@ -350,6 +629,6 @@
"timezone": "",
"title": "Trip Monatsstatistik",
"uid": "YmpLrqZRz",
"version": 6,
"version": 29,
"weekStart": ""
}

0 comments on commit c8c9bee

Please sign in to comment.