Automatically submit Tesla charging sessions to MultiTankCard (MTC) for reimbursement. This tool integrates with both Tesla's API to fetch your charging sessions and MTC's reimbursement system to automate the submission process.
Never commit your .env file or share your:
- Tesla refresh token/credentials
- MTC credentials
- IBAN number
- Vehicle VIN
- Fetches recent charging sessions from your Tesla account.
- Processes charging data, handling both Dutch and supported foreign country invoices.
- Checks for duplicate submissions in your MTC history to prevent re-submitting.
- For unknown countries, it prompts you to decide whether to submit as a Dutch invoice or skip.
- Submits reimbursement claims with the required invoice PDF attached.
-
Clone this repository
-
Copy
.env.exampleto.env -
Fill in your credentials and preferences in
.env -
Install required packages:
pip install -r requirements.txt sudo apt install poppler-utils
TESLA_VIN: Your Tesla vehicle identification numberTESLA_REFRESH_TOKEN: Tesla API refresh token (see below)IBAN: Your bank account number for reimbursement payoutsMTC_USERNAME: MTC platform usernameMTC_PASSWORD: MTC platform passwordMODE: Set to 'DRY' for testing (no actual submissions, anything !DRY will actually submit)
LOG_LEVEL: App logging level (default: INFO)MAX_SESSIONS: Number of recent charging sessions to process (default: 1)DEVICE_COUNTRY: Country code (default: NL)DEVICE_LANGUAGE: Language code (default: nl)TTP_LOCALE: Locale setting (default: nl_NL)UNKNOWN_COUNTRY_ACTION: How to handle invoices from unknown countries. UseSKIPfor automated/NAS environments,PROMPTfor interactive, orDUTCHto force as local (default: PROMPT).
This tool automatically skips charging sessions billed in currencies other than Euros (EUR) (e.g., GBP in the UK). Because MTC processes all claims as EUR, submitting foreign currencies leads to incorrect payouts. These invoices must be converted and declared manually.
https://tesla-info.com/tesla-token.php
- Duplicate Detection: Automatically checks both the
ClaimNote(Toelichting) andNote(Notities) fields in your MTC transaction history for the Tesla charging session ID to prevent duplicate submissions. (Tip: If you manually declare an invoice, paste the Tesla Session ID into the MTC Note field to ensure the script ignores it!). - Manual Override (Skip List): Create a
skip.txtfile in the root directory and paste the TeslachargeSessionIds you want to ignore (one per line). The script will bypass them. - Foreign Currency Handling: Automatically detects and skips foreign currency invoices (e.g., GBP) to prevent incorrect EUR payouts, prompting you to declare them manually.
- Dry Run Mode: Test the system and view planned submissions without actually sending claims to MTC (set
MODE=DRYin your.env).
The system includes error handling:
- Checks for API-level errors in responses
- Validates submissions before processing
If you encounter issues:
- Check your
.envconfiguration - Verify your MTC credentials
- Ensure your Tesla refresh token is valid
- Review logs for detailed error messages
- Try running in DRY mode first
