First you need to find out the ID of the drive or charge:
- Open the
Drivesdashboard and click on the start date of the drive.
- The URL will contain the drive ID, for example
- Open the
Chargesdashboard and click on the start date of the charge.
- The URL will contain the charge id, for example
If for some reason a drive or charge hasn't been fully recorded, for example due to a bug or an unexpected restart, you can terminate it manually. Among other things, this assigns an end date to the drive/charge.
9999 with the actual ID then run the command while the TeslaMate container is running:
docker-compose exec teslamate bin/teslamate rpc \ "TeslaMate.Repo.get!(TeslaMate.Log.Drive, 9999) |> TeslaMate.Log.close_drive()"
docker-compose exec teslamate bin/teslamate rpc \ "TeslaMate.Repo.get!(TeslaMate.Log.ChargingProcess, 9999) |> TeslaMate.Log.complete_charging_process()"
If for some reason a drive or charge was recorded incorrectly, you can delete it.
Attach to the running database container:
docker-compose exec database psql teslamate teslamate
If you get the error
No such service: database, update your docker-compose.yml or use
databasein the above command.
9999with the actual ID then run the query:
DELETE FROM drives WHERE id = 9999;
DELETE FROM charging_processes WHERE id = 9999;