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.
Thanks for the instructions, @DaveW - very easy to follow.

I've imported all the supercharger geofences, but do you know if there's a way of going back through historical charges and adding how much it cost? I don't have many so it shouldn't be too laborious to add the data manually with reference to my tesla account. Just would be nice to be able to have the cost data available to analyse. Cheers.

Glad it helped :)

Go to the charges dashboard, find any you want to change and click in Cost, you can then manually type in the price :)
 
I would like to set up TeslaMate as a docker running under unRAID. I have a bunch of dockers running on this server (like OpenVPN server, Unifi, Plex, SageTV, tec) but I have always installed them through the Apps plugin. Can anyone provide any guidance on how to do this in unRAID? I searched this thread and found no hits for unRAID.
 
I would like to set up TeslaMate as a docker running under unRAID. I have a bunch of dockers running on this server (like OpenVPN server, Unifi, Plex, SageTV, tec) but I have always installed them through the Apps plugin. Can anyone provide any guidance on how to do this in unRAID? I searched this thread and found no hits for unRAID.

Just build your docker-compose.yml and then execute 'docker-compose pull' - that should create the containers and then 'docker-compose -up -d'
 
I was able to manually install TeslaMate in a docker in unRAID by manually installing it in a number of steps. When I get a chance I will post a detailed description of what I did in case others wish to install TeslaMate in unRAID as well.

One thing that I don't have configured properly in TeslaMate is the Dashboards. What should I put in the Dashboards field in the TeslaMate settings? Currently I have put in http://192.168.1.99:3000/?viewPanel=3&orgId=1. In TeslaMate I get a Dashboards item that has a drop down for all of the various Dashboards, but no matter what I click on it just takes me to the list of all of the Dashboards as it takes me to the same URL, which is http://192.168.1.99:3000/?viewPanel=3&orgId=1. I am guessing that I have to do some additional config in either Grafan or in the TeslaMate Dashboards setting, but what am I missing?
 
Just build your docker-compose.yml and then execute 'docker-compose pull' - that should create the containers and then 'docker-compose -up -d'
I consider myself fairly geeky, but I have no idea how to do any of this in unRAID as dockers are pretty much always installed by searching for a docker in apps and clicking install. I found a thread on reddit that I followed for the most part,
 
  • Like
Reactions: goRt
I was able to manually install TeslaMate in a docker in unRAID by manually installing it in a number of steps. When I get a chance I will post a detailed description of what I did in case others wish to install TeslaMate in unRAID as well.

One thing that I don't have configured properly in TeslaMate is the Dashboards. What should I put in the Dashboards field in the TeslaMate settings? Currently I have put in http://192.168.1.99:3000/?viewPanel=3&orgId=1. In TeslaMate I get a Dashboards item that has a drop down for all of the various Dashboards, but no matter what I click on it just takes me to the list of all of the Dashboards as it takes me to the same URL, which is http://192.168.1.99:3000/?viewPanel=3&orgId=1. I am guessing that I have to do some additional config in either Grafan or in the TeslaMate Dashboards setting, but what am I missing?

I think it should just be set to http://192.168.1.99:3000
 
Ok that works - it takes me to the page that has a list of all of the dashboards.

The one dashboard that may not be working is the Vampire Drain dashboard. This one says "No Data to show". What should I see here, and does this take a while to generate data? I have only had TeslaMate up for about 12 hours.

Are there other dashboards that people have create other than what is in the github repository dashboards folder?

On my TeslaMate homepage I only see the map of my car's location and a few stats. Is this what I should see? I could swear that I have seen some screenshots that show mor stuff on this page, including links to the dashboards.

Does TeslaMate have the capability to trigger actions on your car, like start climate or charging. Or have more sophisticated charging routines, like end charging at a specific time?
 
Ok that works - it takes me to the page that has a list of all of the dashboards.

The one dashboard that may not be working is the Vampire Drain dashboard. This one says "No Data to show". What should I see here, and does this take a while to generate data? I have only had TeslaMate up for about 12 hours.

Are there other dashboards that people have create other than what is in the github repository dashboards folder?

On my TeslaMate homepage I only see the map of my car's location and a few stats. Is this what I should see? I could swear that I have seen some screenshots that show mor stuff on this page, including links to the dashboards.

Does TeslaMate have the capability to trigger actions on your car, like start climate or charging. Or have more sophisticated charging routines, like end charging at a specific time?

Vampire drain is built between drives, as you've only just started there will be no data.

Home page sounds correct, try the statistics page.
 
Great - how frequently does TeslaMate poll the API for data on your call. My car's internal temp was 4°C and I turned on the climate using the Tesla Remote app about 15 minutes ago and warmed the car up 22° according to that app. But on the Overview dashboard it still shows an internal temp of 4°C. So it looks like it hasn't pulled data for 15 minutes. I have tried refreshing the Overview page as well.
 
Great - how frequently does TeslaMate poll the API for data on your call. My car's internal temp was 4°C and I turned on the climate using the Tesla Remote app about 15 minutes ago and warmed the car up 22° according to that app. But on the Overview dashboard it still shows an internal temp of 4°C. So it looks like it hasn't pulled data for 15 minutes. I have tried refreshing the Overview page as well.
Recent builds of Teslamate use a streaming function of the Tesla API, it subscribes and receives data as it's published on the API. There is no polling frequency as such.

From what I've seen though the temperature data is only stored by Teslamate during either a Drive or a Charge, the Overview dashboard will update the next time one of these occurs.
 
Recent builds of Teslamate use a streaming function of the Tesla API, it subscribes and receives data as it's published on the API. There is no polling frequency as such.

From what I've seen though the temperature data is only stored by Teslamate during either a Drive or a Charge, the Overview dashboard will update the next time one of these occurs.

I think the temp is only stored for 30 mins, so also when the car wakes then vehicle data is read, then just the streaming data which doesn't contain temp while the car goes to sleep, so te pnel drops the temp 30 mins after the last temp data (I saw a PR on github detailing this)
 
Are there other dashboards that people have create other than what is in the github repository dashboards folder?

Not sure if you've come across the 'Top Values by period' dashboard?

2021-02-15 16_42_53-Window.png


Code:
{
  "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": 23,
  "iteration": 1613407319714,
  "links": [
    {
      "icon": "dashboard",
      "tags": [],
      "title": "TelsaMate",
      "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": 4,
      "panels": [],
      "repeat": "car_id",
      "scopedVars": {
        "car_id": {
          "selected": false,
          "text": "TreVoR",
          "value": "2"
        }
      },
      "title": "$car_id",
      "type": "row"
    },
    {
      "datasource": "TeslaMate",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "left",
            "displayMode": "auto",
            "filterable": false,
            "width": 120
          },
          "mappings": [],
          "noValue": "--",
          "thresholds": {
            "mode": "percentage",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 50
              },
              {
                "color": "green",
                "value": 90
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Period"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 245
              },
              {
                "id": "links",
                "value": [
                  {
                    "targetBlank": true,
                    "title": "Trip",
                    "url": "d/FkUpJpQZk/trip?orgId=1&from=${__data.fields.date_from}&to=${__data.fields.date_to}"
                  }
                ]
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": "/.* at/"
            },
            "properties": [
              {
                "id": "unit",
                "value": "time:YYYY-MM-DD HH:mm"
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": "/distance_max_.*/"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Max Distance"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Starting at"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 183
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": "/.*_km/"
            },
            "properties": [
              {
                "id": "unit",
                "value": "lengthkm"
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": "/.*_mi/"
            },
            "properties": [
              {
                "id": "unit",
                "value": "lengthmi"
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": "/.*_kmh/"
            },
            "properties": [
              {
                "id": "unit",
                "value": "velocitykmh"
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": "./*_mih/"
            },
            "properties": [
              {
                "id": "unit",
                "value": "velocitymph"
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": "/speed_max_.*/"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Max Speed"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Max Duration"
            },
            "properties": [
              {
                "id": "unit",
                "value": "m"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Max Power"
            },
            "properties": [
              {
                "id": "unit",
                "value": "kwatt"
              },
              {
                "id": "custom.width",
                "value": 170
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Speed"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 184
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Distance"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 158
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 13,
        "w": 20,
        "x": 0,
        "y": 1
      },
      "id": 2,
      "maxPerRow": 2,
      "options": {
        "frameIndex": 1,
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Starting at"
          }
        ]
      },
      "pluginVersion": "7.3.7",
      "repeat": "car_id",
      "repeatDirection": "v",
      "scopedVars": {
        "car_id": {
          "selected": false,
          "text": "TreVoR",
          "value": "2"
        }
      },
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "WITH data AS (\n  SELECT\n    date_trunc('$period', start_date::TIMESTAMP WITHOUT TIME ZONE, '$timezone') as local_period,\n    drives.*\n  FROM drives\n)\nSELECT\n  EXTRACT(EPOCH FROM date_trunc('$period', local_period))*1000 AS date_from,\n  EXTRACT(EPOCH FROM date_trunc('$period', local_period + ('1 ' || '$period')::INTERVAL))*1000 AS date_to,\n  CASE '$period'\n    WHEN 'month' THEN to_char(local_period, 'YYYY Month')\n    WHEN 'year' THEN to_char(local_period, 'YYYY')\n    WHEN 'week' THEN 'week ' || to_char(local_period, 'WW') || ' starting ' || to_char(local_period, 'YYYY-MM-DD')\n    ELSE to_char(local_period, 'YYYY-MM-DD')\n  END AS display,\n  local_period AS date,\n  convert_km(max(speed_max)::numeric, '$length_unit') AS speed_max_${length_unit}h,\n  max(power_max) AS power_max,\n  convert_km(max(distance)::numeric, '$length_unit') AS distance_max_$length_unit,\n  max(duration_min) AS duration_min\nFROM data WHERE\n  car_id = $car_id AND\n  $__timeFilter(start_date)\nGROUP BY date\nORDER BY date",
          "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": "per ${period}",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "seriesToColumns",
          "options": {
            "byField": "date"
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "date": false,
              "date_from": true,
              "date_to": true,
              "timezone": true
            },
            "indexByName": {
              "date": 1,
              "date_from": 6,
              "date_to": 7,
              "display": 0,
              "distance_max_km": 4,
              "duration_min": 5,
              "power_max": 3,
              "speed_max_kmh": 2
            },
            "renameByName": {
              "avg_consumption_kwh": "Avg charged",
              "avg_outside_temp_c": "",
              "cnt": "# drives",
              "cnt_charges": "# charges",
              "cost_charges": "Costs",
              "date": "Starting at",
              "date_from": "",
              "date_to": "",
              "display": "Period",
              "distance_max_km": "",
              "duration_min": "Max Duration",
              "efficiency": "Efficiency",
              "efficiency_net_km": "",
              "power_max": "Max Power",
              "speed_max": "Speed",
              "speed_max_km": "",
              "sum_consumption_kwh": "Energy charged",
              "sum_distance_km": "",
              "sum_duration_h": "Time driven"
            }
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "5m",
  "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;",
        "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": {
          "selected": false,
          "text": "mi",
          "value": "mi"
        },
        "datasource": "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": {
          "selected": false,
          "text": "C",
          "value": "C"
        },
        "datasource": "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": {
          "selected": true,
          "text": "month",
          "value": "month"
        },
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Period",
        "multi": false,
        "name": "period",
        "options": [
          {
            "selected": true,
            "text": "day",
            "value": "day"
          },
          {
            "selected": false,
            "text": "week",
            "value": "week"
          },
          {
            "selected": false,
            "text": "month",
            "value": "month"
          },
          {
            "selected": false,
            "text": "year",
            "value": "year"
          }
        ],
        "query": "day,week,month,year",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "rated",
          "value": "rated"
        },
        "datasource": "TeslaMate",
        "definition": "select preferred_range from settings limit 1;",
        "error": null,
        "hide": 2,
        "includeAll": false,
        "label": null,
        "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": "Etc/UTC",
          "value": "Etc/UTC"
        },
        "datasource": "TeslaMate",
        "definition": "select current_setting('TIMEZONE'), name from pg_timezone_names where name like 'posix/%';",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Time zone",
        "multi": false,
        "name": "timezone",
        "options": [],
        "query": "select current_setting('TIMEZONE'), name from pg_timezone_names where name like 'posix/%';",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "https://teslamate.medved77.com",
          "value": "https://teslamate.medved77.com"
        },
        "datasource": "TeslaMate",
        "definition": "select base_url from settings limit 1;",
        "error": null,
        "hide": 2,
        "includeAll": false,
        "label": null,
        "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-10y",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "browser",
  "title": "Top values by period",
  "uid": "3MhVw9FMk",
  "version": 2
}
 
I can see temperature readings when the car wakes up - even though no drive or charge has taken place. No updates when it's asleep obviously.
Yes they appear on the Teslamate Dashboard when the car is online ( :4000), my point was more to the OP's question about Grafana - I'm not sure if that is updating at the same time, it may not be showing the same.

For example after Teslamate is restarted it won't show any temperature information until the next time the car is online, which suggests it's not retrieving data from Postgres (as Grafana is)
 
Yes they appear on the Teslamate Dashboard when the car is online ( :4000), my point was more to the OP's question about Grafana - I'm not sure if that is updating at the same time, it may not be showing the same.

For example after Teslamate is restarted it won't show any temperature information until the next time the car is online, which suggests it's not retrieving data from Postgres (as Grafana is)
But if you use an app, either the official Tesla app or something else like Remote, then isn't the car waking up and going online to receive the Turn Climate On command?
 
But if you use an app, either the official Tesla app or something else like Remote, then isn't the car waking up and going online to receive the Turn Climate On command?
Yes that's correct. The distinction I'm making here is that Teslamate and Grafana are using different data sources. Teslamate's status shows data from the Tesla API and the local Postgres database on it's status page. However Grafana is limited to only displaying data already in the Postgres database.

I've just done some digging in the database and it appears that Teslamate is storing one entry in the "positions" table each time the car wakes up and for every 30 minutes it's online thereafter, in addition to those created every 3 seconds during Drives & Charging. That should allow Grafana to show at least something recent, but it's still not of any use for current tracking of environmental data when parked!

TL;DR If you want live data, check the Teslamate UI - not Grafana.
 
Last edited:
Maybe I have something configured wrong, but I don't see temp in TeslaMate, I see a map of my car's location and this info:

Tessie
Model S P85D

Status falling asleep for 14 h, 8 min
Range (rated) 336.98 km
Range (est.) 214.91 km
State of Charge 85% (87%)
Mileage 64405 km
Version 2020.48.12.1

Techinically my car is a P85D rather than a P85D as I got the Ludicrous upgrade. Is that not available in the API or does TeslaMate not reflect that.

Edit - so my car most have woken up, as I now see:
Tessie

Model S P85D


Status online for 14 h, 35 min
Range (rated) 338.62 km
Range (est.) 215.97 km
Scheduled Charging 5:30:00 AM
Charge Limit 90%
State of Charge 86%
Outside Temperature 1.5 °C
Inside Temperature 22.5 °C
Mileage 64405 km
Version 2020.48.12.1
 
Last edited:
Correct, if you initially start Teslamate when the car is offline it only shows the partial data that it has cached. The next time the car is online it will show additional data, such as climate, battery temperature (snowflake) and the charging schedule/limit - recording this every 30 minutes to the 'positions' table in Postgres, assuming it's not driving/charging.

Given Teslamate is supposed to be running all the time this isn't normally something you would see, until the next time you restart it.