{
    "annotations": {
        "list": [
            {
                "builtIn": 1,
                "datasource": "-- Grafana --",
                "enable": true,
                "hide": true,
                "iconColor": "rgba(0, 211, 255, 1)",
                "name": "Annotations & Alerts",
                "type": "dashboard"
            }
        ]
    },
    "editable": true,
    "gnetId": null,
    "graphTooltip": 0,
    "iteration": 1644505954964,
    "links": [
        {
            "icon": "dashboard",
            "tags": [],
            "title": "TeslaMate",
            "tooltip": "",
            "type": "link",
            "url": "[[base_url:raw]]"
        },
        {
            "asDropdown": true,
            "icon": "external link",
            "tags": ["tesla"],
            "title": "Dashboards",
            "type": "dashboards"
        }
    ],
    "panels": [
        {
            "collapsed": false,
            "datasource": "TeslaMate",
            "gridPos": {
                "h": 1,
                "w": 24,
                "x": 0,
                "y": 0
            },
            "id": 12,
            "panels": [],
            "repeat": "car_id",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "title": "$car_id",
            "type": "row"
        },
        {
            "cacheTimeout": null,
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "custom": {},
                    "mappings": [],
                    "nullValueMode": "connected",
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "semi-dark-blue",
                                "value": null
                            }
                        ]
                    },
                    "unit": "none"
                },
                "overrides": []
            },
            "gridPos": {
                "h": 4,
                "w": 8,
                "x": 0,
                "y": 1
            },
            "id": 20,
            "interval": null,
            "links": [],
            "maxDataPoints": 100,
            "options": {
                "colorMode": "value",
                "fieldOptions": {
                    "calcs": ["sum"]
                },
                "graphMode": "area",
                "justifyMode": "auto",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["sum"],
                    "fields": "",
                    "values": false
                },
                "textMode": "value"
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "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"
                        }
                    ]
                }
            ],
            "timeFrom": null,
            "timeShift": null,
            "title": "Number of drives",
            "type": "stat"
        },
        {
            "cacheTimeout": null,
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "custom": {},
                    "mappings": [],
                    "nullValueMode": "connected",
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "green",
                                "value": null
                            }
                        ]
                    },
                    "unit": "none"
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "distance_km"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "km"
                            }
                        ]
                    },
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "distance_mi"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "mi"
                            }
                        ]
                    }
                ]
            },
            "gridPos": {
                "h": 4,
                "w": 8,
                "x": 8,
                "y": 1
            },
            "id": 16,
            "interval": null,
            "links": [],
            "maxDataPoints": 100,
            "options": {
                "colorMode": "value",
                "fieldOptions": {
                    "calcs": ["sum"]
                },
                "graphMode": "area",
                "justifyMode": "auto",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["sum"],
                    "fields": "",
                    "values": false
                },
                "textMode": "value"
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "targets": [
                {
                    "format": "time_series",
                    "group": [],
                    "metricColumn": "none",
                    "rawQuery": true,
                    "rawSql": "WITH since as (\n\tSELECT date FROM positions\n\tWHERE car_id = $car_id\n\tORDER BY date ASC\n\tLIMIT 1\n),\nactual AS (\n\tSELECT\n\t\tdate_trunc('day', date)::date AS date,\n\t\tmax(odometer) - min(odometer) AS distance\n\tFROM positions\n\tWHERE car_id = $car_id\n\tGROUP BY 1\n),\nbase_line AS (\n\tSELECT date_trunc('day', dd)::date AS date\n  FROM generate_series((select date from since) , now(), '1 day'::interval) dd\n)\nSELECT \n  $__time(base_line.date), \n  convert_km(COALESCE(distance, 0)::numeric, '$length_unit') as \"distance_$length_unit\"\nFROM base_line\nLEFT JOIN actual ON actual.date = base_line.date\nWHERE $__timeFilter(base_line.date)\nORDER BY 1;",
                    "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": "$length_unit driven",
            "type": "stat"
        },
        {
            "cacheTimeout": null,
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "custom": {},
                    "mappings": [],
                    "nullValueMode": "connected",
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "semi-dark-yellow",
                                "value": null
                            }
                        ]
                    },
                    "unit": "kwatth"
                },
                "overrides": []
            },
            "gridPos": {
                "h": 4,
                "w": 8,
                "x": 16,
                "y": 1
            },
            "id": 22,
            "interval": null,
            "links": [],
            "maxDataPoints": 100,
            "options": {
                "colorMode": "value",
                "fieldOptions": {
                    "calcs": ["sum"]
                },
                "graphMode": "area",
                "justifyMode": "auto",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["sum"],
                    "fields": "",
                    "values": false
                },
                "textMode": "value"
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "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"
                        }
                    ]
                }
            ],
            "timeFrom": null,
            "timeShift": null,
            "title": "kWh used",
            "type": "stat"
        },
        {
            "cacheTimeout": null,
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "custom": {},
                    "mappings": [
                        {
                            "id": 0,
                            "op": "=",
                            "text": "N/A",
                            "type": 1,
                            "value": "null"
                        }
                    ],
                    "nullValueMode": "connected",
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "#c7d0d9",
                                "value": null
                            }
                        ]
                    },
                    "unit": "none"
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "distance_km"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "lengthkm"
                            }
                        ]
                    },
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "distance_mi"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "mi"
                            }
                        ]
                    }
                ]
            },
            "gridPos": {
                "h": 3,
                "w": 8,
                "x": 0,
                "y": 5
            },
            "id": 26,
            "interval": null,
            "links": [],
            "maxDataPoints": 100,
            "options": {
                "colorMode": "value",
                "fieldOptions": {
                    "calcs": ["mean"]
                },
                "graphMode": "none",
                "justifyMode": "auto",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["mean"],
                    "fields": "",
                    "values": false
                },
                "textMode": "value"
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "targets": [
                {
                    "format": "table",
                    "group": [],
                    "metricColumn": "none",
                    "rawQuery": true,
                    "rawSql": "SELECT convert_km((percentile_disc(0.5) WITHIN GROUP (ORDER BY distance))::numeric, '$length_unit') as \"distance_$length_unit\"\nFROM drives\nWHERE car_id = $car_id AND $__timeFilter(start_date);",
                    "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": "Average distance of a drive",
            "type": "stat"
        },
        {
            "cacheTimeout": null,
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "custom": {},
                    "mappings": [],
                    "nullValueMode": "connected",
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "#c7d0d9",
                                "value": null
                            }
                        ]
                    },
                    "unit": "none"
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "distance_km"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "lengthkm"
                            }
                        ]
                    },
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "distance_mi"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "mi"
                            }
                        ]
                    }
                ]
            },
            "gridPos": {
                "h": 3,
                "w": 8,
                "x": 8,
                "y": 5
            },
            "id": 8,
            "interval": null,
            "links": [],
            "maxDataPoints": 100,
            "options": {
                "colorMode": "value",
                "fieldOptions": {
                    "calcs": ["mean"]
                },
                "graphMode": "none",
                "justifyMode": "auto",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["mean"],
                    "fields": "",
                    "values": false
                },
                "textMode": "value"
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "targets": [
                {
                    "format": "table",
                    "group": [],
                    "metricColumn": "none",
                    "rawQuery": true,
                    "rawSql": "WITH since as (\n\tSELECT date FROM positions\n\tWHERE car_id = $car_id\n\tORDER BY date ASC\n\tLIMIT 1\n),\nactual AS (\n\tSELECT\n\t\tdate_trunc('day', start_date)::date AS date,\n\t\tsum(distance) AS distance\n\tFROM drives\n\tWHERE car_id = $car_id\n\tGROUP BY 1\n),\nbase_line AS (\n\tSELECT date_trunc('day', dd)::date AS date\n  FROM generate_series((select date from since), NOW(), '1 day'::interval) dd\n),\ncombined as (\n  SELECT base_line.date, COALESCE(actual.distance, 0) as distance\n  FROM base_line\n  LEFT JOIN actual ON actual.date = base_line.date\n  WHERE $__timeFilter(base_line.date)\n)\nSELECT convert_km((percentile_disc(0.5) WITHIN GROUP (ORDER BY distance))::numeric, '$length_unit') AS \"distance_$length_unit\"\nFROM combined;",
                    "refId": "A",
                    "select": [
                        [
                            {
                                "params": ["efficiency"],
                                "type": "column"
                            }
                        ]
                    ],
                    "table": "cars",
                    "timeColumn": "inserted_at",
                    "timeColumnType": "timestamp",
                    "where": [
                        {
                            "name": "$__timeFilter",
                            "params": [],
                            "type": "macro"
                        }
                    ]
                }
            ],
            "timeFrom": null,
            "timeShift": null,
            "title": "Average distance driven per day",
            "type": "stat"
        },
        {
            "cacheTimeout": null,
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "custom": {},
                    "mappings": [],
                    "nullValueMode": "connected",
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "#c7d0d9",
                                "value": null
                            }
                        ]
                    },
                    "unit": "kwatth"
                },
                "overrides": []
            },
            "gridPos": {
                "h": 3,
                "w": 8,
                "x": 16,
                "y": 5
            },
            "id": 14,
            "interval": null,
            "links": [],
            "maxDataPoints": 100,
            "options": {
                "colorMode": "value",
                "fieldOptions": {
                    "calcs": ["lastNotNull"]
                },
                "graphMode": "none",
                "justifyMode": "auto",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["mean"],
                    "fields": "",
                    "values": false
                },
                "textMode": "value"
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "targets": [
                {
                    "format": "table",
                    "group": [],
                    "metricColumn": "none",
                    "rawQuery": true,
                    "rawSql": "WITH since as (\n\tSELECT date FROM positions\n\tWHERE car_id = $car_id\n\tORDER BY date ASC\n\tLIMIT 1\n),\nactual AS (\n\tSELECT\n\t\tdate_trunc('day', start_date)::date AS date,\n\t\tsum(NULLIF(GREATEST(start_[[preferred_range]]_range_km - end_[[preferred_range]]_range_km, 0), 0) * car.efficiency) AS energy\n\tFROM drives\n\tJOIN cars car ON car.id = car_id\n\tWHERE car_id = $car_id\n\tGROUP BY 1\n),\nbase_line AS (\n\tSELECT date_trunc('day', dd)::date AS date\n  FROM generate_series((select date from since), NOW(), '1 day'::interval) dd\n),\ncombined as (\n  SELECT base_line.date, COALESCE(actual.energy, 0) as energy\n  FROM base_line\n  LEFT JOIN actual ON actual.date = base_line.date\n  WHERE $__timeFilter(base_line.date)\n)\nSELECT percentile_disc(0.5) WITHIN GROUP (ORDER BY energy) AS energy\nFROM combined;",
                    "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": "Average kWh used per day",
            "type": "stat"
        },
        {
            "cacheTimeout": null,
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "custom": {},
                    "mappings": [],
                    "nullValueMode": "connected",
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "#c7d0d9",
                                "value": null
                            }
                        ]
                    },
                    "unit": "none"
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "mileage_km"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "km"
                            }
                        ]
                    },
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "mileage_mi"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "mi"
                            }
                        ]
                    }
                ]
            },
            "gridPos": {
                "h": 3,
                "w": 12,
                "x": 0,
                "y": 8
            },
            "id": 32,
            "interval": null,
            "links": [],
            "maxDataPoints": 100,
            "options": {
                "colorMode": "value",
                "fieldOptions": {
                    "calcs": ["lastNotNull"]
                },
                "graphMode": "none",
                "justifyMode": "auto",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["mean"],
                    "fields": "",
                    "values": false
                },
                "textMode": "value"
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "targets": [
                {
                    "format": "table",
                    "group": [],
                    "metricColumn": "none",
                    "rawQuery": true,
                    "rawSql": "WITH first_position AS (\n\tSELECT date, odometer\n\tFROM positions\n\tWHERE car_id = $car_id AND $__timeFilter(date)\n\tORDER BY date ASC\n\tLIMIT 1\n),\nlast_position AS (\n\tSELECT date, odometer\n\tFROM positions\n\tWHERE car_id = $car_id AND $__timeFilter(date)\n\tORDER BY date DESC\n\tLIMIT 1\n)\nSELECT\n\tconvert_km((((SELECT odometer FROM last_position) - (SELECT odometer\tFROM first_position)) /\n\tEXTRACT(days FROM (SELECT date FROM last_position) - (SELECT date\tFROM first_position)) * \n\t(365/12))::numeric, '$length_unit') AS \"mileage_$length_unit\";",
                    "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": "Extrapolated monthly mileage",
            "type": "stat"
        },
        {
            "cacheTimeout": null,
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "custom": {},
                    "mappings": [],
                    "nullValueMode": "connected",
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "#c7d0d9",
                                "value": null
                            }
                        ]
                    },
                    "unit": "none"
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "mileage_km"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "km"
                            }
                        ]
                    },
                    {
                        "matcher": {
                            "id": "byName",
                            "options": "mileage_mi"
                        },
                        "properties": [
                            {
                                "id": "unit",
                                "value": "mi"
                            }
                        ]
                    }
                ]
            },
            "gridPos": {
                "h": 3,
                "w": 12,
                "x": 12,
                "y": 8
            },
            "id": 30,
            "interval": null,
            "links": [],
            "maxDataPoints": 100,
            "options": {
                "colorMode": "value",
                "fieldOptions": {
                    "calcs": ["lastNotNull"]
                },
                "graphMode": "none",
                "justifyMode": "auto",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["mean"],
                    "fields": "",
                    "values": false
                },
                "textMode": "value"
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "targets": [
                {
                    "format": "table",
                    "group": [],
                    "metricColumn": "none",
                    "rawQuery": true,
                    "rawSql": "WITH first_position AS (\n\tSELECT date, odometer\n\tFROM positions\n\tWHERE car_id = $car_id AND $__timeFilter(date)\n\tORDER BY date ASC\n\tLIMIT 1\n),\nlast_position AS (\n\tSELECT date, odometer\n\tFROM positions\n\tWHERE car_id = $car_id AND $__timeFilter(date)\n\tORDER BY date DESC\n\tLIMIT 1\n)\nSELECT\n\tconvert_km(((lp.odometer - fp.odometer) /\n\tEXTRACT(days FROM lp.date - fp.date) * \n\t365)::numeric, '$length_unit') AS \"mileage_$length_unit\" from first_position as fp, last_position as lp;",
                    "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": "Extrapolated annual mileage",
            "type": "stat"
        },
        {
            "datasource": "TeslaMate",
            "fieldConfig": {
                "defaults": {
                    "color": {
                        "mode": "thresholds"
                    },
                    "custom": {},
                    "displayName": "$__cell_0",
                    "mappings": [],
                    "max": 100,
                    "min": 0,
                    "thresholds": {
                        "mode": "absolute",
                        "steps": [
                            {
                                "color": "semi-dark-blue",
                                "value": null
                            },
                            {
                                "color": "light-red",
                                "value": 50
                            }
                        ]
                    },
                    "unit": "none"
                },
                "overrides": []
            },
            "gridPos": {
                "h": 11,
                "w": 24,
                "x": 0,
                "y": 11
            },
            "id": 24,
            "options": {
                "displayMode": "gradient",
                "orientation": "horizontal",
                "reduceOptions": {
                    "calcs": ["mean"],
                    "fields": "",
                    "values": true
                },
                "showUnfilled": true
            },
            "pluginVersion": "7.1.4",
            "scopedVars": {
                "car_id": {
                    "selected": true,
                    "text": "1",
                    "value": "1"
                }
            },
            "targets": [
                {
                    "format": "table",
                    "group": [],
                    "metricColumn": "none",
                    "rawQuery": true,
                    "rawSql": "SELECT\n\tCOALESCE(g.name, array_to_string(((string_to_array(a.display_name, ', ', ''))[0:3]), ', ')) as name,\n\tcount(*) AS visited\nFROM drives t\nINNER JOIN addresses a ON end_address_id = a.id\nLEFT JOIN geofences g ON end_geofence_id = g.id\nWHERE t.car_id = $car_id AND $__timeFilter(t.start_date)\nGROUP BY 1\nORDER BY visited DESC\nLIMIT 10;",
                    "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": "Top Destinations",
            "type": "bargauge"
        }
    ],
    "refresh": false,
    "schemaVersion": 26,
    "style": "dark",
    "tags": ["tesla"],
    "templating": {
        "list": [
            {
                "allValue": null,
                "current": {
                    "selected": false,
                    "text": "All",
                    "value": "$__all"
                },
                "datasource": "TeslaMate",
                "definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
                "hide": 2,
                "includeAll": true,
                "label": "Car",
                "multi": false,
                "name": "car_id",
                "options": [],
                "query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
                "refresh": 1,
                "regex": "",
                "skipUrlSync": false,
                "sort": 0,
                "tagValuesQuery": "",
                "tags": [],
                "tagsQuery": "",
                "type": "query",
                "useTags": false
            },
            {
                "allValue": null,
                "current": {
                    "selected": false,
                    "text": "km",
                    "value": "km"
                },
                "datasource": "TeslaMate",
                "definition": "select unit_of_length from settings limit 1;",
                "hide": 2,
                "includeAll": false,
                "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": {
                    "selected": false,
                    "text": "C",
                    "value": "C"
                },
                "datasource": "TeslaMate",
                "definition": "select unit_of_temperature from settings limit 1;",
                "hide": 2,
                "includeAll": false,
                "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": {
                    "selected": false,
                    "text": "ideal",
                    "value": "ideal"
                },
                "datasource": "TeslaMate",
                "definition": "select preferred_range from settings limit 1;",
                "hide": 2,
                "includeAll": false,
                "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": {
                    "selected": false,
                    "text": "http://localhost:4000",
                    "value": "http://localhost:4000"
                },
                "datasource": "TeslaMate",
                "definition": "select base_url from settings limit 1;",
                "hide": 2,
                "includeAll": false,
                "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
            }
        ]
    },
    "time": {
        "from": "now-1y",
        "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": "Drive Stats",
    "uid": "_7WkNSyWk",
    "version": 1
}
