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.
Talking of pros, does anyone know how I can make a panel within Grafana to display the max power/ top speed output from all drives?

From the driving panel, I can see speed but it seems an average rather than top but within each journey, it does contain top.
 
Talking of pros, does anyone know how I can make a panel within Grafana to display the max power/ top speed output from all drives?

From the driving panel, I can see speed but it seems an average rather than top but within each journey, it does contain top.
What output do you want? Just one figure for your highest speed or highest speed per drive in a table of drives?

Edit: Ditto power
 
What output do you want? Just one figure for your highest speed or highest speed per drive in a table of drives?

Edit: Ditto power
TBH I don't mind, whichever is the easiest to implement. If I had to choose I'd say ideally the highest speed per drive.

The speed within each drive is already present in the drives table, but it's an average instead of the top, which then I have to click into each individual drive.
 
I'm no expert by any stretch, but I used to get multiple errors like that too. IIRC it came after I updated Teslamate and most of them were from values being changed and my own 'dashboard' I created still using the old ones. I customized my grafana where I populated different panels from sections within TM so everything I find important to check is all on the one screen. I just copied the panels again which resolved my issue.

I hope that helps, if not try giving it an update;
docker-compose pull
docker-compose up -d

If that doesn't help then sorry, I'll see myself out and leave it to one of the pros here :)

Thanks! I have no idea what it was - great thing of docker is just delete containers and start over .. worked on my dev server.. then just ported to my NAS !
 
Not too sure on how to share these, but try this.
For Max speed across drives:
{
"description": "",
"fieldConfig": {
"defaults": {
"custom": {
"align": null,
"filterable": false
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"mappings": []
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Time"
},
"properties": [
{
"id": "custom.width",
"value": 190
}
]
}
]
},
"gridPos": {
"h": 7,
"w": 9,
"x": 0,
"y": 0
},
"id": 28,
"options": {
"reduceOptions": {
"values": false,
"calcs": [
"mean"
],
"fields": ""
},
"orientation": "auto",
"textMode": "auto",
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto"
},
"pluginVersion": "7.3.7",
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n\tconvert_km(max(speed), '$length_unit') AS \"Speed [$length_unit/h]\"\n\nFROM\n\tpositions\nWHERE\n car_id = $car_id\n \n",
"refId": "A",
"select": [
[
{
"params": [
"odometer"
],
"type": "column"
}
]
],
"table": "positions",
"timeColumn": "date",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Max Speed",
"type": "stat",
"datasource": null
}
 
  • Helpful
Reactions: s88ats
For Power:

{
"fieldConfig": {
"defaults": {
"custom": {},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"mappings": []
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 9,
"x": 9,
"y": 0
},
"id": 30,
"options": {
"reduceOptions": {
"values": false,
"calcs": [
"mean"
],
"fields": ""
},
"orientation": "auto",
"textMode": "auto",
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto"
},
"pluginVersion": "7.3.7",
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n\tmax(power) AS \"Power [kW]\"\n\nFROM\n\tpositions\nWHERE\n car_id = $car_id\n \n",
"refId": "A",
"select": [
[
{
"params": [
"odometer"
],
"type": "column"
}
]
],
"table": "positions",
"timeColumn": "date",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Max Power",
"type": "stat",
"datasource": null
}
 
  • Helpful
Reactions: s88ats
Let me see if I can get a table of max speed per drive
Both worked flawlessly thank you so much!

Would it be difficult to link or show the drive when that highest value was done? I don't know if that's complicating things or if it would be easier to amend the average speed that's currently being shown in the default, showing the max instead?
 
New Drives Dashboard with max Speed column:

JavaScript:
{
  "__inputs": [
    {
      "name": "DS_TESLAMATE",
      "label": "TeslaMate",
      "description": "",
      "type": "datasource",
      "pluginId": "postgres",
      "pluginName": "PostgreSQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.3.7"
    },
    {
      "type": "datasource",
      "id": "postgres",
      "name": "PostgreSQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table-old",
      "name": "Table (old)",
      "version": ""
    }
  ],
  "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,
  "id": null,
  "iteration": 1615115413202,
  "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": [
    {
      "datasource": "${DS_TESLAMATE}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 4,
      "panels": [],
      "repeat": "car_id",
      "title": "$car_id",
      "type": "row"
    },
    {
      "columns": [],
      "datasource": "${DS_TESLAMATE}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fontSize": "100%",
      "gridPos": {
        "h": 24,
        "w": 24,
        "x": 0,
        "y": 1
      },
      "id": 2,
      "links": [],
      "pageSize": 100,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 16,
        "desc": false
      },
      "styles": [
        {
          "alias": "Date",
          "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,
          "link": true,
          "linkTargetBlank": false,
          "linkTooltip": "View drive details",
          "linkUrl": "d/zm7wN6Zgz?from=${__cell_0}&to=${__cell_1}&var-car_id=${__cell_2}&var-drive_id=${__cell_6}",
          "mappingType": 1,
          "pattern": "start_date_km",
          "thresholds": [],
          "type": "date",
          "unit": "short"
        },
        {
          "alias": "Consumption",
          "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": "consumption_kwh_km",
          "thresholds": [],
          "type": "number",
          "unit": "Wh/km"
        },
        {
          "alias": "Consumption",
          "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": "consumption_kwh_mi",
          "thresholds": [],
          "type": "number",
          "unit": "Wh/mi"
        },
        {
          "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": 1,
          "mappingType": 1,
          "pattern": "distance_km",
          "thresholds": [],
          "type": "number",
          "unit": "lengthkm"
        },
        {
          "alias": "kWh",
          "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": 1,
          "mappingType": 1,
          "pattern": "consumption_kWh",
          "thresholds": [],
          "type": "number",
          "unit": "kwatth"
        },
        {
          "alias": "Start",
          "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,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "Create or edit geo-fence",
          "linkUrl": "[[base_url:raw]]/geo-fences/${__cell_3:raw}",
          "mappingType": 1,
          "pattern": "start_address",
          "preserveFormat": false,
          "sanitize": false,
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "Destination",
          "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,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "Create or edit geo-fence",
          "linkUrl": "[[base_url:raw]]/geo-fences/${__cell_4:raw}",
          "mappingType": 1,
          "pattern": "end_address",
          "thresholds": [],
          "type": "string",
          "unit": "short",
          "valueMaps": []
        },
        {
          "alias": "Temp",
          "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_c",
          "thresholds": [],
          "type": "number",
          "unit": "celsius"
        },
        {
          "alias": "Duration",
          "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,
          "link": true,
          "linkTooltip": "$__cell_5",
          "linkUrl": "#",
          "mappingType": 1,
          "pattern": "duration_min",
          "thresholds": [],
          "type": "number",
          "unit": "m"
        },
        {
          "alias": "Efficiency",
          "align": "auto",
          "colorMode": "value",
          "colors": [
            "#FFA6B0",
            "#FFCB7D",
            "#C8F2C2"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "mappingType": 1,
          "pattern": "efficiency",
          "thresholds": [
            "0.65",
            "0.99"
          ],
          "type": "number",
          "unit": "percentunit"
        },
        {
          "alias": "",
          "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": "/.*_ts/",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "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": "speed_avg_km",
          "thresholds": [],
          "type": "number",
          "unit": "velocitykmh"
        },
        {
          "alias": "",
          "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": "id",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "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": 1,
          "mappingType": 1,
          "pattern": "distance_mi",
          "thresholds": [],
          "type": "number",
          "unit": "lengthmi"
        },
        {
          "alias": "Temp",
          "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": "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": "speed_avg_mi",
          "thresholds": [],
          "type": "number",
          "unit": "velocitymph"
        },
        {
          "alias": "",
          "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": "/(start|end)_path/",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "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": "duration_str",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "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": "car_id",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "Date",
          "align": "auto",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "MM/DD/YY h:mm:ss a",
          "decimals": 2,
          "link": true,
          "linkTargetBlank": false,
          "linkTooltip": "View drive details",
          "linkUrl": "d/zm7wN6Zgz?from=${__cell_0}&to=${__cell_1}&var-car_id=${__cell_2}&var-drive_id=${__cell_6}",
          "mappingType": 1,
          "pattern": "start_date_mi",
          "thresholds": [],
          "type": "date",
          "unit": "short"
        },
        {
          "alias": "",
          "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": "% Start",
          "thresholds": [],
          "type": "number",
          "unit": "percent"
        },
        {
          "alias": "",
          "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": "% End",
          "thresholds": [],
          "type": "number",
          "unit": "percent"
        },
        {
          "alias": "❄",
          "align": "auto",
          "colorMode": "value",
          "colors": [
            "#3274D9",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "has_reduced_range",
          "thresholds": [],
          "type": "string",
          "unit": "short",
          "valueMaps": [
            {
              "text": "❄",
              "value": "1"
            },
            {
              "text": "",
              "value": "0"
            }
          ]
        },
        {
          "alias": "",
          "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": "drive_id",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "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": "",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "max Power",
          "align": "auto",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 0,
          "pattern": "power_max",
          "thresholds": [],
          "type": "number",
          "unit": "kwatt"
        },
        {
          "alias": "max 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": 2,
          "mappingType": 1,
          "pattern": "maxspeed",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "alias": "",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "WITH fastest AS (\n\n  SELECT\n    drive_id AS \"my_drive\",\n\t  convert_km(max(speed), '$length_unit') AS maxspeed\n\t  \n\t  \n\t FROM\n\t  positions\n\t\n\t\n  WHERE\n    positions.car_id = $car_id\n    \n\n   group by drive_id \n   \n)\n, data AS (\n  SELECT\n    round(extract(epoch FROM start_date)) * 1000 AS start_date_ts,\n    round(extract(epoch FROM end_date)) * 1000 AS end_date_ts,\n    car.id as car_id,\n    CASE WHEN start_geofence.id IS NULL THEN CONCAT('new?lat=', start_position.latitude, '&lng=', start_position.longitude)\n         WHEN start_geofence.id IS NOT NULL THEN CONCAT(start_geofence.id, '/edit')\n    END as start_path,\n    CASE WHEN end_geofence.id IS NULL THEN CONCAT('new?lat=', end_position.latitude, '&lng=', end_position.longitude)\n         WHEN end_geofence.id IS NOT NULL THEN CONCAT(end_geofence.id, '/edit')\n    END as end_path,\n    TO_CHAR((duration_min * INTERVAL '1 minute'), 'HH24:MI') as duration_str,\n    drives.id as drive_id,\n    -- Columns\n    start_date,\n    COALESCE(start_geofence.name, CONCAT_WS(', ', COALESCE(start_address.name, nullif(CONCAT_WS(' ', start_address.road, start_address.house_number), '')), start_address.city)) AS start_address,\n    COALESCE(end_geofence.name, CONCAT_WS(', ', COALESCE(end_address.name, nullif(CONCAT_WS(' ', end_address.road, end_address.house_number), '')), end_address.city)) AS end_address,\n    duration_min,\n    maxspeed,\n    distance,\n    start_position.usable_battery_level as start_usable_battery_level,\n    start_position.battery_level as start_battery_level,\n    end_position.usable_battery_level as end_usable_battery_level,\n    end_position.battery_level as end_battery_level,\n   case when (start_position.battery_level != start_position.usable_battery_level OR end_position.battery_level != end_position.usable_battery_level) = true then true else false end  as reduced_range,\n    duration_min > 1 AND distance > 1 AND ( \n      start_position.usable_battery_level IS NULL OR end_position.usable_battery_level IS NULL\tOR\n      (end_position.battery_level - end_position.usable_battery_level) = 0 \n    ) as is_sufficiently_precise,\n    NULLIF(GREATEST(start_[[preferred_range]]_range_km - end_[[preferred_range]]_range_km, 0), 0) as range_diff,\n    car.efficiency as car_efficiency,\n    outside_temp_avg,\n    distance / NULLIF(duration_min, 0) * 60 AS avg_speed,\n    power_max\n  FROM drives\n  LEFT JOIN addresses start_address ON start_address_id = start_address.id\n  LEFT JOIN addresses end_address ON end_address_id = end_address.id\n  LEFT JOIN positions start_position ON start_position_id = start_position.id\n  LEFT JOIN positions end_position ON end_position_id = end_position.id\n  LEFT JOIN geofences start_geofence ON start_geofence_id = start_geofence.id\n  LEFT JOIN geofences end_geofence ON end_geofence_id = end_geofence.id\n  LEFT JOIN cars car ON car.id = drives.car_id\n  LEFT JOIN fastest  ON fastest.my_drive = drives.id\n  WHERE $__timeFilter(start_date) AND drives.car_id = $car_id AND convert_km(distance::numeric, '$length_unit') >= $min_dist AND convert_km(distance::numeric, '$length_unit') / NULLIF(duration_min, 0) * 60 >= $min_speed\n  ORDER BY start_date DESC\n)\nSELECT\n    start_date_ts,\n    end_date_ts,\n    car_id,\n    start_path,\n    end_path,\n    duration_str,\n    drive_id,\n    -- Columns\n    start_date as start_date_[[length_unit]],\n    start_address,\n    end_address,\n    duration_min,\n    convert_km(distance::numeric, '$length_unit') AS distance_$length_unit,\n    start_battery_level as \"% Start\",\n    end_battery_level as \"% End\",\n    convert_celsius(outside_temp_avg, '$temp_unit') AS outside_temp_$temp_unit,\n    convert_km(avg_speed::numeric, '$length_unit') AS speed_avg_$length_unit,\n    maxspeed,\n    power_max,\n    reduced_range as has_reduced_range,\n    range_diff * car_efficiency as \"consumption_kWh\",\n    CASE WHEN is_sufficiently_precise THEN range_diff * car_efficiency / distance * 1000 * CASE WHEN '$length_unit' = 'km' THEN 1\n                                                                                                WHEN '$length_unit' = 'mi' THEN 1.60934\n                                                                                           END\n    END AS consumption_kWh_$length_unit,\n    CASE WHEN is_sufficiently_precise THEN distance / range_diff\n         ELSE NULL\n    END AS efficiency\nFROM data;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Drive",
      "transform": "table",
      "type": "table-old"
    }
  ],
  "schemaVersion": 26,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "SELECT name AS __text, id AS __value FROM cars;",
        "error": null,
        "hide": 2,
        "includeAll": true,
        "label": "Car",
        "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": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "select unit_of_temperature from settings limit 1;",
        "error": null,
        "hide": 2,
        "includeAll": false,
        "label": "temperature unit",
        "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 unit_of_length from settings limit 1;",
        "error": null,
        "hide": 2,
        "includeAll": false,
        "label": "length unit",
        "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 preferred_range from settings limit 1;",
        "error": null,
        "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": {},
        "datasource": "${DS_TESLAMATE}",
        "definition": "select base_url from settings limit 1;",
        "error": null,
        "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
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "0",
          "value": "0"
        },
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Enter min distance here",
        "name": "min_dist",
        "options": [],
        "query": "0",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "0",
          "value": "0"
        },
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Enter min speed here",
        "name": "min_speed",
        "options": [],
        "query": "0",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-1y",
    "to": "now"
  },
  "timepicker": {
    "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": "Drives Copy",
  "uid": "9RJrOVUMk",
  "version": 8
}
 
Last edited by a moderator:
I am suddenly being promoted for username/password on my teslamate page. When I enter it I get
Error: :mfa_input_not_found

Password/user seems to be correct because when I use a different combination I get an error that the user/password doesn’t match.

I’ve pulled the latest changes and restarted teslamate but that didn’t change anything.

Anyone else is having this problem?
 
I am suddenly being promoted for username/password on my teslamate page. When I enter it I get
Error: :mfa_input_not_found

Password/user seems to be correct because when I use a different combination I get an error that the user/password doesn’t match.

I’ve pulled the latest changes and restarted teslamate but that didn’t change anything.

Anyone else is having this problem?
Have been some reports of intermittent issues with people accessing their Tesla accounts - could be the Auth servers are having a bad day. Perhaps give it a while and see if it clears up?
 
Have been some reports of intermittent issues with people accessing their Tesla accounts - could be the Auth servers are having a bad day. Perhaps give it a while and see if it clears up?
I had this for a few days now. Couldn’t post it here earlier because the forum was down over the weekend. I can still get to the grafana boards but there haven’t been any updates to my ‘states’ for about 5 days. Apparently the car is sleeping even when I am driving ...
 
I had this for a few days now. Couldn’t post it here earlier because the forum was down over the weekend. I can still get to the grafana boards but there haven’t been any updates to my ‘states’ for about 5 days. Apparently the car is sleeping even when I am driving ...
Sounds like TeslaMate's token has expired, that would explain the lack of data collection. The error you have there sounds suspiciously like Multi-Factor Authentication, can you try enabling it (if it's disabled) and see whether that fixes your issue?
 
Any idea where I would enable that? Is that on the actual Tesla Account?
Sorry yes, you login to your Tesla Account and go to Multi Factor Authentication on the Account Settings page.

Instructions here: Multi-Factor Authentication

You'll need to use an authenticator app (e.g. Google Authenticator, Authy etc) on your phone to scan the QR code, that will then set it up to generate a unique code every 60 seconds. You'll need to enter this when prompted, after your enter your user/password at login.