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 this (and the above post).

In the config we've used, it has this section for Mosquito

Code:
mosquitto:
    image: eclipse-mosquitto:1.6
    restart: always
    ports:
      - 127.0.0.1:1883:1883
    volumes:
      - mosquitto-conf:/mosquitto/config
      - mosquitto-data:/mosquitto/data

But then I think we are only allowing http and https in - Is there a simple way to try and connect to it and see?

Hi @DaveW , yes that's the bit. I've since had time to look at the guide and other docs, didn't realise you were using Traefik also, my bad :oops: I can see in the TeslaMate docs that Traefik configuration only routes 80 & 443 to the outside world, all good.

As an aside, I think from that then if someone actually did want to use the MQTT from a cloud hosted instance then they'd have to add that into the Traefik configuration. MQTT uses TCP/IP on ports 1883 by default or 8883 if using SSL/TLS. If wanting to use MQTT but hosting locally without something like Traefik then it'd be open on the hosts port by default.

If running some other configuration then it's still worth looking out for unexpected open MQTT ports.

An easy way to check if the MQTT broker is accessible is to use one of the good open source MQTT clients. My preferred ones below in case you are interested.

MQTT-explorer for Windows, Mac, Linux
Setup connection
mqttexplorer01.png


Attempt to connect and see topic messages
mqttexplorer02.png


MQTTAnalyzer for iPhone
Setup connection
mqttanalyzer01.png


If connects then you'll be able to navigate to see topic messages
mqttanalyzer02.png
 
  • Like
Reactions: DaveW
Some of these might be stupid but...
1) Do I need any additional hardware for the car to access this API set?
2) Recommendations on hardware? RPi seems a common choice, worth paying for external hosting?

1 - No additional hardware needed
2 - Pi is fine (although found mine a touch unreliable), I posted a free hosting in GCP guide a few pages back if you want to go down the cloud route.
 
1 - No additional hardware needed
2 - Pi is fine (although found mine a touch unreliable), I posted a free hosting in GCP guide a few pages back if you want to go down the cloud route.
My Pi installation has been 100% reliable since 2nd February when I set it up. Mine is only running TeslaMate and the scheduled backup though, nothing else.
 
My Pi installation has been 100% reliable since 2nd February when I set it up. Mine is only running TeslaMate and the scheduled backup though, nothing else.

Mine was a tonne better on Ethernet rather than WiFi, but still crapped out once for no reason I could fathom.

That’s a Pi4 2gb in a heat sink case, running TM, the backup and Homebridge, CPU usage was 2-3%, over 1.5gb of memory free still.

The last failure might have been a true one off, but on the plus side, it meant I spent some time (with the help of others in this thread) getting that guide together.
 
  • Like
Reactions: Roy W.
Using GCP is a no-brainer imo. It's 100% free if you stay on the f1-micro level.

I've gone on to f1-small after getting that same over-utilisation message because, quite frankly, you get $300 credit for signing up to GCP that lasts 12 months, and it uses ~£10 a month of that credit at that level. In other words, my credit is going to run out long before I use it up. When 12 months comes up I'll bump it back down to f1-micro and do the ingenious swap space idea mentioned earlier.

Pi is great, but you have to buy the bits and then run it somewhere - both of which cost money (electricity is probably nominal but it's non-zero).

The only reason to do Pi imo is if you are super concerned about security, using your Tesla credentials on a cloud based instance. But, you control it and unless you're auditing all of the TeslaMate code then for all anyone knows its sending that off somewhere anyway, which would be a problem even on the hosted version.
 
Thank you DaveW, the clear instructions on your website worked for me. I have installed Teslamate on GCP, imported 12 months of TeslaFi history and works like a charm! :)

I have also started tinkering with the Grafana dashboards, but this is quite intimidating.

I am looking for solutions for the following problem: I use the smart charging services of Jedlix (Jedlix - Smart Charging - Driving Renewables Forward). Basically, it charges on the greenest moments. So when I plug in at night, it may have a dozen small charges during the night. For me, this is one charge. However, in TeslaMate/Grafana, this shows up as a dozen charges:

Date Location Duration Cost Added Used Efficiency kW km / h % Start % End
07-07-2020 07:18 Home 3.0 min 0.09 0.42 kWh '- '- 8.4 kW 55 km 79% 80%
07-07-2020 06:46 Home 14.0 min 0.46 2.09 kWh '- '- 9.0 kW 59 km 77% 80%
07-07-2020 06:21 Home 24.0 min 0.81 3.66 kWh 3.63 kWh 100% 9.2 kW 60 km 72% 77%
07-07-2020 05:56 Home 24.0 min 0.81 3.66 kWh 3.64 kWh 100% 9.2 kW 60 km 67% 72%
07-07-2020 05:43 Home 12.0 min 0.44 1.99 kWh '- '- 10.0 kW 65 km 64% 67%
07-07-2020 05:06 Home 23.0 min 0.81 3.66 kWh 3.47 kWh 100% 9.5 kW 63 km 57% 62%
07-07-2020 05:02 Home 3.0 min 0.11 0.52 kWh '- '- 10.4 kW 69 km 56% 57%
07-07-2020 04:34 Home 14.0 min 0.48 2.19 kWh '- '- 9.4 kW 62 km 52% 55%
07-07-2020 01:02 Home 3.0 min 0.07 0.31 kWh '- '- 6.2 kW 41 km 51% 52%
07-07-2020 00:44 Home 4.0 min 0.14 0.63 kWh '- '- 9.5 kW 62 km 49% 50%
06-07-2020 23:56 Home 8.0 min 0.30 1.36 kWh '- '- 10.2 kW 67 km 47% 48%
06-07-2020 23:30 Home 20.0 min 0.55 2.51 kWh 2.95 kWh 85% 7.5 kW 54 km 43% 47%


The entire charge cycle starts at 23:30h evening and ends at 8:00h next morning.

I would like this to show up as one charge in Grafana. Basically, I would have to aggregate these charges and show one line only.

How would I do this?

Thx!
 
  • Like
Reactions: DaveW
It was a nice exercise to put my instance in the GCP, but it's only been there a short time and I have the recommendation to upsize my virtual machine.

"Switch VM resources with high CPU or memory usage to a recommended machine type. Impact Increased performance"

I have nothing but teslamate there and don't bang on it, maybe 3-4 looks a day.

I have two existing Linux servers inhouse, and though the reliability of the cloud is a good idea, I'll migrate back.
 
It was a nice exercise to put my instance in the GCP, but it's only been there a short time and I have the recommendation to upsize my virtual machine.

"Switch VM resources with high CPU or memory usage to a recommended machine type. Impact Increased performance"

I have nothing but teslamate there and don't bang on it, maybe 3-4 looks a day.

I have two existing Linux servers inhouse, and though the reliability of the cloud is a good idea, I'll migrate back.

That warning comes up for everyone, but mines been running fine for a while now.

I think from running mine on a Pi first it uses less than 400mb RAM, so it’s likely just got close to the limit once to trigger the suggestion to upgrade.

The swap file is growing very slowly too, so I don’t think it’s all that memory hungry :)
 
Hi

Some excellent info here. I have a RPi-4 setup running teslamate and have created a new grafana default dashboard but need some help.

Is there a way to create a new dashboard in grafana and have have it show up in the main teslamate dashboards list @mydomain:4000.

Sorry if this has been asked and answered previously.

Thx!
 
Hi

Some excellent info here. I have a RPi-4 setup running teslamate and have created a new grafana default dashboard but need some help.

Is there a way to create a new dashboard in grafana and have have it show up in the main teslamate dashboards list @mydomain:4000.

Sorry if this has been asked and answered previously.

Thx!

You'll need to sign into Grafana to create or edit dashboards. If using the default configuration then go to port 3000 on your domain and then bottom left of the Grafana page you'll see the sign in. Default username and password unless you've changed them will be admin/admin.

You'll then get the icons displayed to add dashboards or edit existing dashboards. As long as you create the dashboard under the teslamate group then it'll appear along side others.

If first time trying this then you might want to go to an existing teslamate Grafana dashboard, then look in the top navigation bar for the dashboard settings, from there you can do a 'Save As'. That will effectively clone an existing dashboard and place it in the teslamate group, you can then try modifying that to see how Grafana works. Also plenty of documentation on the Grafana site.
 
Thank you DaveW, the clear instructions on your website worked for me. I have installed Teslamate on GCP, imported 12 months of TeslaFi history and works like a charm! :)

I have also started tinkering with the Grafana dashboards, but this is quite intimidating.

I am looking for solutions for the following problem: I use the smart charging services of Jedlix (Jedlix - Smart Charging - Driving Renewables Forward). Basically, it charges on the greenest moments. So when I plug in at night, it may have a dozen small charges during the night. For me, this is one charge. However, in TeslaMate/Grafana, this shows up as a dozen charges:

Date Location Duration Cost Added Used Efficiency kW km / h % Start % End
07-07-2020 07:18 Home 3.0 min 0.09 0.42 kWh '- '- 8.4 kW 55 km 79% 80%
07-07-2020 06:46 Home 14.0 min 0.46 2.09 kWh '- '- 9.0 kW 59 km 77% 80%
07-07-2020 06:21 Home 24.0 min 0.81 3.66 kWh 3.63 kWh 100% 9.2 kW 60 km 72% 77%
07-07-2020 05:56 Home 24.0 min 0.81 3.66 kWh 3.64 kWh 100% 9.2 kW 60 km 67% 72%
07-07-2020 05:43 Home 12.0 min 0.44 1.99 kWh '- '- 10.0 kW 65 km 64% 67%
07-07-2020 05:06 Home 23.0 min 0.81 3.66 kWh 3.47 kWh 100% 9.5 kW 63 km 57% 62%
07-07-2020 05:02 Home 3.0 min 0.11 0.52 kWh '- '- 10.4 kW 69 km 56% 57%
07-07-2020 04:34 Home 14.0 min 0.48 2.19 kWh '- '- 9.4 kW 62 km 52% 55%
07-07-2020 01:02 Home 3.0 min 0.07 0.31 kWh '- '- 6.2 kW 41 km 51% 52%
07-07-2020 00:44 Home 4.0 min 0.14 0.63 kWh '- '- 9.5 kW 62 km 49% 50%
06-07-2020 23:56 Home 8.0 min 0.30 1.36 kWh '- '- 10.2 kW 67 km 47% 48%
06-07-2020 23:30 Home 20.0 min 0.55 2.51 kWh 2.95 kWh 85% 7.5 kW 54 km 43% 47%


The entire charge cycle starts at 23:30h evening and ends at 8:00h next morning.

I would like this to show up as one charge in Grafana. Basically, I would have to aggregate these charges and show one line only.

How would I do this?

Thx!

The challenge here is how would teslamate know when your overall charging session is meant to start and end? You'd have to build some assumptions into the logic that is being used to generate the dashboard results.

You could imagine modifying the queries used in Grafana to select charging records based on criteria such as time proximity to other charge records, e.g. assume the same charge session if a charge record has a charge start time which is within X minutes another charge record end time. I use Octopus Agile in the UK and I can think of scenarios where there may be several hours between charging blocks but it's still really the same charging session.

Other approach would be always aggregating charge records which fall within a fixed charging time window, e.g. 22:00 - 08:00, or perhaps combining time proximity and time-window approaches.
 
You'll need to sign into Grafana to create or edit dashboards. If using the default configuration then go to port 3000 on your domain and then bottom left of the Grafana page you'll see the sign in. Default username and password unless you've changed them will be admin/admin.

You'll then get the icons displayed to add dashboards or edit existing dashboards. As long as you create the dashboard under the teslamate group then it'll appear along side others.

If first time trying this then you might want to go to an existing teslamate Grafana dashboard, then look in the top navigation bar for the dashboard settings, from there you can do a 'Save As'. That will effectively clone an existing dashboard and place it in the teslamate group, you can then try modifying that to see how Grafana works. Also plenty of documentation on the Grafana site.
Where can I find the repositories with extra teslamate dashboards?