diff --git a/TeslaLogger/Grafana/Ladestatistik.json b/TeslaLogger/Grafana/Ladestatistik.json index 9883c8711..169d6b381 100644 --- a/TeslaLogger/Grafana/Ladestatistik.json +++ b/TeslaLogger/Grafana/Ladestatistik.json @@ -671,9 +671,7 @@ "CO2 kg", "LadezeitStunden" ], - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": true }, "showHeader": true, @@ -695,14 +693,12 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "select address, count(*) as Anzahl, max(StartDate) as LetzteLadung, sum(cost_total) as Cost, \r\n(\r\n select sum(cost_total) / sum(chargingstate.charge_energy_added) as cost\r\n FROM chargingstate join pos as pos2 on chargingstate.pos = pos2.id join charging on chargingstate.EndChargingID = charging.id\r\n where pos2.address = T1.address and cost_total is not null and chargingstate.carid=$Car\r\n) as 'Ø Price / kWh', \r\n(\r\n select sum(chargingstate.charge_energy_added) / sum(cost_kwh_meter_invoice) * 100 as eff\r\n FROM chargingstate join pos as pos3 on chargingstate.pos = pos3.id join charging on chargingstate.EndChargingID = charging.id and chargingstate.carid=$Car\r\n where pos3.address = T1.address and cost_kwh_meter_invoice is not null\r\n) as 'Eff', \r\nsum(charge_energy_added) as geladen_kWh, avg(charge_energy_added) as avg_geladen_kWh, sum(co2_g_kWh * charge_energy_added / 1000) as \"CO2 kg\" ,sum(charge_energy_added) / sum(MinuteDiff) * 60 as avg_kW, avg(End_battery_level) as AvgSOC, max(End_battery_level) as MaxSOC, sum(MinuteDiff) / 60 as LadezeitStunden, \r\navg(lat) as lat, avg(lng) as lng \r\nfrom \r\n(\r\nSELECT pos.lat, pos.lng,cost_total, chargingstate.StartDate as StartDate, pos.address, \r\n chargingstate.charge_energy_added, co2_g_kWh,\r\n charging_End.ideal_battery_range_km AS EndSOC,\r\n charging_End.battery_level as End_battery_level,\r\n TIMESTAMPDIFF(MINUTE, chargingstate.StartDate, chargingstate.EndDate) as MinuteDiff\r\nFROM charging inner JOIN chargingstate ON charging.id = chargingstate.StartChargingID INNER JOIN\r\n pos ON chargingstate.pos = pos.id \r\n LEFT OUTER JOIN\r\n charging AS charging_End ON chargingstate.EndChargingID = charging_End.id\r\nwhere $__timeFilter(chargingstate.StartDate) and TIMESTAMPDIFF(MINUTE, chargingstate.StartDate, chargingstate.EndDate) > 3 and chargingstate.EndChargingID - chargingstate.StartChargingID > 4 and chargingstate.carid=$Car\r\n) as T1\r\ngroup by address\r\norder by Anzahl desc", + "rawSql": "select address, count(*) as Anzahl, max(StartDate) as LetzteLadung, sum(cost_total) as Cost, \r\n(\r\n select sum(cost_total) / sum(chargingstate.charge_energy_added) as cost\r\n FROM chargingstate join pos as pos2 on chargingstate.pos = pos2.id join charging on chargingstate.EndChargingID = charging.id\r\n where $__timeFilter(chargingstate.StartDate) and pos2.address = T1.address and cost_total is not null and chargingstate.carid=$Car\r\n) as 'Ø Price / kWh', \r\n(\r\n select sum(chargingstate.charge_energy_added) / sum(cost_kwh_meter_invoice) * 100 as eff\r\n FROM chargingstate join pos as pos3 on chargingstate.pos = pos3.id join charging on chargingstate.EndChargingID = charging.id and chargingstate.carid=$Car\r\n where $__timeFilter(chargingstate.StartDate) and pos3.address = T1.address and cost_kwh_meter_invoice is not null\r\n) as 'Eff', \r\nsum(charge_energy_added) as geladen_kWh, avg(charge_energy_added) as avg_geladen_kWh, sum(co2_g_kWh * charge_energy_added / 1000) as \"CO2 kg\" ,sum(charge_energy_added) / sum(MinuteDiff) * 60 as avg_kW, avg(End_battery_level) as AvgSOC, max(End_battery_level) as MaxSOC, sum(MinuteDiff) / 60 as LadezeitStunden, \r\navg(lat) as lat, avg(lng) as lng \r\nfrom \r\n(\r\nSELECT pos.lat, pos.lng,cost_total, chargingstate.StartDate as StartDate, pos.address, \r\n chargingstate.charge_energy_added, co2_g_kWh,\r\n charging_End.ideal_battery_range_km AS EndSOC,\r\n charging_End.battery_level as End_battery_level,\r\n TIMESTAMPDIFF(MINUTE, chargingstate.StartDate, chargingstate.EndDate) as MinuteDiff\r\nFROM charging inner JOIN chargingstate ON charging.id = chargingstate.StartChargingID INNER JOIN\r\n pos ON chargingstate.pos = pos.id \r\n LEFT OUTER JOIN\r\n charging AS charging_End ON chargingstate.EndChargingID = charging_End.id\r\nwhere $__timeFilter(chargingstate.StartDate) and TIMESTAMPDIFF(MINUTE, chargingstate.StartDate, chargingstate.EndDate) > 3 and chargingstate.EndChargingID - chargingstate.StartChargingID > 4 and chargingstate.carid=$Car\r\n) as T1\r\ngroup by address\r\norder by Anzahl desc", "refId": "A", "select": [ [ { - "params": [ - "CarId" - ], + "params": ["CarId"], "type": "column" } ] @@ -895,9 +891,7 @@ "footer": { "countRows": false, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true, @@ -915,9 +909,7 @@ "select": [ [ { - "params": [ - "value" - ], + "params": ["value"], "type": "column" } ] @@ -1084,9 +1076,7 @@ "footer": { "countRows": false, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true, @@ -1104,9 +1094,7 @@ "select": [ [ { - "params": [ - "value" - ], + "params": ["value"], "type": "column" } ] @@ -1186,9 +1174,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -1206,9 +1192,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -1282,9 +1266,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -1302,9 +1284,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -1378,9 +1358,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "lastNotNull" - ], + "calcs": ["lastNotNull"], "fields": "", "values": false }, @@ -1398,9 +1376,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -1474,9 +1450,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -1494,9 +1468,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -1570,9 +1542,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -1590,9 +1560,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -1667,9 +1635,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -1687,9 +1653,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -1781,9 +1745,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -1903,9 +1865,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -1923,9 +1883,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -1999,9 +1957,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -2019,9 +1975,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -2095,9 +2049,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -2115,9 +2067,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -2211,9 +2161,7 @@ "footer": { "countRows": false, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": false, @@ -2236,9 +2184,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -2330,9 +2276,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "/^val$/", "values": false }, @@ -2350,9 +2294,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -2427,9 +2369,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "/^val$/", "values": false }, @@ -2447,9 +2387,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -2523,9 +2461,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -2544,9 +2480,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -2620,9 +2554,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -2640,9 +2572,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -2716,9 +2646,7 @@ "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { - "calcs": [ - "sum" - ], + "calcs": ["sum"], "fields": "", "values": false }, @@ -2736,9 +2664,7 @@ "select": [ [ { - "params": [ - "id" - ], + "params": ["id"], "type": "column" } ] @@ -2811,21 +2737,11 @@ "2h", "1d" ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Ladestatistik", "uid": "Y4Ptihzgk", "version": 37, "weekStart": "" -} \ No newline at end of file +}