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 into MTC-compatible format
- Checks for duplicate submissions using charging session IDs
- Submits reimbursement claims with required documentation
- Handles session management and authentication for both APIs
- Clone this repository
- Copy
.env.example
to.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)
https://tesla-info.com/tesla-token.php
- Duplicate Detection: Uses charging session IDs in the comment field to prevent duplicate submissions
- Dry Run Mode: Test the system without making actual submissions
The system includes error handling:
- Checks for API-level errors in responses
- Validates submissions before processing
- Only processes supercharging sessions
- Currently supports Netherlands-based submissions (But does not check for it, my lease company does not mind the country in the submission)
If you encounter issues:
- Check your
.env
configuration - Verify your MTC credentials
- Ensure your Tesla refresh token is valid
- Review logs for detailed error messages
- Try running in DRY mode first