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.
Anyone better at Linux than me (anyone) know how to access/view the teslamate database through the command line? I've installed psql but using \list only lists three databases; postgres, template0 and template1. No teslamate to be seen anywhere.

Using sudo -u teslamate psql as the username (as per the install) also fails; unknown user.

Doesn't seem like I can even create a database either...
 
Last edited:
Does anyone know if it's possible (and if so, how) to add a sort of dummy data in the databases?
I have installed TeslaMate on my Raspberry Pi (and PiVPN so I can connect to it from everywhere via VPN) but I don't have my Tesla yet.I would like to play around with the Grafana dashboards to make them more ideal for me or to add some.
But right now, almost every dashboard created out of the box, gjve me some errors. I assume because the databases are empty
 
How strange! I wonder what it's supposed to do?

Absolutely no idea!

On the plus side, the bulk update worked, the destination shows up properly :)

AAE4A965-8733-4B0A-8B0D-D8F69DE51383.jpeg
 
  • Like
Reactions: Roy W.
Does anyone know if it's possible (and if so, how) to add a sort of dummy data in the databases?
I have installed TeslaMate on my Raspberry Pi (and PiVPN so I can connect to it from everywhere via VPN) but I don't have my Tesla yet.I would like to play around with the Grafana dashboards to make them more ideal for me or to add some.
But right now, almost every dashboard created out of the box, gjve me some errors. I assume because the databases are empty

Not really unless someone gives you their export. The data for drives etc produces a new db row every 15s or whatever the stream outputs so there's a LOT of data to dummy.
 
I can add those values in, but it’s not in a certain currency. So the values are just 0.25 or whatever they are as per the above.

Suggest it’d be better do just add prices in for the countries in Euros and add in the individual costs per charging sessions when you visit the UK?
 
Not ideal, but you could update the table yourself if you wanted to:

Code:
teslamate=# \d charging_processes
                                             Table "public.charging_processes"
        Column        |            Type             | Collation | Nullable |                    Default
----------------------+-----------------------------+-----------+----------+------------------------------------------------
 id                   | integer                     |           | not null | nextval('charging_processes_id_seq'::regclass)
 start_date           | timestamp without time zone |           |          |
 end_date             | timestamp without time zone |           |          |
 charge_energy_added  | numeric(8,2)                |           |          |
 start_ideal_range_km | numeric(6,2)                |           |          |
 end_ideal_range_km   | numeric(6,2)                |           |          |
 start_battery_level  | smallint                    |           |          |
 end_battery_level    | smallint                    |           |          |
 duration_min         | smallint                    |           |          |
 outside_temp_avg     | numeric(4,1)                |           |          |
 car_id               | smallint                    |           | not null |
 position_id          | integer                     |           | not null |
 address_id           | integer                     |           |          |
 start_rated_range_km | numeric(6,2)                |           |          |
 end_rated_range_km   | numeric(6,2)                |           |          |
 geofence_id          | integer                     |           |          |
 charge_energy_used   | numeric(8,2)                |           |          |
 cost                 | numeric(6,2)                |           |          |

The field accepts a negative value. I presume TeslaMate converts the kWh dropdown to the total cost before sticking it in this field.

Contemplating writing a trigger or some sort of process to periodically update this value by pulling in the API rates at the time, since a charge can go over several 30 minute blocks with different £/kWh
 
  • Like
Reactions: Russinating
Yeah, just did exactly that. Set the cost to 666 through Teslamate and updated it via psql. I'm sure there's a better way just didn't want to screw up the db :D.

UPDATE charging_processes SET cost = -0.38 WHERE cost = 666.00;

All the Grafana panels, graphs and calcs etc seem to be fine and correct.
 
  • Like
Reactions: Durzel