This custom integration allows you to monitor your AutoPi vehicle tracking devices through Home Assistant. AutoPi combines OBD-II diagnostic data with GPS tracking to provide comprehensive vehicle monitoring and analytics.
-
🚗 Vehicle Diagnostic Data
- Engine parameters (RPM, coolant temperature, intake air temperature)
- Fuel system status and consumption
- Vehicle speed and odometer readings
- Engine load and throttle position
- Battery voltage and electrical system health
- Diagnostic trouble codes (DTCs)
- Emissions data (O2 sensor readings, catalyst efficiency)
-
📍 GPS Tracking & Location
- Real-time vehicle location
- Trip tracking and history
- Geofencing capabilities
- Speed monitoring and alerts
- Route optimization data
-
🔄 Automatic Device Discovery - Automatically discovers all AutoPi devices in your account
-
⚙️ Flexible Configuration
- Select specific vehicles to monitor or monitor all
- Configurable update interval (default: 5 minutes for real-time vehicle data)
- Auto-discovery can be enabled/disabled
- Configurable discovery interval for new devices
-
📊 Real-time Updates - Fetches latest vehicle data at your configured interval
-
🏢 Multi-Vehicle Support - Monitors multiple vehicles across your AutoPi account
-
📱 Device-Centric Design - Each AutoPi device is registered as a device with its metrics as entities
This integration follows Home Assistant best practices:
- Devices: Each physical AutoPi device/vehicle is registered as a device in Home Assistant
- Entities: Each metric from a vehicle (speed, RPM, location, etc.) is a separate entity
- This allows you to:
- Assign vehicles to different areas/zones
- View all metrics from a vehicle in one place
- Create automations based on specific vehicle conditions
- Disable individual metrics you don't need
- Home Assistant 2024.1.0 or newer
- AutoPi account with API access
- At least one AutoPi device installed in a vehicle
- Open HACS in your Home Assistant instance
- Click on "Integrations"
- Click the three dots in the top right corner and select "Custom repositories"
- Add
https://github.com/rknightion/autopi-haas a custom repository - Select "Integration" as the category
- Click "Add"
- Search for "AutoPi" and install it
- Restart Home Assistant
- Download the latest release from the releases page
- Extract the
custom_components/autopifolder to your Home Assistant'scustom_componentsdirectory - Restart Home Assistant
- Log in to your AutoPi Cloud
- Navigate to your account settings
- Go to "API Access" or "Developer Settings"
- Generate a new API key or use an existing one
- Go to Settings → Devices & Services in Home Assistant
- Click "Add Integration"
- Search for "AutoPi"
- Enter your API key when prompted
- Select your vehicles from the dropdown or leave empty to monitor all
- Configure update interval and auto-discovery settings
After setup, you can modify options by clicking "Configure" on the integration:
- Update Interval: How often to fetch vehicle data (minimum 60 seconds, default 300 seconds/5 minutes)
- Enable Auto-Discovery: Automatically discover and add new AutoPi devices
- Device Discovery Interval: How often to scan for new devices when auto-discovery is enabled
📚 Full Documentation - Comprehensive guides, API reference, and troubleshooting
- OBD-II Diagnostic Data
- Engine RPM, speed, throttle position
- Coolant temperature, intake air temperature
- Fuel system status, fuel consumption
- Battery voltage, engine load
- Diagnostic trouble codes (DTCs)
- GPS & Location Data
- Real-time coordinates, altitude
- Trip data, mileage tracking
- Speed monitoring
- Device Health & Status
- AutoPi device connectivity
- Signal strength, power status
- Advanced trip analytics
- Predictive maintenance alerts
- Fleet management features
Entities are created with the following naming pattern:
sensor.{vehicle_name}_{data_type}binary_sensor.{vehicle_name}_{status_type}device_tracker.{vehicle_name}
For example:
sensor.my_car_rpmsensor.my_car_coolant_temperaturesensor.my_car_fuel_leveldevice_tracker.my_carbinary_sensor.my_car_engine_running
Each sensor entity includes the following attributes:
device_id: AutoPi device IDvehicle_id: Vehicle identifierlast_updated: Timestamp of last data readingunit_system: Imperial or metric units
automation:
- alias: "Low Fuel Alert"
trigger:
- platform: numeric_state
entity_id: sensor.my_car_fuel_level
below: 10
action:
- service: notify.mobile_app
data:
title: "Low Fuel Warning!"
message: "Your car fuel level is below 10%"
- alias: "Vehicle Started"
trigger:
- platform: state
entity_id: binary_sensor.my_car_engine_running
to: "on"
action:
- service: notify.mobile_app
data:
title: "Vehicle Started"
message: "Your car engine has been started"type: entities
title: Vehicle Status
entities:
- entity: sensor.my_car_rpm
name: Engine RPM
- entity: sensor.my_car_coolant_temperature
name: Coolant Temp
- entity: sensor.my_car_fuel_level
name: Fuel Level
- entity: binary_sensor.my_car_engine_running
name: Engine Status
- entity: device_tracker.my_car
name: LocationTo enable debug logging for this integration, add the following to your configuration.yaml:
logger:
default: warning
logs:
custom_components.autopi: debugThis will show detailed information about:
- Device discovery
- API calls and responses
- Entity creation
- Update intervals
- Any errors or warnings
- Verify your API key has access to your AutoPi account
- Check that you have AutoPi devices registered to your account
- Ensure the devices are online and reporting data
- Check debug logs for specific error messages
- Regenerate your API key in the AutoPi Cloud
- Remove and re-add the integration with the new key
- Some vehicles don't support all OBD-II parameters
- Check the vehicle compatibility in AutoPi Cloud
- Verify the device has been reporting data recently
- Enable debug logging to see what metrics are being received
- AutoPi devices may have varying update frequencies based on configuration
- Check your configured update interval in the integration options
- Note that more frequent polling won't get newer data if the devices haven't updated
For development and testing:
-
Clone the repository
git clone https://github.com/rknightion/autopi-ha.git cd autopi-ha -
Set up development environment
# Install UV if you haven't already curl -LsSf https://astral.sh/uv/install.sh | sh # Install dependencies uv sync # Install pre-commit hooks uv run pre-commit install
-
Run tests
uv run pytest
-
Test in Home Assistant
- Copy the
custom_components/autopifolder to your Home Assistant config directory - Restart Home Assistant
- Add the integration through the UI
- Monitor logs for any issues
- Copy the
-
Validate with hassfest
uv run python -m script.hassfest
For development setup and guidelines, see CONTRIBUTING.md.
# Clone the repository
git clone https://github.com/rknightion/autopi-ha.git
cd autopi-ha
# Install UV if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Set up development environment
uv sync
uv run pre-commit install
# Run tests
uv run pytest
# Run linters and formatting
uv run ruff check custom_components tests
uv run ruff format custom_components testsWe welcome contributions! Please see our Development Guide for detailed information on setting up your development environment and contributing to the project.
- Fork the repository
- Create a feature branch
- Follow the guidelines in docs/development.md
- Submit a pull request
For detailed instructions, see docs/development.md.
This project is licensed under the MIT License - see the LICENSE file for details.
This integration is not affiliated with, endorsed by, or sponsored by AutoPi.io ApS. All product and company names are trademarks or registered trademarks of their respective holders.
