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

TeslaMate [megathread]

This site may earn commission on affiliate links.
I now have Teslamate running on a server hosted by Vultr (thought I'd avoid the big boys - just in case).

The process of restoring the data from my self hosted Pi instance was a pain though. Used the instructions here:
Backup and Restore | TeslaMate

This line of sql would fail:

Code:
 AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$1)))::public.earth';

Had to change to:

Code:
 AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians($1))*cos(radians($2))),public.earth()*cos(radians($1))*sin(radians($2))),public.earth()*sin(radians($1)))::public.earth';

Not sure if it's an error in the docs or something pertaining to my environment, anyway, all done now.

It's nice to have it hosted, to be able to access it from the car's browser and also for it to be secure (htpasswd). Also nice to have the option to backup the server, rather than just the data.

Probably time to cancel my TeslaFi subscription and find an alternative use for the Pi.

Glad that's working, not sure why the import failed though, maybe it's a quirk following the grafana update.

My two Pi 4's now run Homebridge (getting non Homekit stuff to work with Homekit - Previously used Homeassistant) and RetroPi, not that I ever play the thing :)
 
Glad that's working, not sure why the import failed though, maybe it's a quirk following the grafana update.

My two Pi 4's now run Homebridge (getting non Homekit stuff to work with Homekit - Previously used Homeassistant) and RetroPi, not that I ever play the thing :)
Yeah, homebridge is the next thing to investigate. Although I think I'm going to relax with the home based IT projects for a bit.
 
That makes sense, I think it says once you change the permissions (with the second statement) that you need to login for it to take affect.

I've put something together for an automated backup to Google Drive if that helps?

How to perform an automated TeslaMate backup to Google Drive

Thanks @DaveW, I followed the instructions the other night to get t his going. I thought I did it ok, and didn't get any errors during the whole process. I see in my google drive account there are three files, but the ones labelled Thursday and Friday seem to be of 0 bytes in size. Even the Dayoftheweek file is only 314bytes, which doesn't seem right. Is there a part of the installation process I should redo? See below pic for my Teslamate backup directory in google drive:

upload_2020-10-23_9-9-23.png
 
Thanks @DaveW, I followed the instructions the other night to get t his going. I thought I did it ok, and didn't get any errors during the whole process. I see in my google drive account there are three files, but the ones labelled Thursday and Friday seem to be of 0 bytes in size. Even the Dayoftheweek file is only 314bytes, which doesn't seem right. Is there a part of the installation process I should redo? See below pic for my Teslamate backup directory in google drive:

View attachment 601657

If you run the tmbackup script manually, does it throw out any errors? I don't think it's backing up any data there
 
v.1.20.1 just released.

Release v1.20.1 · adriankumpf/teslamate

Code:
Enhancements
Dashboards
Charge Level: Always show 0% and 100% when state of charge is shown in a diagram (#980 by mbertheau)
Charging Stats: Titles/labels now match pie-charts (#998 by roadrash2108)
Drive Details: Increase width of odometer panel
Efficiency: Set a fixed max value and use LCD gauge
Statistics: Add links to other dashboards (#973 by DrMichael)
Translations
Update Norwegian translation (#996 and #1007 by spacecosmos)
Update Swedish translation (#1029 by tobiasehlert)
Other
Display update version in the homescreen update tooltip (#976 by ayonix)
Customize Grafana home screen logo (#1004 by gimmespam)
Bump Grafana to 7.2.1
Bug Fixes
Overview: Fix overlapping timestamps in discrete map (#995 by pmboothby)
Fix overlapping timestamps in trip and states dashboard
Fix tooltips in car overview being hidden by .card (#975 by ayonix)
Make Statistics dashboard compatible with older versions of Postgres
Open Statistics dashboard with browser time zone when coming from the TeslaMate UI
 
  • Like
Reactions: phil4 and Roy W.
Here’s mine:

View attachment 601964

Why is there such a difference between your net and gross consumption @Medved_77 ?
I can only think it's because I've had Sentry on 24/7 since I bought the car so the car has never slept.

I've just gotten round to adding a camera to my driveway so sentry is now off when at home. I'll keep an eye on this to see if it makes a difference.
 
  • Like
Reactions: Roy W.
Speaking of superchargers has anyone got a dashboard for them in Grafana?
I may take it as a learning excercise to try and make one that tracks the ones I've visited in the UK.

Tried this today and came up with the below. Happy to share the JSON but only works for my Geofence list which is based off DaveWs import list but sligtly tweaked.

SuperDash.PNG
 
If you run the tmbackup script manually, does it throw out any errors? I don't think it's backing up any data there

Thanks again @DaveW.

Yeah, I think you are correct and I don't think it is running the tmbackup script. I went through the directions again and after running the tmbackup script, I get a command not found error.


Last login: Sun Oct 25 05:12:04 2020 from 192.168.1.13
pi@raspberrypi:~ $ sudo -i
root@raspberrypi:~# ls
root@raspberrypi:~# mkdir /home/pi/tmbackup
mkdir: cannot create directory ‘/home/pi/tmbackup’: File exists
root@raspberrypi:~# cd /home/pi/tmbackup
root@raspberrypi:/home/pi/tmbackup# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@raspberrypi:/home/pi/tmbackup# nano tmbackup.sh
root@raspberrypi:/home/pi/tmbackup# chmod +x tmbackup.sh
root@raspberrypi:/home/pi/tmbackup# ./tmbackup.sh
sudo: /usr/local/bin/docker-compose: command not found
root@raspberrypi:/home/pi/tmbackup#
Nice to see a new version out, but I think I will hold off updating until I get this backup script working....
 
I now have Teslamate running on a server hosted by Vultr (thought I'd avoid the big boys - just in case).

The process of restoring the data from my self hosted Pi instance was a pain though. Used the instructions here:
Backup and Restore | TeslaMate

This line of sql would fail:

Code:
 AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$1)))::public.earth';

Had to change to:

Code:
 AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians($1))*cos(radians($2))),public.earth()*cos(radians($1))*sin(radians($2))),public.earth()*sin(radians($1)))::public.earth';

Not sure if it's an error in the docs or something pertaining to my environment, anyway, all done now.

It's nice to have it hosted, to be able to access it from the car's browser and also for it to be secure (htpasswd). Also nice to have the option to backup the server, rather than just the data.

Probably time to cancel my TeslaFi subscription and find an alternative use for the Pi.


We've done the opposite of each other. I originally had mine installed on Vultr and then got a RPi4 and moved to that (with the help of @DaveW a few weeks back (I didn't fancy having to pay continuously otherwise would have stayed). Looking to create a vpn so I can log in on my phone and car but haven't gotten round to that.
 
  • Like
Reactions: Medved_77
We've done the opposite of each other. I originally had mine installed on Vultr and then got a RPi4 and moved to that (with the help of @DaveW a few weeks back (I didn't fancy having to pay continuously otherwise would have stayed). Looking to create a vpn so I can log in on my phone and car but haven't gotten round to that.
My path to finding a good data logging solution wasn't the most economical :)

I'd paid for 8 months of TesalFi.
Then £60 for the Pi4
A 20 Euro donation to Adrian.
$6 per month ongoing for Vultr with nightly backups.

For me the server solution was preferred as I can access Teslamate from anywhere and securely without worrying about direct connections to anything on my home network.
 
  • Like
Reactions: ElRey
Did you set your Octopus region in the yml file?

Also, takes a few minutes to populate, not sure how long you've waited for?

Yep, been in and double checked it vs. the Octopus API + Checked my Geo in Teslamate.

New to all this, trying to learn :) Appreciate the help.

This is what I added to the docker.yml, I've restarted the Pi since too.

Code:
services:
teslamateagile:
    image: mattjeanes/teslamateagile:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=secret
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - TeslaMate__UpdateIntervalSeconds=300
      - TeslaMate__GeofenceId=2
      - TeslaMate__Phases=1
      - Octopus__RegionCode=B
 
Yep, been in and double checked it vs. the Octopus API + Checked my Geo in Teslamate.

New to all this, trying to learn :) Appreciate the help.

This is what I added to the docker.yml, I've restarted the Pi since too.

Code:
services:
teslamateagile:
    image: mattjeanes/teslamateagile:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=secret
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - TeslaMate__UpdateIntervalSeconds=300
      - TeslaMate__GeofenceId=2
      - TeslaMate__Phases=1
      - Octopus__RegionCode=B
The content of teslamateagile looks identical to mine apart from the geofence and region code which is to be expected.

The only difference I can see is your placement of the services section. You should have multiple services listed within that header e.g:

services:
teslamate:
database:
grafana:
mosquitto:
teslamateagile:

Have a look at your .yml file and see if you've maybe got two sections called services? I'll DM you my setup so that you can compare.
 
  • Like
  • Informative
Reactions: Godsense and Roy W.
Yep, been in and double checked it vs. the Octopus API + Checked my Geo in Teslamate.

New to all this, trying to learn :) Appreciate the help.

This is what I added to the docker.yml, I've restarted the Pi since too.

Code:
services:
teslamateagile:
    image: mattjeanes/teslamateagile:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=secret
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - TeslaMate__UpdateIntervalSeconds=300
      - TeslaMate__GeofenceId=2
      - TeslaMate__Phases=1
      - Octopus__RegionCode=B

Did you issue the "docker-compose up -d" command?