I’m excited to share a new custom component I’ve developed for Home Assistant: Spritmonitor Vehicle Data Integration!
If you use Spritmonitor.de to track your vehicle’s fuel consumption, costs, and service records, this integration is for you. It brings all that valuable data directly into Home Assistant, allowing you to monitor your vehicle’s stats alongside your other smart home devices.
What it does:
This component creates various sensors in Home Assistant for your vehicle data from Spritmonitor, including:
Vehicle Info: Make, model, license plate, tank capacity.
Fuel & Consumption: Total distance, total fuel consumed, average consumption (km/L), and detailed data from your last refueling (date, quantity, total cost in UYU, price per liter, odometer, trip, consumption).
Maintenance Reminders: Next service mileage, date, and any notes.
Estimates: Estimated current fuel level and remaining range.
Spritmonitor Ranking: Your vehicle’s rank and average consumption compared to others on Spritmonitor.
Installation:
The easiest way to install is via HACS (Home Assistant Community Store):
Open HACS → Integrations.
Click the “…” (top right) → “Custom repositories”.
Add https://github.com/matbott/home_assistant_Spritmonitor with category “Integration”.
Search for “Spritmonitor” in HACS and install.
Restart Home Assistant.
Configuration:
After restarting HA, go to “Settings” → “Devices & Services” → “Add Integration”, search for “Spritmonitor”, and enter your Spritmonitor Vehicle ID, Application-ID, and Bearer Token (you’ll need to obtain these from Spritmonitor’s API).
Based on the discussion with spritmonitor.de while im created the Rest Sensor they wish that not everyone request the App-Token individually instead everyone should use the already published one.
@Spritmonitor: Maybe you can reply here how to proceed.
APP_TOKEN Spritmonitor assigned meanwhile an dedicated APP-Token, so you can use it directly. No individual request needed anymore. App-Token: 190e3b1080a39777f369a4e9875df3d7
Hi, thanks for the comment. I’m actually using the public token I found in your post. But during the integration, the startup form requests both the application token and the user-generated one. In any case, I’m waiting for @Spritmonitor response.
Usually you don’t need to contact the Team “spritmonitor.de”, the App-Token is public and the Bearer you can create by your own within your account.
How to:
Log in to your account / (or go to “your account”) → Click on “Change Password” → and below you should see the option “create new token”
This will be your Bearer Token.
Yes, thank you. That’s what I did following your post. The integration currently generates the sensors in Spanish; I’m working on the translations. Regards
Thanks @spritmonitor, I’ve documented the token in the integration readme.
I’d like to let you know that version 1.3.0 is now available with the sensors in English for greater language versatility. I’ll have to see if I have time to dedicate to the translations. I also fixed a next service date sensor that was giving me an error. Regards.
Great, thank you! Perhaps you could also hard code the app token into the script and don’t have the users enter it. I think this would make the configuration even easier and the app token will never change in the future.
Thank you. I implemented a new form where the token is pre-filled, but I allow the option to change it, and a refresh time range of 1 to 24 hours. Thanks for the response. @Spritmonitor
I can contribute with Portuguese translation and some suggestions…
A big improve (for me) was the possibility to add an new charge/refuel from HomeAssistant to Spritmonitor. I have a eletric car, and I charge it few times in a week. Always I have to manually enter the data on spritmonitor, more than 500 entries in 3 years.
On HA I have all the required information needed:
vehicleId / tankId / fuelsortid / quantityunitid : From your integration
odometer : From my car (renault integration)
trip : calc from actually odometer and last fuelling odometer
quantity : from power meter on AC Plug
type : full if car integration percentage are 100% or notfull on others
price : maybe an input number
pricetype : 1 - unit / liter price (in the case of electrics,it’s price per kwh)
percent : From car integration
Your integration don’t distinguish the Units. Are all display as Liter. It’s ok for my diesel car, but not good for the Eletric. There are the value quantityunitid with the correct unit to use:
Hi, thanks for your feedback. It’s true I didn’t consider the electric car issue. I stumbled upon that error a week ago. I didn’t see your message until today. In a few weeks, I’ll be looking into improving the code to accommodate electric car charging. Welcome to the code review! Best regards, I’ll be posting here.
Release 3.0 - Electric Vehicle Support & Full Customization!
This is the biggest update to the Spritmonitor integration to date! Version 3.0 has been largely rewritten from the ground up to be more powerful, flexible, and compatible than ever before. It introduces full support for electric vehicles and complete customization through the UI.
VERY IMPORTANT NOTE FOR EXISTING USERS
Due to a deep internal restructuring, this update introduces breaking changes. For everything to work correctly, it is REQUIRED that you delete your existing Spritmonitor integration from Home Assistant and add it back from scratch. This will ensure that the new entities and configurations are created correctly.
Major New Features
Electric Vehicle (EV) Support
The integration is now fully compatible with electric cars. When you configure your vehicle as “Electric”, specific sensors will be created, such as:
Battery Capacity (kWh)
Total Energy Charged
Energy Consumption (kWh/100km)
Cost per kWh
And a new calculated sensor: Full Battery Range Estimate.
100% Customizable Configuration
When adding the integration, you can now configure everything from the Home Assistant UI, with no YAML editing required:
Vehicle Type: Choose between Combustion or Electric.
Currency: Define your local currency symbol (e.g., USD, €, UYU).
Distance Units: km or mi.
Volume Units: L or gal.
Complete & Smart Sensor Set
The full list of over 30 sensors from the original version has been restored and verified to ensure no functionality is lost.
New useful calculated sensors have been added, such as Cost per Distance (e.g., USD/km), which works for both combustion and electric vehicles.
Multi-language Support
The configuration interface and sensor names have been fully translated into:
English
Spanish
Polish
Portuguese
Improvements and Fixes
Entity Grouping Fixed: The issue that caused sensors to appear “loose” or ungrouped has been definitively fixed. All entities are now correctly grouped under a single device per vehicle.
Vehicle Image Restored: The vehicle’s image is now correctly displayed on the “Brand and Model” sensor.
Refactored Codebase: The code has been cleaned up and modernized for better performance and future maintenance.
Acknowledgements
A special thank you to the community users who have contributed translations and helped report bugs to make this version possible.
This is a milestone release, bringing full and detailed support for Plug-in Hybrid Electric Vehicles (PHEVs)! This version introduces a completely refactored data-fetching core that correctly handles multiple fuel types. Owners of PHEVs will now get a complete picture of both their fuel and electric consumption, with dedicated sensors for each.
New Features & Enhancements
Complete PHEV Experience
When you configure your vehicle as a “PHEV” in the integration setup, it will now automatically create both sets of sensors:
Fuel Sensors: A full suite of sensors for your gasoline/diesel usage, including Fuel Capacity, Average Consumption (e.g., L/100km), Last Refuel details, and more.
Electric Sensors: A full suite of sensors for your electric usage, including Battery Capacity, Average Energy Consumption (kWh/100km), Last Charge details, and more.
Dual Calculated Sensors: Most calculated sensors (like Consumption Trend, Cost per Distance, and Eco Driving Index) are now created for both fuel types separately (e.g., “Cost per Distance (Fuel)” and “Cost per Distance (Electric)”), giving you precise insights into each aspect of your vehicle’s performance.
Bug Fixes & Stability Improvements
Corrected Fueling API Endpoint: The core method for fetching fueling data has been fixed to use the correct, official Spritmonitor API endpoint. This dramatically improves the reliability and accuracy of data fetching for all vehicle types.
Improved Pure EV Data Handling: The logic for pure electric vehicles has been strengthened, resolving bugs where sensors could show incorrect units or an unknown state.
Fixed Setup Crashes: Resolved several critical bugs (NameError, TypeError, IndentationError) that could cause the integration to fail during setup or after a Home Assistant restart.
Note for New PHEV Users
Please note: Calculated sensors (like ‘Consumption Trend’ or ‘Cost per Distance’) need at least 2-3 data points for each fuel type (both gasoline and electric) in your Spritmonitor history before they can display a value.