Russinating
M3 SR+
If anyone wants to add an overall MPG panel use the JSON code below:
You'll also need the $chargecost variable in your dashboard settings which is simply SELECT sum(cost) FROM charging_processes WHERE car_id = $car;
Only other "variable" is the 104.8 in the SQL formula which is fuel costs. Currently based on supermarket petrol from Compare latest petrol and diesel fuel prices | The AA
At the moment even at that cheapest fuel price my MPG is 7,070 lol .
Code:
{
"datasource": "TeslaMate",
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"decimals": 0,
"format": "none",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 3,
"w": 2,
"x": 8,
"y": 6
},
"id": 65,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "mpg",
"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,
"ymax": null,
"ymin": null
},
"tableColumn": "",
"targets": [
{
"format": "time_series",
"group": [],
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "select $__time(date), convert_km(odometer, '$length_unit') / ($chargecost/(104.8/100)*0.219969157) from positions where car_id = $car order by date desc limit 1;",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"thresholds": "",
"timeFrom": null,
"timeShift": null,
"title": "MPG",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [],
"valueName": "first"
}
You'll also need the $chargecost variable in your dashboard settings which is simply SELECT sum(cost) FROM charging_processes WHERE car_id = $car;
Only other "variable" is the 104.8 in the SQL formula which is fuel costs. Currently based on supermarket petrol from Compare latest petrol and diesel fuel prices | The AA
At the moment even at that cheapest fuel price my MPG is 7,070 lol .