Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaMate [megathread]

This site may earn commission on affiliate links.
I'm keen to set this up either using remote hosting or on Pi. I looked at using my NAS but I don't leave it running 24/7.

There is an alternative, Tesla Logger, which is very comprehensive and also the inspiration for TeslaMate I believe. Those guys are German and provide a plug-and-play Pi system. It's currently on Pi 3 so I've asked if they can update to the latest hardware. For £140 it's a good, quick option for those of us where server admin and coding is a bit of a distant memory.

That said, setting up a remote VM also sounds quite attractive as long as it's secure and also comes with clear instructions for old timers like me to follow. To give an idea, it's probably 15 years ago that I went anywhere near a command line!

Is the remote VM worth a crack for someone like me and importantly, is it secure enough? Or do I spend £140 on a pre-configured system - cost isn't too bad.

Cheers
Dave
 
Depends on your comfort level really. Since you have to set it to yourself it’s as secure as you make it. The guides walk you through setting up HTTP simple authentication, which isn’t particularly secure.

Beyond that it’s a question of whether you think Google being in control of your VM is secure. Everyone has different thoughts about cloud security.
 
Depends on your comfort level really. Since you have to set it to yourself it’s as secure as you make it. The guides walk you through setting up HTTP simple authentication, which isn’t particularly secure.

Beyond that it’s a question of whether you think Google being in control of your VM is secure. Everyone has different thoughts about cloud security.
Whilst a remote VM is free (in this case), I think I favour a local system on balance. I'll get that running first and then possibly VPN in should I feel the need later. It's a few quid but nothing too bad. Cheers
 
  • Like
Reactions: Durzel
Think I've got it all looking how I want now! I'm more interested in total stats rather than current state so created a new overview dashboard, and figured out how to calc fuel savings with the Grafana/SQL syntax.

5fVaP8J.png
 
Think I've got it all looking how I want now! I'm more interested in total stats rather than current state so created a new overview dashboard, and figured out how to calc fuel savings with the Grafana/SQL syntax.
Hey if you think this is worthy to share, you can always create a 'request' and include the json for this dashboard in it.
 
Does anyone know if a table of comparison existing between all these loggers?
Personal preference, as I wait for my Pi4B to arrive, Im more interested in TeslaLogger as per thread here
I feel that TeslaMate is more mature in it's codebase, docker and GitHub integration. TeslaLogger is more complicated to set up, with a number of config files, while TeslaMate pretty much runs out of the box and doesn't keep your passwords just in plain text in a config file.

What kills TeslaLogger for me also is that it uses port 80 which is a bummer because my Raspberry Pi already runs my own webserver on port 80. TeslaMate runs on a separate port, and you can easily use Apache or any other web server as a reverse proxy to link TeslaMate to a specific virtualhost and use SSL.

Oh and TeslaMate uses the streaming API which gives more detailed data points.
 
This looks really good. Did you find any guides to customising the views or did you just figure it out yourself?

Yeah just figured it out really. Only thing doesn't exist in another dashboard is the diesel cost and cost saving, plus the images/text which are as simple as it gets.

JSON if anyone wants to copy and amend as needed:

Code:
{
  "__inputs": [
    {
      "name": "DS_TESLAMATE",
      "label": "TeslaMate",
      "description": "",
      "type": "datasource",
      "pluginId": "postgres",
      "pluginName": "PostgreSQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.7.3"
    },
    {
      "type": "datasource",
      "id": "postgres",
      "name": "PostgreSQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "pr0ps-trackmap-panel",
      "name": "TrackMap",
      "version": "2.0.4"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "History of your car",
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1588524019901,
  "links": [
    {
      "icon": "external link",
      "tags": [],
      "targetBlank": true,
      "title": "Tesla",
      "type": "link",
      "url": "https://www.tesla.com/en_GB/teslaaccount"
    },
    {
      "icon": "external link",
      "tags": [],
      "targetBlank": true,
      "title": "TMC UK",
      "type": "link",
      "url": "https://teslamotorsclub.com/tmc/forums/the-uk-and-ireland.114/"
    },
    {
      "icon": "dashboard",
      "tags": [],
      "title": "TeslaMate",
      "tooltip": "",
      "type": "link",
      "url": "[[base_url:raw]]"
    },
    {
      "asDropdown": true,
      "icon": "external link",
      "tags": [
        "tesla"
      ],
      "title": "Dashboards",
      "type": "dashboards"
    }
  ],
  "panels": [
    {
      "content": "<div style=\"width:100%;height:100%;background-image:url(https://i.imgur.com/JLB1T7N.jpg);background-repeat:no-repeat;background-position:center;background-size:cover;\"></div>",
      "datasource": "${DS_TESLAMATE}",
      "gridPos": {
        "h": 7,
        "w": 2,
        "x": 0,
        "y": 0
      },
      "id": 53,
      "mode": "html",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "text"
    },
    {
      "content": "![Image of Aladdin](https://i.imgur.com/fHYhG5c.jpg)",
      "datasource": "${DS_TESLAMATE}",
      "gridPos": {
        "h": 7,
        "w": 4,
        "x": 2,
        "y": 0
      },
      "id": 48,
      "mode": "markdown",
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": false,
          "rawSql": "SELECT\n  start_date AS \"time\",\n  start_km\nFROM drives\nWHERE\n  $__timeFilter(start_date)\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "start_km"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "drives",
          "timeColumn": "start_date",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "text"
    },
    {
      "autoZoom": true,
      "datasource": "${DS_TESLAMATE}",
      "gridPos": {
        "h": 10,
        "w": 6,
        "x": 6,
        "y": 0
      },
      "id": 46,
      "lineColor": "#C4162A",
      "links": [],
      "maxDataPoints": 10000000,
      "pointColor": "#3274D9",
      "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  car_id = $car_id AND\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": "",
      "type": "pr0ps-trackmap-panel"
    },
    {
      "content": "<table style=\"border:0;width:100%;\"><tr><td style=\"border:0;padding:2px\"><strong>Tesla Model 3 SR+</strong></td><td style=\"border:0;padding:2px\"><strong>VIN:</strong> 5YJ3F7EA6LF594704<br></td>\n<tr><td style=\"border:0;padding:2px\">Pearl White, All Black </td><td style=\"border:0;padding:2px\"><strong>Referral:</strong> <a href=\"https://ts.la/russell33099\">https://ts.la/russell33099</a></tr></table>",
      "datasource": "${DS_TESLAMATE}",
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 0,
        "y": 7
      },
      "id": 51,
      "mode": "html",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "text"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_TESLAMATE}",
      "decimals": 0,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 0,
        "y": 10
      },
      "id": 6,
      "interval": null,
      "links": [
        {
          "targetBlank": true,
          "title": "Mileage",
          "url": "/d/NjtMTFggz/mileage?orgId=1"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": " $length_unit",
      "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": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select $__time(date), convert_km(odometer, '$length_unit') 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": "Odometer",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "first"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_TESLAMATE}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 2,
        "y": 10
      },
      "id": 38,
      "interval": null,
      "links": [
        {
          "title": "Drive Stats",
          "url": "/d/_7WkNSyWk/drive-stats?orgId=1"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "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,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  date_trunc('day', start_date) as \"time\",\n  count(*)\nFROM drives\nWHERE $__timeFilter(start_date) AND car_id = $car_id\nGROUP BY 1\nORDER BY 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": "Number of Drives",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_TESLAMATE}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 4,
        "y": 10
      },
      "id": 55,
      "interval": null,
      "links": [
        {
          "targetBlank": true,
          "title": "Updates",
          "url": "/d/IiC07mgWz/updates?orgId=1"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "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,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select split_part(version, ' ', 1) as version from updates where car_id = $car order by start_date desc limit 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "efficiency"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "cars",
          "timeColumn": "inserted_at",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Firmware",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [],
      "valueName": "first"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "#56A64B",
        "#FF780A",
        "#E02F44"
      ],
      "datasource": "${DS_TESLAMATE}",
      "decimals": 0,
      "format": "short",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 6,
        "y": 10
      },
      "id": 30,
      "interval": null,
      "links": [
        {
          "title": "/d/fu4SiQgWz/efficiency?orgId=1",
          "url": "Efficiency"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": " Wh/$length_unit",
      "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": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tCASE WHEN '$length_unit' = 'km' THEN efficiency\n\t     WHEN '$length_unit' = 'mi' THEN efficiency * 1.60934\n\tEND * 1000 as efficiency\nFROM\n\tcars\nWHERE\n\tid = $car_id;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "charge_energy_added"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "charges",
          "timeColumn": "date",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "220,250,280",
      "timeFrom": null,
      "timeShift": null,
      "title": "Current Rated Efficiency",
      "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"
      ],
      "datasource": "${DS_TESLAMATE}",
      "format": "kwatth",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 9,
        "y": 10
      },
      "id": 40,
      "interval": null,
      "links": [
        {
          "title": "Drive Stats",
          "url": "/d/_7WkNSyWk/drive-stats?orgId=1"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": " +",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "80%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(242, 204, 12, 0.09)",
        "full": false,
        "lineColor": "#F2CC0C",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__time(start_date),\n  NULLIF(GREATEST(start_[[preferred_range]]_range_km - end_[[preferred_range]]_range_km, 0), 0) * car.efficiency AS energy\nFROM drives\nJOIN cars car ON car.id = car_id\nWHERE $__timeFilter(start_date) AND car_id = $car_id\nORDER BY 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": "kWh Used",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_TESLAMATE}",
      "decimals": 1,
      "format": "kwatth",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 6,
        "x": 0,
        "y": 14
      },
      "id": 26,
      "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": "   / 100$length_unit",
      "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": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select \n  sum((start_[[preferred_range]]_range_km - end_[[preferred_range]]_range_km) * cars.efficiency) / sum(distance) * 100 * \n    CASE WHEN '$length_unit' = 'km' THEN 1\n         WHEN '$length_unit' = 'mi' THEN 1.60934\n    END AS consumption\nfrom drives \ninner join cars on cars.id = car_id\nwhere \n  distance is not null and\n  start_[[preferred_range]]_range_km - end_[[preferred_range]]_range_km >= 0.1 and\n  car_id = $car",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "start_km"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "drives",
          "timeColumn": "start_date",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Consumption (net)",
      "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"
      ],
      "datasource": "${DS_TESLAMATE}",
      "decimals": 1,
      "format": "kwatth",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 6,
        "x": 6,
        "y": 14
      },
      "id": 28,
      "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": "   / 100$length_unit",
      "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": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "WITH d1 AS (\n\tSELECT\n\t\tc.car_id,\n\t\tlag(end_[[preferred_range]]_range_km) OVER (ORDER BY start_date) - start_[[preferred_range]]_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 AND\n\t  c.car_id = $car\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\nrange_loss * c.efficiency / distance * 100 *\n  CASE WHEN '$length_unit' = 'km' THEN 1\n       WHEN '$length_unit' = 'mi' THEN 1.60934\n  END AS consumption\nFROM\n\td2\n\tLEFT JOIN cars c ON c.id = car_id",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "start_km"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "drives",
          "timeColumn": "start_date",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Consumption (gross) ",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "columns": [],
      "datasource": "${DS_TESLAMATE}",
      "fontSize": "100%",
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 0,
        "y": 18
      },
      "id": 32,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "Temperature",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "pattern": "outside_temp_c",
          "type": "number",
          "unit": "celsius"
        },
        {
          "alias": "Efficiency",
          "align": "auto",
          "colorMode": "value",
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "#FFB357",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 1,
          "mappingType": 1,
          "pattern": "efficiency",
          "thresholds": [
            "0.65",
            "0.99"
          ],
          "type": "number",
          "unit": "percentunit"
        },
        {
          "alias": "km",
          "align": "auto",
          "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": "total_distance_km",
          "thresholds": [],
          "type": "number",
          "unit": "none"
        },
        {
          "alias": "Consumption/100km",
          "align": "auto",
          "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_km",
          "thresholds": [],
          "type": "number",
          "unit": "kwatth"
        },
        {
          "alias": "Speed",
          "align": "auto",
          "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_km",
          "thresholds": [],
          "type": "number",
          "unit": "velocitykmh"
        },
        {
          "alias": "Temperature",
          "align": "auto",
          "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": "outside_temp_f",
          "thresholds": [],
          "type": "number",
          "unit": "fahrenheit"
        },
        {
          "alias": "mi",
          "align": "auto",
          "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": "total_distance_mi",
          "thresholds": [],
          "type": "number",
          "unit": "none"
        },
        {
          "alias": "Consumption/100mi",
          "align": "auto",
          "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_mi",
          "thresholds": [],
          "type": "number",
          "unit": "kwatth"
        },
        {
          "alias": "Speed",
          "align": "auto",
          "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_mi",
          "thresholds": [],
          "type": "number",
          "unit": "velocitymph"
        }
      ],
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "WITH t AS (\n\tSELECT\n\t  CASE WHEN '$temp_unit' = 'C' THEN ROUND(cast(outside_temp_avg AS numeric) / 5, 0) * 5 \n\t\t\t   WHEN '$temp_unit' = 'F' THEN ROUND(cast(convert_celsius(outside_temp_avg, '$temp_unit') AS numeric) / 10, 0) * 10\n\t\tEND AS outside_temp,\n\t\tsum(start_ideal_range_km - end_ideal_range_km) AS total_ideal_range,\n\t\tsum(start_rated_range_km - end_rated_range_km) AS total_rated_range,\n\t\tsum(distance) AS total_distance,\n\t\tsum(duration_min) as duration,\n\t\tcar_id\n\tFROM\n\t\tdrives\n\tWHERE\n\t\tdistance IS NOT NULL\n\t\tAND car_id = $car_id\n\t\tAND distance >= convert_km($min_distance, '$length_unit')\n\t\tAND start_[[preferred_range]]_range_km - end_[[preferred_range]]_range_km > 0.1\n\tGROUP BY\n\t\t1,\n\t\tcar_id\n)\n\nSELECT\n\toutside_temp as outside_temp_$temp_unit,\n  total_distance / total_[[preferred_range]]_range AS efficiency,\n\ttotal_[[preferred_range]]_range / total_distance * c.efficiency * 100 * \n  CASE \n    WHEN '$length_unit' = 'km' THEN 1 \n    WHEN '$length_unit' = 'mi' THEN 1.60934 \n  END AS consumption_$length_unit,\n  convert_km(total_distance, '$length_unit') as total_distance_$length_unit,\n\t(total_distance / duration) * 60 / (CASE \n    WHEN '$length_unit' = 'km' THEN 1 \n    WHEN '$length_unit' = 'mi' THEN 1.60934 \n  END) avg_speed_$length_unit\nFROM\n\tt\nJOIN cars c ON t.car_id = c.id\nWHERE outside_temp IS NOT NULL\n",
          "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": "Temperature Efficiency",
      "transform": "table",
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_TESLAMATE}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 0,
        "y": 24
      },
      "id": 34,
      "interval": null,
      "links": [
        {
          "title": "Charging Stats",
          "url": "/d/-pkIkhmRz/charging-stats?orgId=1"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "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,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tcount(*)\nFROM\n\tcharging_processes\nWHERE\n\t$__timeFilter(end_date)\n\tAND charge_energy_added > 0.01\n\tAND car_id = $car_id;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "efficiency"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "cars",
          "timeColumn": "inserted_at",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Number of Charges",
      "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"
      ],
      "datasource": "${DS_TESLAMATE}",
      "format": "kwatth",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 3,
        "y": 24
      },
      "id": 36,
      "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": "",
      "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": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tsum(charge_energy_added)\nFROM\n\tcharging_processes\nWHERE\n\t$__timeFilter(end_date)\n\tAND car_id = $car_id;\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "efficiency"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "cars",
          "timeColumn": "inserted_at",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Charged",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorPostfix": false,
      "colorPrefix": false,
      "colorValue": false,
      "colors": [
        "#f3997b",
        "#f3997b",
        "rgb(232, 147, 61)"
      ],
      "datasource": "${DS_TESLAMATE}",
      "decimals": 2,
      "format": "currencyGBP",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 6,
        "y": 24
      },
      "id": 22,
      "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": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "80%",
      "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": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT sum(cost) FROM charging_processes WHERE $__timeFilter(end_date) AND car_id = $car;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "start_km"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "drives",
          "timeColumn": "start_date",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "0,0",
      "timeFrom": null,
      "timeShift": null,
      "title": "Total Charge Cost",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "#ed6965",
        "#ed6965",
        "#E02F44"
      ],
      "datasource": "${DS_TESLAMATE}",
      "decimals": 2,
      "format": "currencyGBP",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 8,
        "y": 24
      },
      "id": 24,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "pluginVersion": "6.7.3",
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "repeat": null,
      "repeatDirection": "h",
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select convert_km(odometer, '$length_unit') * 0.15 from positions where car_id = $car order by date desc limit 1;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "start_km"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "drives",
          "timeColumn": "start_date",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "0,0",
      "timeFrom": null,
      "timeShift": null,
      "title": "Diesel Equivalent",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "#8ec89a",
        "#8ec89a",
        "#56A64B"
      ],
      "datasource": "${DS_TESLAMATE}",
      "decimals": 2,
      "format": "currencyGBP",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 10,
        "y": 24
      },
      "id": 49,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "pluginVersion": "6.7.3",
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "repeatDirection": "h",
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select convert_km(odometer, '$length_unit') * 0.15 - (SELECT sum(cost) FROM charging_processes WHERE $__timeFilter(end_date) AND car_id = $car) from positions where car_id = $car order by date desc limit 1;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "start_km"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "drives",
          "timeColumn": "start_date",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "0,0",
      "timeFrom": null,
      "timeShift": null,
      "title": "Fuel Savings",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    }
  ],
  "refresh": false,
  "schemaVersion": 22,
  "style": "dark",
  "tags": [
    "tesla"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "select convert_km(odometer, '$length_unit') from positions where car_id = $car order by date desc limit 1;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "",
        "multi": false,
        "name": "miles",
        "options": [],
        "query": "select convert_km(odometer, '$length_unit') from positions where car_id = $car order by date desc limit 1;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 3,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "select convert_km(odometer, '$length_unit') * 0.15 from positions where car_id = $car order by date desc limit 1;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": null,
        "multi": false,
        "name": "dieselcost",
        "options": [],
        "query": "select convert_km(odometer, '$length_unit') * 0.15 from positions where car_id = $car order by date desc limit 1;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "SELECT name AS __text, id AS __value FROM cars;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Car",
        "multi": false,
        "name": "car",
        "options": [],
        "query": "SELECT name AS __text, id AS __value FROM cars;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "select unit_of_length from settings limit 1;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": null,
        "multi": false,
        "name": "length_unit",
        "options": [],
        "query": "select unit_of_length from settings limit 1;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "select unit_of_temperature from settings limit 1;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": null,
        "multi": false,
        "name": "temp_unit",
        "options": [],
        "query": "select unit_of_temperature from settings limit 1;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "select preferred_range from settings limit 1;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "",
        "multi": false,
        "name": "preferred_range",
        "options": [],
        "query": "select preferred_range from settings limit 1;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "select base_url from settings limit 1;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "",
        "multi": false,
        "name": "base_url",
        "options": [],
        "query": "select base_url from settings limit 1;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "SELECT sum(cost) FROM charging_processes WHERE car_id = $car;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": null,
        "multi": false,
        "name": "chargecost",
        "options": [],
        "query": "SELECT sum(cost) FROM charging_processes WHERE car_id = $car;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "SELECT name AS __text, id AS __value FROM cars;",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Car ID",
        "multi": false,
        "name": "car_id",
        "options": [],
        "query": "SELECT name AS __text, id AS __value FROM cars;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "1",
          "value": "1"
        },
        "hide": 2,
        "includeAll": false,
        "label": "min. distance per drive",
        "multi": false,
        "name": "min_distance",
        "options": [
          {
            "selected": true,
            "text": "1",
            "value": "1"
          },
          {
            "selected": false,
            "text": "5",
            "value": "5"
          },
          {
            "selected": false,
            "text": "10",
            "value": "10"
          },
          {
            "selected": false,
            "text": "25",
            "value": "25"
          },
          {
            "selected": false,
            "text": "50",
            "value": "50"
          }
        ],
        "query": "1, 5, 10, 25, 50",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-5y",
    "to": "now"
  },
  "timepicker": {
    "hidden": false,
    "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": "History",
  "uid": "kOuP_Fggz2",
  "variables": {
    "list": []
  },
  "version": 48
}
 
@Russinating Your full VIN is visible in those screenshots, not sure if you were aware of that or cared :)

That's a cool overview though.

VINs aren't really private, thousands posted publicly on the order tracker on this forum and you can view any Tesla's VIN in real life as it's displayed bottom right of the windscreen :).

Just need your cctv feed on your parking bay instead of car image and that's you done ;)

Quite! I'm sure getting a Nest feed into Grafana isn't that easy...
 
  • Like
Reactions: Roy W.
Built this on the Pi 0 W I've got on my desk, can not connect to it at all via the browser, just tells me the server can't be found.

Any thoughts on what to check next?
Well, you are using the right IP address and port? Are you using the docker-compose? If so, you should see a log in your shell.

Check the documentation on the Github site, and if necessary look in the issues for similar problems.
 
Well, you are using the right IP address and port? Are you using the docker-compose? If so, you should see a log in your shell.

Check the documentation on the Github site, and if necessary look in the issues for similar problems.

Yep, tried the IP and also tried using the raspberrypi.local address and got the same.

I’ll see if I can find the logs, couldn’t see any similar issues listed, I do wonder though if the Pi 0 is up to the job, think it’s supposed to be 3+ as a minimum