Skip to content

Import from TeslaFi not working if converting files from Tessie to TeslaFi using third party tool #4508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
jaswals opened this issue Jan 28, 2025 · 14 comments
Closed
1 task done
Labels
note:more information needed The reporter has to provide more information Stale

Comments

@jaswals
Copy link

jaswals commented Jan 28, 2025

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I have searched existing issues, they have been closed off due to no activity
Old Issue: #2896

I have exact issue and don't know how to fix it.

  • 3 files (1 file per month)
  • Files were exported from Tessie then converted to TeslaFi format using this tool: https://www.myteslamate.com/tessie-to-teslamate/
  • Only first file shows checkmark out of 3 but no data gets imported from any of the 3 files
  • Vehicle ID is present (1)
  • There are no strange/special characters in the csv
  • CVS was not opened in excel (no changes were made)
  • Date/time format is correct
  • Display Name of Car is there and it matches with what's in the teslamate (Tesla)
  • DB Container logs show no activity at all
  • import folder permissions are good.

Teslamate Container logs are below:

teslamate-teslamate-1 | [info] Found 3 file(s) at '/opt/app/import'. Starting in import mode!
teslamate-teslamate-1 | 2025-01-26 19:59:28.569 [info] System Info: Erlang/OTP 26 (jit)
teslamate-teslamate-1 | 2025-01-26 19:59:28.569 [info] Version: 1.32.0
teslamate-teslamate-1 | 2025-01-26 19:59:29.026 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (382.104 ms)
teslamate-teslamate-1 | 2025-01-26 19:59:29.026 [info] Refreshed api tokens
teslamate-teslamate-1 | 2025-01-26 19:59:29.070 [info] Scheduling token refresh in 6 h
teslamate-teslamate-1 | 2025-01-26 19:59:29.085 [info] Running TeslaMateWeb.Endpoint with cowboy 2.12.0 at :::4000 (http)
teslamate-teslamate-1 | 2025-01-26 19:59:29.086 [info] Access TeslaMateWeb.Endpoint at http://localhost/
teslamate-teslamate-1 | 2025-01-26 19:59:29.974 [info] GET /
teslamate-teslamate-1 | 2025-01-26 19:59:29.980 [info] Sent 302 in 6ms
teslamate-teslamate-1 | 2025-01-26 19:59:29.989 [info] GET /import
teslamate-teslamate-1 | 2025-01-26 19:59:29.998 [info] Sent 200 in 9ms
teslamate-teslamate-1 | 2025-01-26 19:59:39.732 [info] Importing 3 file(s) ...
teslamate-teslamate-1 | 2025-01-26 19:59:39.739 [info] Starting logger for 'Tesla'
teslamate-teslamate-1 | 2025-01-26 19:59:40.258 [info] Import complete!

Expected Behavior

Data from CSV should get imported.

Steps To Reproduce

Follow steps to place CSV in import folder
Restart Teslamate service
Go to Teslatemate URL and import prompt appears showing you the files and asking for timezone.
set timezone and tap on import button
only 1 of X files show checkmark but nothing gets imported into the DB.

Relevant log output

teslamate-teslamate-1  | [info] Found 3 file(s) at '/opt/app/import'. Starting in import mode!
teslamate-teslamate-1  | 2025-01-27 22:35:46.655 [info] Migrations already up
teslamate-teslamate-1  | [info] Found 3 file(s) at '/opt/app/import'. Starting in import mode!
teslamate-teslamate-1  | 2025-01-27 22:35:50.162 [info] System Info: Erlang/OTP 26 (jit)
teslamate-teslamate-1  | 2025-01-27 22:35:50.162 [info] Version: 1.32.0
teslamate-teslamate-1  | 2025-01-27 22:35:50.504 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (261.011 ms)
teslamate-teslamate-1  | 2025-01-27 22:35:50.504 [info] Refreshed api tokens
teslamate-teslamate-1  | 2025-01-27 22:35:50.577 [info] Scheduling token refresh in 6 h
teslamate-teslamate-1  | 2025-01-27 22:35:50.591 [info] Running TeslaMateWeb.Endpoint with cowboy 2.12.0 at :::4000 (http)
teslamate-teslamate-1  | 2025-01-27 22:35:50.594 [info] Access TeslaMateWeb.Endpoint at http://localhost
teslamate-teslamate-1  | 2025-01-27 22:35:52.089 [info] GET /import
teslamate-teslamate-1  | 2025-01-27 22:35:52.099 [info] Sent 200 in 9ms
teslamate-teslamate-1  | 2025-01-27 22:36:57.337 [info] GET /import
teslamate-teslamate-1  | 2025-01-27 22:36:57.345 [info] Sent 200 in 7ms
teslamate-teslamate-1  | 2025-01-27 22:37:58.753 [info] Importing 3 file(s) ...
teslamate-teslamate-1  | 2025-01-27 22:37:58.760 [info] Starting logger for 'Tesla'
teslamate-teslamate-1  | 2025-01-27 22:37:59.320 [info] Import complete!

Screenshots

No response

Additional data

No response

Type of installation

Docker

Version

1.32.0

@JakobLichterfeld
Copy link
Member

JakobLichterfeld commented Jan 28, 2025

maybe related #4477

@JakobLichterfeld JakobLichterfeld added the note:more information needed The reporter has to provide more information label Jan 28, 2025
@jaswals
Copy link
Author

jaswals commented Jan 28, 2025

maybe related #4477

It's not related, unlike #4477 I don't set any errors in the logs, instead it says import was successful.

  1. anyone knows in which scenarios, I would see import completed successfully with checkmark on only first of the 3 files but not all all gets imported into the DB.
  2. shouldn't the DB container logs show inserts being done in the DB? I see no activity in the DB logs at all even through testlamate says import was complete

@jaswals
Copy link
Author

jaswals commented Jan 28, 2025

maybe related #4477

Let me know what other information is needed. (per the label you have added)

@JakobLichterfeld JakobLichterfeld changed the title Import from TeslaFi not working Import from TeslaFi not working if converting files from Tessie to TeslaFi using third party tool Jan 29, 2025
@Kawuezel
Copy link

I have exactly the same issue.

@jlestel
Copy link
Contributor

jlestel commented Mar 8, 2025

@Kawuezel @jaswals Tessie changed their format in January, try again as I fixed the conversion tool.

I guess the files were empty (?)

@jaswals
Copy link
Author

jaswals commented Mar 8, 2025

@Kawuezel @jaswals Tessie changed their format in January, try again as I fixed the conversion tool.

I guess the files were empty (?)

I will re export, reconvert and try again tonight. I will advise. Thanks

@jaswals
Copy link
Author

jaswals commented Mar 9, 2025

@Kawuezel @jaswals Tessie changed their format in January, try again as I fixed the conversion tool.

I guess the files were empty (?)

Still same issue, I started from
Scratch, files are not empty, check mark comes up right away but no data actually gets imported.

@jaswals
Copy link
Author

jaswals commented Mar 11, 2025

Can someone please share a sample file from Tesla-Fi or point me to where I can get one for me to compare what may be different?

@JakobLichterfeld
Copy link
Member

Can someone please share a sample file from Tesla-Fi or point me to where I can get one for me to compare what may be different?

@TheLinuxGuy can you provide sample TeslaFi files?

@jlestel
Copy link
Contributor

jlestel commented Mar 31, 2025

@Kawuezel @jaswals It's fixed now.

Tessie changed her export again.

Even though they've been recording the power for years, they no longer include it in the export.

Copy link
Contributor

github-actions bot commented May 1, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label May 1, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2025
@thoerup
Copy link

thoerup commented May 16, 2025

I just tried importing using the 3rd party website that @jaswals mentioned. Something may have changed again since the import to Teslamate fails. I have data from March 2024 until now.

When I start with a completely empty database, the first file from March 2024 fails after successfully importing about 20 drives.

log:

teslamate-1  | 2025-05-16 08:47:50.901 [info] Start of drive initiated by: %TeslaApi.Vehicle.State.Drive{active_route_destination: nil, active_route_energy_at_arrival: nil, active_route_latitude: nil, active_route_longitude: nil, active_route_miles_to_arrival: nil, active_route_minutes_to_arrival: nil, active_route_traffic_minutes_delay: nil, gps_as_of: nil, heading: nil, latitude: 55.863117, longitude: 12.397505, native_latitude: nil, native_location_supported: nil, native_longitude: nil, native_type: nil, power: 0, shift_state: "D", speed: 50, timestamp: 1710519720000}
teslamate-1  | 2025-05-16 08:47:50.901 car_id=1 [info] Driving / Start
teslamate-1  | 2025-05-16 08:47:51.295 car_id=1 [warning] Vehicle went offline while driving
teslamate-1  | 2025-05-16 08:47:51.318 car_id=1 [info] Driving / Timeout / 9 km – 11 min
teslamate-1  | 2025-05-16 08:47:51.323 car_id=1 [info] Vehicle came back online after 11 min
teslamate-1  | 2025-05-16 08:47:51.324 [error] GenStateMachine :import_Manse terminating
teslamate-1  | ** (CondClauseError) no cond clause evaluated to a truthy value
teslamate-1  |     (teslamate 2.0.0) lib/teslamate/vehicles/vehicle.ex:1053: TeslaMate.Vehicles.Vehicle.handle_event/4
teslamate-1  |     (stdlib 5.2.3.3) gen_statem.erl:1397: :gen_statem.loop_state_callback/11
teslamate-1  |     (stdlib 5.2.3.3) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
teslamate-1  | 2025-05-16 08:47:51.326 [warning] Import failed: {:cond_clause,
teslamate-1  |  [
teslamate-1  |    {TeslaMate.Vehicles.Vehicle, :handle_event, 4,
teslamate-1  |     [file: ~c"lib/teslamate/vehicles/vehicle.ex", line: 1053]},
teslamate-1  |    {:gen_statem, :loop_state_callback, 11,
teslamate-1  |     [file: ~c"gen_statem.erl", line: 1397]},
teslamate-1  |    {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 241]}
teslamate-1  |  ]}

When I take the containers down and up again, the log show that 20 drives are repaired with geolocation added and I can see these drives in the dashboard.

Since files are still in the "import" folder at this point I get the Import page when opening http://:3000, when I click import again I get a check mark on the first file and a skipped icon for the next and the log shows:

teslamate-1  | 2025-05-16 08:57:10.440 [info] Importing 15 file(s) ...
teslamate-1  | 2025-05-16 08:57:10.450 [info] Starting logger for 'Manse'
teslamate-1  | 2025-05-16 08:57:10.952 [info] Import complete!

But nothing is imported

Any ideas what I can do?

Thanks!

@jaswals
Copy link
Author

jaswals commented May 16, 2025

I still have same issue, I was trying to import data from Nov 2024 to Jan 2025 it it still doesn't work.

I signed up for Tesla Fi Trial and can see the data looks very different than from export tool but I just gave up.

@thoerup
Copy link

thoerup commented May 16, 2025

That’s too bad, thanks for replying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
note:more information needed The reporter has to provide more information Stale
Projects
None yet
Development

No branches or pull requests

5 participants