Hi! My Tesla has been way screwy lately, and it was finally just brought back to life after some Very Dark Days without all that precious d a t a in TeslaMate.
TeslaMate handled it basically like a champ. Looking at the data again now that it’s working again, there’s one awkward drive where it lasts four minutes and the GPS coordinates are all screwy- it basically teleports me 10 miles away and then back again.
Is there a process where I could basically manually nuke that one single drive? Would that completely mess up the data integrity for the rest of TeslaMate? If not, and it’s easy enough to just nuke that row... what’s the suggested way of making those changes?
Cheers!
Yeah, that's not a big deal. Simply delete the drive and the corresponding rows from the positions table.
For example, to delete the drive with id 42:
BEGIN;
UPDATE drives SET start_position_id = NULL, end_position_id = NULL WHERE id = 42;
DELETE FROM positions WHERE drive_id = 42;
DELETE FROM drives WHERE id = 42;
COMMIT;
Curious - would it make sense to add a tools/utils page for things like these? As in add a drive ID, and it can delete the drives? Same thing possibly for a couple of other things. I don't know if there is a lot of value or better off to have this via discussions.
Or add it to the FAQ?
Actually, now that I'm looking at it some more, what's the best way to access the db directly? Kinda unfamiliar with how everything is set up (using the docker-compose route).
Ah, was able to do it from this helpful comment. Documenting that/adding to the FAQ (or making an easier way to get a db console) would be a +1 from me!
Annnnnnd one last comment: that process that @adriankumpf nicely detailed worked great for me- the map looks great once again, thanks! Feel free to close this issue and/or keep it open for the FAQ/docs/what have you. 🚗🔋
Is there a way to remove a rogue location as well? I seem to have been in China at one point with my car. There is no drives associated with that location either.

@cwanja sure, if there are no drives or charges associated to that location, connect to the database container and delete the address:
DELETE FROM addresses WHERE name LIKE '%Mêdog%';
Worked like a champ @adriankumpf. Only update I would say is that the documentation mentions "databases" in the docker-compose connect statement. It should be db. Do not see a way to update that like I would on Github. 👍🏼
Might be completely unrelated, but I did end up the other day with a drive that was not completed. I was able to drop it from the database. Looking at the start location of the drive _after_ it, I _think_ it is actually related to an issue where TeslaMate and the API failed to connect as I was in some low cell coverage location. Is TeslaMate configured to handle this? I figure so, but would ask anyways. Probably should not have dropped the drive before asking. 🤦🏽♂️ sorry to hijack the thread @holman
Yeah, that's not a big deal. Simply delete the drive and the corresponding rows from the
positionstable.For example, to delete the drive with id 42:
BEGIN; UPDATE drives SET start_position_id = NULL, end_position_id = NULL WHERE id = 42; DELETE FROM positions WHERE drive_id = 42; DELETE FROM drives WHERE id = 42; COMMIT;
I'm aiming to create a script that automatically deletes drives less than 1 mile / X minutes duration, since every time I move the car around with Summon a drive gets logged.
Can I ask - why is it that you set the start_position_id and end_position_id to NULL before deleting the drive entry? Is this because setting those values to NULL triggers updates elsewhere?
Thanks in advance.
The comment is outdated. Simply deleting the drive works now.
The comment is outdated. Simply deleting the drive works now.
Could this just be built into the web interface? "Enter drive ID: ". Same for charge.
Most helpful comment
Could this just be built into the web interface? "Enter drive ID: ". Same for charge.