TeslaMate

Importujte data o jízdě a nabíjení z aplikace TeslaMate.

Export z běžné instalace nástroje Docker

V shellu přejděte do adresáře TeslaMate a spusťte tento jednořádkový příkaz:

docker-compose exec -T database psql -U $(docker-compose exec -T database env | grep POSTGRES_USER | cut -d"=" -f2) -d $(docker-compose exec -T database env | grep POSTGRES_DB | cut -d"=" -f2) -c "\copy (WITH positiondata AS(SELECT cars.vin, positions.date, positions.latitude, positions.longitude, positions.speed, positions.power, positions.odometer, positions.ideal_battery_range_km, positions.battery_level, positions.outside_temp, positions.is_climate_on, positions.inside_temp, positions.rated_battery_range_km, positions.usable_battery_level, NULL :: NUMERIC AS charge_energy_added, NULL :: NUMERIC AS charger_actual_current, NULL :: NUMERIC AS charger_phases, NULL :: NUMERIC AS charger_pilot_current, NULL :: NUMERIC AS charger_power, NULL :: NUMERIC AS charger_voltage, NULL :: BOOLEAN AS fast_charger_present, NULL AS conn_charge_cable, NULL AS fast_charger_brand, NULL AS fast_charger_type, ( SELECT B.version FROM updates B WHERE B.end_date <= positions.date AND B.car_id = positions.car_id ORDER BY B.end_date DESC LIMIT 1) AS version, Row_number() over ( PARTITION BY positions.car_id, (Cast(Extract(epoch FROM positions.date) AS INTEGER) / 10) ORDER BY positions.DATE ASC) AS rn FROM positions inner join cars ON cars.id = positions.car_id), chargingdata AS (SELECT cars.vin, charges.date, positions.latitude, positions.longitude, NULL :: SMALLINT AS speed, NULL :: SMALLINT AS power, NULL :: SMALLINT AS odometer, charges.ideal_battery_range_km, charges.battery_level, charges.outside_temp, NULL :: BOOLEAN AS is_climate_on, NULL :: NUMERIC AS inside_temp, charges.rated_battery_range_km, charges.usable_battery_level, charges.charge_energy_added, charges.charger_actual_current, charges.charger_phases, charges.charger_pilot_current, charges.charger_power, charges.charger_voltage, charges.fast_charger_present, charges.conn_charge_cable, charges.fast_charger_brand, charges.fast_charger_type, ( SELECT B.version FROM updates B WHERE B.end_date <= charges.date AND B.car_id = positions.car_id ORDER BY B.end_date DESC LIMIT 1 ) AS version, Row_number() over ( PARTITION BY charges.charging_process_id, (Cast(Extract( epoch FROM charges.date) AS INTEGER) / 10) ORDER BY charges.date ASC) AS rn FROM charges inner join charging_processes ON charging_processes.id = charges.charging_process_id inner join cars ON cars.id = charging_processes.car_id inner join positions ON positions.id = charging_processes.position_id) SELECT vin, date, latitude, longitude, speed, power, odometer, ideal_battery_range_km, battery_level, inside_temp, outside_temp, is_climate_on, rated_battery_range_km, usable_battery_level, charge_energy_added, charger_actual_current, charger_phases, charger_pilot_current, charger_power, charger_voltage, fast_charger_present, conn_charge_cable, fast_charger_brand, fast_charger_type, version FROM positiondata WHERE rn = 1 UNION SELECT vin, date, latitude, longitude, speed, power, odometer, ideal_battery_range_km, battery_level, inside_temp, outside_temp, is_climate_on, rated_battery_range_km, usable_battery_level, charge_energy_added, charger_actual_current, charger_phases, charger_pilot_current, charger_power, charger_voltage, fast_charger_present, conn_charge_cable, fast_charger_brand, fast_charger_type, version FROM chargingdata WHERE rn = 1 ORDER BY DATE ASC) TO 'teslamate.csv' csv header" && docker-compose exec -T database cat teslamate.csv > teslamate.csv && tail -n +2 teslamate.csv | split -d -l 1000000 - teslamate-export- && for file in teslamate-export-*; do head -n 1 teslamate.csv > tmp_file && cat "$file" >> tmp_file && mv -f tmp_file "$file.csv" && gzip "$file.csv" && rm "$file"; done

Export z ruční instalace bez nástroje Docker

V shellu spusťte tento jednořádkový příkaz a nahraďte jej svým uživatelským jménem a názvem databáze:

psql -U YOUR_USER_NAME -d YOUR_DB_NAME -W -c "\copy (WITH positiondata AS(SELECT cars.vin, positions.date, positions.latitude, positions.longitude, positions.speed, positions.power, positions.odometer, positions.ideal_battery_range_km, positions.battery_level, positions.outside_temp, positions.is_climate_on, positions.inside_temp, positions.rated_battery_range_km, positions.usable_battery_level, NULL :: NUMERIC AS charge_energy_added, NULL :: NUMERIC AS charger_actual_current, NULL :: NUMERIC AS charger_phases, NULL :: NUMERIC AS charger_pilot_current, NULL :: NUMERIC AS charger_power, NULL :: NUMERIC AS charger_voltage, NULL :: BOOLEAN AS fast_charger_present, NULL AS conn_charge_cable, NULL AS fast_charger_brand, NULL AS fast_charger_type, ( SELECT B.version FROM updates B WHERE B.end_date <= positions.date AND B.car_id = positions.car_id ORDER BY B.end_date DESC LIMIT 1) AS version, Row_number() over ( PARTITION BY positions.car_id, (Cast(Extract(epoch FROM positions.date) AS INTEGER) / 10) ORDER BY positions.DATE ASC) AS rn FROM positions inner join cars ON cars.id = positions.car_id), chargingdata AS (SELECT cars.vin, charges.date, positions.latitude, positions.longitude, NULL :: SMALLINT AS speed, NULL :: SMALLINT AS power, NULL :: SMALLINT AS odometer, charges.ideal_battery_range_km, charges.battery_level, charges.outside_temp, NULL :: BOOLEAN AS is_climate_on, NULL :: NUMERIC AS inside_temp, charges.rated_battery_range_km, charges.usable_battery_level, charges.charge_energy_added, charges.charger_actual_current, charges.charger_phases, charges.charger_pilot_current, charges.charger_power, charges.charger_voltage, charges.fast_charger_present, charges.conn_charge_cable, charges.fast_charger_brand, charges.fast_charger_type, ( SELECT B.version FROM updates B WHERE B.end_date <= charges.date AND B.car_id = positions.car_id ORDER BY B.end_date DESC LIMIT 1 ) AS version, Row_number() over ( PARTITION BY charges.charging_process_id, (Cast(Extract( epoch FROM charges.date) AS INTEGER) / 10) ORDER BY charges.date ASC) AS rn FROM charges inner join charging_processes ON charging_processes.id = charges.charging_process_id inner join cars ON cars.id = charging_processes.car_id inner join positions ON positions.id = charging_processes.position_id) SELECT vin, date, latitude, longitude, speed, power, odometer, ideal_battery_range_km, battery_level, inside_temp, outside_temp, is_climate_on, rated_battery_range_km, usable_battery_level, charge_energy_added, charger_actual_current, charger_phases, charger_pilot_current, charger_power, charger_voltage, fast_charger_present, conn_charge_cable, fast_charger_brand, fast_charger_type, version FROM positiondata WHERE rn = 1 UNION SELECT vin, date, latitude, longitude, speed, power, odometer, ideal_battery_range_km, battery_level, inside_temp, outside_temp, is_climate_on, rated_battery_range_km, usable_battery_level, charge_energy_added, charger_actual_current, charger_phases, charger_pilot_current, charger_power, charger_voltage, fast_charger_present, conn_charge_cable, fast_charger_brand, fast_charger_type, version FROM chargingdata WHERE rn = 1 ORDER BY DATE ASC) TO 'teslamate.csv' csv header" && tail -n +2 teslamate.csv | split -d -l 1000000 - teslamate-export- && for file in teslamate-export-*; do head -n 1 teslamate.csv > tmp_file && cat "$file" >> tmp_file && mv -f tmp_file "$file.csv" && gzip "$file.csv" && rm "$file"; done

Tip: Chcete-li tento příkaz spustit v systému Unraid, navštivte nejprve nástroj Docker v ovládacím panelu Unraid, vyberte kontejner postgresql a vyberte možnost Console.

Import do aplikace Tessie

Navštivte tuto stránku, klikněte na Importovat TeslaMate Export a vyberte teslamate-export-00.csv.gz.

A je to! Tessie zpracuje všechny vaše údaje a po dokončení obdržíte e-mail. V závislosti na délce historie vašeho vozidla může tento proces trvat několik hodin.

Pokud existují další exportní soubory, například teslamate-export-01.csv.gz, importujte všechny tyto soubory v pořadí.

Potřebujete další pomoc? Kontaktujte nás na adrese support@tessie.com support@tessie.com