No description
| .env.example | ||
| README.md | ||
| requirements.txt | ||
| run.sh | ||
| smartcar_client.py | ||
SmartCar BMW Integration
A Python program that connects to the SmartCar API to link your BMW account and retrieve vehicle data.
Prerequisites
- BMW ConnectedDrive Account: Make sure your BMW is connected to BMW ConnectedDrive
- SmartCar Account: Sign up at https://dashboard.smartcar.com/
- Compatible BMW Vehicle: Check if your BMW model supports SmartCar integration
Setup
-
Clone or download this project
-
Create a virtual environment (recommended):
python3 -m venv smartcar_env source smartcar_env/bin/activate # On Windows: smartcar_env\\Scripts\\activate -
Install dependencies:
pip install -r requirements.txt -
Get SmartCar API credentials:
- Go to https://dashboard.smartcar.com/
- Sign up/Login to your account
- Create a new application
- Copy the Client ID and Client Secret
-
Configure environment variables:
cp .env.example .envEdit
.envand add your credentials:SMARTCAR_CLIENT_ID=your_client_id_here SMARTCAR_CLIENT_SECRET=your_client_secret_here
Usage
Run the program:
python smartcar_client.py
The program will:
- Open your browser to authorize with SmartCar
- Guide you through linking your BMW account
- Retrieve your vehicle list
- Display vehicle information and data
What You Can Retrieve
The program retrieves the following BMW vehicle data:
- Vehicle information (make, model, year)
- VIN (Vehicle Identification Number)
- Odometer reading
- Location (if available)
- Battery status (for electric BMWs)
- Charge status (for electric BMWs)
BMW-Specific Notes
- Make sure your BMW is connected to ConnectedDrive
- Some features may require specific BMW models or ConnectedDrive subscriptions
- Location data may not be available for all vehicles
- Electric vehicle features (battery/charge) only work with compatible BMW electric models
Troubleshooting
No vehicles found:
- Verify your BMW is connected to ConnectedDrive
- Check that your vehicle supports SmartCar integration
- Ensure your vehicle is registered in your ConnectedDrive account
Authorization fails:
- Double-check your SmartCar Client ID and Secret
- Make sure your SmartCar application is approved for BMW
- Verify your ConnectedDrive credentials are correct
Location/battery data unavailable:
- Some features require specific BMW models or subscriptions
- Check if your vehicle supports these features
Security Note
- Never commit your
.envfile with real credentials - The
.envfile is already included in.gitignore - Use test credentials when possible
Support
For issues with:
- SmartCar API: Check SmartCar documentation
- BMW ConnectedDrive: Contact BMW support
- This program: Check the troubleshooting section above