Comments (7)
thats kinda what i expected you to say... ive redownloaded and checked the format, all fields 'appear' to be in the same format...
then again, i am using Excel for both (shrug)
Open the raw csv in notepad or, better, vs code or another fancy editor instead of Excel. Excel will display the pretty date in the cell you see, but underneath converts it to an integer. It is likely the number of seconds since a specific time defined by Microsoft. Anyway, open a csv saved by Excel and the raw one from teslafi and look at the differences in the dates.
You can probably use any of the tons of free online or installed csv editors out there to do it though. Just Google "csv editor" and add "online" or your operating system.
It would be nice to see the importer updated to recognize the missing car id and sub in a default. If I knew anything about elixir I'd consider opening a pr, but I do not.
from teslamate.
Miller is your friend here... although that involved remembering how to drive it!
All sorted... thanks for the help.
from teslamate.
You say
Copied them to the docker container, in a 'temp folder.
and then
Copied the files into the ./import directory.
but the instructions say to "Copy the exported CSV files into a directory named import
next to the docker-compose.yml". That is on the docker host, not in the docker container. It gets mounted in the container by docker.
If that's not enough to solve it, then the output of:
docker exec teslamate-1 ls -la import
would be useful (replace teslamate-1 with the name of the TeslaMate container).
from teslamate.
It's not explicitly called out, which is annoying, but you look at the filenames in the example in the docs and see they're all prefixed with "TeslaFi". If you rename your files by adding that prefix, but leave the rest of the filename as is, it should work.
However...you will likely need to edit every single line in your csv files to change the 5th field, "car id" I think, to a value of 1
to get them to import properly.
So, two tasks to import:
- Rename all files to add
TeslaFi
as a prefix - Add car id of
1
to field 5 in all rows of all csvs.
Note: DO NOT let excel modify the date format of the date fields or it'll also fail. Excel will do this automatically. I do not know how to prevent it. I used a text editor and regex to handle my car id field.
from teslamate.
Thanks damccull, it now recognises that there are files to import. The import fails with an invalid date format now though:
2024-01-16 10:06:46.647 [error] Task #PID<0.2591.0> started from TeslaMate.Import terminating
** (MatchError) no match of right hand side value: {:error, {:invalid_date_format, "30/12/2022 22:32"}}
(teslamate 1.28.2) lib/teslamate/import/line_parser.ex:80: TeslaMate.Import.LineParser.into_vehicle/3
(stdlib 5.1.1) maps.erl:416: :maps.fold_1/4
(teslamate 1.28.2) lib/teslamate/import/line_parser.ex:20: TeslaMate.Import.LineParser.parse/2
(elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
(elixir 1.15.7) lib/task/supervised.ex:36: Task.Supervised.reply/4
Function: &:erlang.apply/2
Args: [#Function<7.111590375/1 in TeslaMate.Import.create_event_streams/2>, [%{"charge_energy_added" => "", "outside_temp" => "", "elevation" => "", "rear_seat_heaters" => "", "fan_status" => "", "scheduled_charging_start_time" => "", "spoiler_type" => "", "id" => "", "max_range_charge_counter" => "", "locked" => "", "gui_temperature_units" => "", "battery_range" => "", "vin" => "", "idleNumber" => "0", "calendar_enabled" => "", "rhd" => "", "rear_seat_type" => "", "heading" => "", "seat_heater_right" => "", "charger_phases" => "", "outside_tempF" => "", "rerunning" => "0", "trip_charging" => "", "fast_charger_present" => "", "car_type" => "", "calendar_supported" => "", "gui_distance_units" => "", "driver_temp_setting" => "", "gps_as_of" => "", "right_temp_direction" => "", "notifications_supported" => "", "sun_roof_installed" => "", "api_version" => "", "seat_heater_rear_right_back" => "", "charging_state" => "", "gui_range_display" => "", "remote_start_enabled" => "", "seat_heater_rear_left_back" => "", "ft" => "", "eu_vehicle" => "", "df" => "", "charge_current_request_max" => "", "is_front_defroster_on" => "", "gui_charge_rate_units" => "", "valet_mode" => "", "pf" => "", "running" => "0", ...}]]
2024-01-16 10:06:46.647 [error] Task #PID<0.2590.0> started from TeslaMate.Import terminating
** (MatchError) no match of right hand side value: {:error, {:invalid_date_format, "30/12/2022 22:21"}}
(teslamate 1.28.2) lib/teslamate/import/line_parser.ex:80: TeslaMate.Import.LineParser.into_vehicle/3
(stdlib 5.1.1) maps.erl:416: :maps.fold_1/4
(teslamate 1.28.2) lib/teslamate/import/line_parser.ex:20: TeslaMate.Import.LineParser.parse/2
(elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
(elixir 1.15.7) lib/task/supervised.ex:36: Task.Supervised.reply/4
Function: &:erlang.apply/2
Args: [#Function<7.111590375/1 in TeslaMate.Import.create_event_streams/2>, [%{"charge_energy_added" => "", "outside_temp" => "", "elevation" => "", "rear_seat_heaters" => "", "fan_status" => "", "scheduled_charging_start_time" => "", "spoiler_type" => "", "id" => "", "max_range_charge_counter" => "", "locked" => "", "gui_temperature_units" => "", "battery_range" => "", "vin" => "", "idleNumber" => "0", "calendar_enabled" => "", "rhd" => "", "rear_seat_type" => "", "heading" => "", "seat_heater_right" => "", "charger_phases" => "", "outside_tempF" => "", "rerunning" => "0", "trip_charging" => "", "fast_charger_present" => "", "car_type" => "", "calendar_supported" => "", "gui_distance_units" => "", "driver_temp_setting" => "", "gps_as_of" => "", "right_temp_direction" => "", "notifications_supported" => "", "sun_roof_installed" => "", "api_version" => "", "seat_heater_rear_right_back" => "", "charging_state" => "", "gui_range_display" => "", "remote_start_enabled" => "", "seat_heater_rear_left_back" => "", "ft" => "", "eu_vehicle" => "", "df" => "", "charge_current_request_max" => "", "is_front_defroster_on" => "", "gui_charge_rate_units" => "", "valet_mode" => "", "pf" => "", "running" => "0", ...}]]
2024-01-16 10:06:46.651 [error] GenStateMachine TeslaMate.Import terminating
** (FunctionClauseError) no function clause matching in anonymous fn/1 in TeslaMate.Import.create_event_streams/2
(teslamate 1.28.2) anonymous fn({:exit, {{:badmatch, {:error, {:invalid_date_format, "30/12/2022 22:21"}}}, [{TeslaMate.Import.LineParser, :into_vehicle, 3, [file: ~c"lib/teslamate/import/line_parser.ex", line: 80]}, {:maps, :fold_1, 4, [file: ~c"maps.erl", line: 416]}, {TeslaMate.Import.LineParser, :parse, 2, [file: ~c"lib/teslamate/import/line_parser.ex", line: 20]}, {Task.Supervised, :invoke_mfa, 2, [file: ~c"lib/task/supervised.ex", line: 101]}, {Task.Supervised, :reply, 4, [file: ~c"lib/task/supervised.ex", line: 36]}]}}) in TeslaMate.Import.create_event_streams/2
from teslamate.
That's almost guaranteed to be because you opened it in Excel to add the 1 to the car id column and saved it. Excel saves dates in it's own format which is not going to match what the files originally had. That's why I mentioned that I used a regex find and replace in a text editor to do mine. Explaining that is beyond my available time though... You will need to find a way to edit the csv file without using Excel, or a way to tell excel to leave the existing date columns intact.
from teslamate.
thats kinda what i expected you to say... ive redownloaded and checked the format, all fields 'appear' to be in the same format...
then again, i am using Excel for both (shrug)
from teslamate.
Related Issues (20)
- Impossible GPS coordinates HOT 1
- Suspend logging is not needed anymore as car falls asleep even while polling HOT 47
- Can't get the carId . already logging by the tesla token! HOT 2
- Release 1.28.3 seemingly not correctly pushed as arm64 image HOT 1
- WebView crashes while charging, if time_zone_not_found HOT 7
- Drive records are not saved HOT 4
- No connection to Tesla API / non-existing domain *done* HOT 3
- Trips with negative gradient do not record correctly HOT 8
- feat: bundle MQTT data in one json blob HOT 8
- Wrong time zone for estimated charge end, TZ environment variable set correctly HOT 9
- New Model Y does not get discovered in version 1.28.3 HOT 1
- Model S MCU1 sleep issues HOT 16
- Battery Health - LFP - Status: 500. Message: convert frame from rows error: pq: division by zero HOT 4
- Has edge been updated? HOT 3
- TZ environment variable name confusion HOT 22
- Error on QNAP TS-231P3 HOT 1
- Extend version with more build info HOT 5
- Some address could not be displayed HOT 1
- Battery Health not showing on new cars? HOT 1
- CI: update upload-artifact action HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teslamate.