Skip to content

tube0013/Smartcar-HA

Repository files navigation

Smartcar Integration for Home Assistant

hacs_badge Version Downloads Build

Connect your compatible vehicle to Home Assistant using the Smartcar API.

This integration provides various sensors and controls for vehicles linked through the Smartcar platform, allowing you to monitor and interact with your car directly within Home Assistant.

Note: This integration relies on the Smartcar service. Availability of specific features depends on your vehicle's make, model, year, your Smartcar account plan (especially API rate limits), and the permissions granted during authentication.

Example Device Page Screenshot

Example showing entities for a Volkswagen ID.4

Features

Provides the following entities for each connected vehicle (subject to vehicle compatibility and granted permissions):

  • Device Tracker:
    • Location (GPS)
  • Sensors:
    • Odometer
    • Battery Level (percentage)
    • Estimated Range
    • Battery Capacity (kWh)
    • Charging Status (Charging, Not Charging, Fully Charged)
    • Engine Oil Life (percentage) (if supported)
    • Tire Pressures (if supported)
    • Fuel Level / Range (if supported)
  • Binary Sensors:
    • Charging Cable Plugged In
  • Switches:
    • Start/Stop Charging
  • Number:
    • Set Charge Limit (percentage)
  • Locks:
    • Door Lock/Unlock (note: known compatibility issues with some models, e.g., VW ID.4 2023+ does not have this functionality)

Prerequisites

  1. Compatible Vehicle: Your car must be compatible with Smartcar and the API must also be supported in your country.
  2. Smartcar Developer Account: You need a free developer account from Smartcar.
  3. Ensure a Smartcar Application exists:
    • In the dashboard, go to "Applications" and ensure an application was automatically created for you.
    • Rename your application if you want to (e.g., "Home Assistant Connect").

Installation

Recommended: HACS

  1. Ensure HACS (Home Assistant Community Store) is installed.
  2. Go to HACS -> Integrations -> Click the three dots (⋮) in the top right -> Custom Repositories.
  3. Enter the URL of this GitHub repository, https://github.com/tube0013/Smartcar-HA, in the "Repository" field.
  4. Select "Integration" as the category.
  5. Click "Add".
  6. The "Smartcar" integration should now appear in the HACS list. Click on it and then click "Download".
  7. Confirm the download.
  8. Restart Home Assistant (Settings -> System -> Restart).

Manual Installation

  1. Download the latest release source code archive (.zip or .tar.gz).
  2. Unpack the archive.
  3. Copy the custom_components/smartcar/ directory into your Home Assistant <config>/custom_components/ directory. Create custom_components if it doesn't exist.
  4. Restart Home Assistant (Settings -> System -> Restart).

Setup

Configuration is done via the Home Assistant UI after installation.

  1. Navigate to "Settings" → "Devices & Services"
  2. Click "+ Add Integration"
  3. Search for and select → "Smartcar"

Or you can use the My Home Assistant Button below.

Add Integration

Follow the instructions to configure the integration.

Configuration Flow

Authorization Data Entry

  1. Choose a name for your credentials and enter the Client ID and Client Secret which can be found in the Smartcar dashboard.

  2. Crucially, set the "Redirect URIs" in the Smartcar settings for your application. You need to add exactly the URI your Home Assistant instance uses for OAuth callbacks.

    • Most users will simply use the My Home Assistant URI: https://my.home-assistant.io/redirect/oauth

      Note: This is not a placeholder. It is the URI that must be used unless you’ve disabled or removed the default_config: line from your configuration and disabled the My Home Assistant Integration.

    • Add only the correct URI for your setup.
  3. Continue to the next step.

  4. Select the Permissions you want Home Assistant to be able to access. To enable all entities in this integration, select all relevant permissions:

    • Get total distance traveled
    • Get the vehicle's location
    • Get EV/PHEV battery level, capacity & current range
    • Get details on whether the car is plugged in and charging
    • Get details on whether doors, windows & more are enabled
    • Get engine oil health*
    • Get tire pressure details*
    • Get fuel tank level*
    • Control charging (start/stop & target charge)
    • Lock or unlock vehicle

    * These may not work depending on car support

  5. Continue to the next section which explains the steps to authorize your vehicle via Smartcar connect.

Authorization via Smartcar Connect

  1. You will be redirected to the Smartcar website (or a new tab will open).
  2. Log in using the credentials for your vehicle's connected services account (e.g., your Volkswagen ID, FordPass account, Tesla account), NOT your Smartcar developer account credentials.
  3. Review the permissions requested by Home Assistant (these should match the scopes you selected when creating the Smartcar application).
  4. Grant access to allow Home Assistant to connect to your vehicle(s) via Smartcar.
  5. You should be redirected back to Home Assistant.

Setup Complete

If successful, the integration will be added, and Home Assistant will create devices and entities for your connected vehicle(s). From here:

Rate Limits & Polling

  • Smartcar's free developer tier typically has a limit of 500 API calls per vehicle per month. Exceeding this may incur costs or stop the integration from working.
  • By default, it uses 6 hour polling interval and only fetches data required for enabled entities.
  • Polling can be customized as well.

Customized Polling

To customize polling, you can disable polling on the integration and write your own automation.

  • First, configure the integration as described above.
  • Go to SettingsIntegartions (under Devices & services) → Smartcar
  • Click the three dots to the right of the integration.
  • Choose System options.
  • Disable Enable polling for changes and then click Save.
  • Create an automation using homeassistant.update_entity to refresh the desired value(s). Examples are provided:

Known Issues / Limitations

  • Vehicle Compatibility: Not all features are supported by all vehicle makes/models/years via the Smartcar API. Entities for unsupported features (e.g., Lock control for VW ID.4 2023+) may or may not be created. Check the Smartcar compatibility details for your specific vehicle.
  • API Latency: There can be significant delays (seconds to minutes) between sending a command (e.g., start charging) and the vehicle executing/reporting the change back through the API. The state in Home Assistant will update after the next successful data poll.
  • Rate Limits: Be mindful of the 500 calls/vehicle/month limit on the free tier.

Support / Issues

Please report any issues you find with this integration by opening an issue on the GitHub Issues page.

About

Smartcar Integration for Home Assistant

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published