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.
Is there option but car faster to sleep than normal time? One option is open site and click sleep but something automatic. I think Teslafi will automatically try to put car sleep after 15min when you have stop/parked.

Teslamate does the same, my car wakes for 2 .ins every 24 hours when parked
I think it's worth clarifying here that Teslamate & TeslaFi handle their data gathering from the cars entirely differently, and has been the case now for a good 9+ months.

Teslamate now just subscribes to the Tesla API, and is automatically pushed any updates that the car sends back to Tesla. That means there is no need to poll the car regularly (as Teslafi does), and no need to stop polling the car to allow it to sleep. If the car sends data, it'll automatically get sent through to Teslamate.

The sleep states in Teslamate are largely determined from state of the car (whether it's driving and whether any doors are open), and the last time an update was received from the car. Generally you expect the car to dial home every few mins when it's online, and so Teslamate just updates the status to "asleep" when it goes a while without receiving data - if the car is parked, doors are closed & it's locked. "Falling asleep" is a meaningless status now in Teslamate, and is a legacy hangover from before the Streaming API was implemented.

Anyone who's installed Teslamate, or updated, within the last 9 months should find that the Streaming API (in Settings) is now enabled by default.
 
I think it's worth clarifying here that Teslamate & TeslaFi handle their data gathering from the cars entirely differently, and has been the case now for a good 9+ months.

Teslamate now just subscribes to the Tesla API, and is automatically pushed any updates that the car sends back to Tesla. That means there is no need to poll the car regularly (as Teslafi does), and no need to stop polling the car to allow it to sleep. If the car sends data, it'll automatically get sent through to Teslamate.

The sleep states in Teslamate are largely determined from state of the car (whether it's driving and whether any doors are open), and the last time an update was received from the car. Generally you expect the car to dial home every few mins when it's online, and so Teslamate just updates the status to "asleep" when it goes a while without receiving data - if the car is parked, doors are closed & it's locked. "Falling asleep" is a meaningless status now in Teslamate, and is a legacy hangover from before the Streaming API was implemented.

Anyone who's installed Teslamate, or updated, within the last 9 months should find that the Streaming API (in Settings) is now enabled by default.
The streaming API always passes data, when the gear goes to null then the car is falling asleep or sleeping. Sleeping is a state in 'vehicles'
 
Advice, please: I've just switched from Octopus Agile (so expensive now, I tried to hang on for as long as I could) to Go Faster 4H 2030-0030. I've been using TeslaMateAgile; could someone please remind me whether I need to disable it, or whether it will pick up the new tariff and keep setting prices dynamically (2030-0030: 5p, 0030-2030: 15.9p)? Thanks!
 
Advice, please: I've just switched from Octopus Agile (so expensive now, I tried to hang on for as long as I could) to Go Faster 4H 2030-0030. I've been using TeslaMateAgile; could someone please remind me whether I need to disable it, or whether it will pick up the new tariff and keep setting prices dynamically (2030-0030: 5p, 0030-2030: 15.9p)? Thanks!

This sort of thing:
- TeslaMate__EnergyProvider=FixedPrice
- FixedPrice__TimeZone=Europe/London
- FixedPrice__Prices__0=23:30-20:30=13.8
- FixedPrice__Prices__1=20:30-23:30=4.5
 
This sort of thing:
- TeslaMate__EnergyProvider=FixedPrice
- FixedPrice__TimeZone=Europe/London
- FixedPrice__Prices__0=23:30-20:30=13.8
- FixedPrice__Prices__1=20:30-23:30=4.5
So you have the price in pence not pounds? Do you also use the imported supercharger data as that looks to be priced in pence so I was a bit confused. Might explain why TeslaMateAgile doesn’t seem to be working well for me at the moment on the fixed price mode …
 
So you have the price in pence not pounds? Do you also use the imported supercharger data as that looks to be priced in pence so I was a bit confused. Might explain why TeslaMateAgile doesn’t seem to be working well for me at the moment on the fixed price mode …
I charged last night for the first time on Go (having moved away from Agile) and teslamateagile did seem to calculate it correctly at 5p per kWh.
 
I'm most likely going to go down the go faster route too - agile is just painful atm.

Did you have to change anything with teslamate/ teslamateagile?
Yeah, here is the current teslamateagile section of my docker-compose.yml (I commented out the 2 Octopus lines and added the four lines at the bottom):

YAML:
  teslamateagile:
    image: mattjeanes/teslamateagile:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=supersecretpassword
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - TeslaMate__UpdateIntervalSeconds=300
      - TeslaMate__GeofenceId=1
      - TeslaMate__Phases=1
      # - TeslaMate__EnergyProvider=Octopus
      # - Octopus__RegionCode=C # Octopus Energy only
      - TeslaMate__EnergyProvider=FixedPrice
      - FixedPrice__TimeZone=Europe/London # IANA (tz database) time zone code, used for below times
      - FixedPrice__Prices__0=00:30-20:30=15.9
      - FixedPrice__Prices__1=20:30-00:30=5

Saved it, docker-compose up -d and that's all I did.
 
How would I go about utilizing my current mosquitto docker container install that's already on port 1883? Anyway to point teslamate to use that in the docker-compose file or do I need to run another instance of it?

You need to set 4 environment variables in your .env file:

MQTT_HOST=##.##.##.##
MQTT_PORT=1883
MQTT_USERNAME=#####
MQTT_PASSWORD=#####

And then include the variables in your docker-compose.yml in the environment section of teslamate.
 
  • Informative
  • Like
Reactions: Dave EV and ranova
You need to set 4 environment variables in your .env file:

MQTT_HOST=##.##.##.##
MQTT_PORT=1883
MQTT_USERNAME=#####
MQTT_PASSWORD=#####

And then include the variables in your docker-compose.yml in the environment section of teslamate.
thanks, I got it communicating to it correctly. Home assistant is pulling in the data from MQTT nicely:
1624757127222.png


Last questions:
  • Where do I put the .htpasswd file for teslamate if Im running the docker container? I can get into the container via sudo docker-enter, but not sure where to stick it
  • How do I configure grafana to hide all teslamate graphs unless you log in? Right now, anyone with the URL can view all the teslamate grafana graphs
 
Last edited:
thanks, I got it communicating to it correctly. Home assistant is pulling in the data from MQTT nicely:
View attachment 678268

Last questions:
  • Where do I put the .htpasswd file for teslamate if Im running the docker container? I can get into the container via sudo docker-enter, but not sure where to stick it
  • How do I configure grafana to hide all teslamate graphs unless you log in? Right now, anyone with the URL can view all the teslamate grafana graphs
figured out how to hide all the dashboards if you're not logged in via each of the Dashboard permission settings. Just need to figure out where to put .htpasswd and I should be all set up!
 
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
}
How do you "import" this table info to use it? I've been fumbling around and just cant see how you do it.
 
How do you "import" this table info to use it? I've been fumbling around and just cant see how you do it.
Are you importing into an existing Dashboard or a new one?

If an existing one:
Add a new panel (First icon in top right menu)
Add an empty panel
Click on arrow next to Panel Title. It only appears when you hover mouse over panel title.
Select 'Inspect' and then 'Panel JSON'
Delete all the existing JSON.
Paste in the new json
Hit 'Apply'
Save your dashboard

If importing into a new dashboard or you get 'No data' error then you'll have to copy the variables from an existing dashboard.
These can be found under 'Dashboard Setting' - the cog icon on the top right menu.
For this panel only $length_unit and $car_id are used. They are on pretty much every Teslamate dashboard so you should be able to copy quite easily.