No description
Find a file
2025-10-15 16:52:53 +02:00
.env.example Initial commit 2025-10-15 10:59:57 +02:00
README.md Initial commit 2025-10-15 10:59:57 +02:00
requirements.txt Initial commit 2025-10-15 10:59:57 +02:00
run.sh Initial commit 2025-10-15 10:59:57 +02:00
smartcar_client.py Update smartcar_client.py 2025-10-15 16:52:53 +02:00

SmartCar BMW Integration

A Python program that connects to the SmartCar API to link your BMW account and retrieve vehicle data.

Prerequisites

  1. BMW ConnectedDrive Account: Make sure your BMW is connected to BMW ConnectedDrive
  2. SmartCar Account: Sign up at https://dashboard.smartcar.com/
  3. Compatible BMW Vehicle: Check if your BMW model supports SmartCar integration

Setup

  1. Clone or download this project

  2. Create a virtual environment (recommended):

    python3 -m venv smartcar_env
    source smartcar_env/bin/activate  # On Windows: smartcar_env\\Scripts\\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Get SmartCar API credentials:

  5. Configure environment variables:

    cp .env.example .env
    

    Edit .env and 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:

  1. Open your browser to authorize with SmartCar
  2. Guide you through linking your BMW account
  3. Retrieve your vehicle list
  4. 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 .env file with real credentials
  • The .env file 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