2026-08-18
RAV4 Mileage Logging to Google Sheets
Replaced a fragile local CSV log with a Home Assistant automation that appends RAV4 daily mileage to Google Sheets — accessible from any device and backed up by Google.
- Home Assistant
- Toyota
- Automation
- Google Sheets
- Self-Hosting
RAV4 Mileage Logging to Google Sheets
My 2025 RAV4 Hybrid is integrated into Home Assistant through the ha-toyota-na custom integration. One of the sensors it exposes is sensor.rav4_daily_km — the odometer delta for the day — along with the running sensor.rav4_odometer total. The question was never whether I could capture that data, but where it should live so it actually stays useful.
Background
For a few months I logged the daily delta to a local CSV file using a shell command triggered by a nightly automation inside the HAOS VM on Proxmox. It worked as a proof of concept, but the file sat inside the VM with no backup strategy, no way to view it from another device, and sharing it meant manually copying it out. Fine for proving the automation fired — not fine for data I actually want to keep.
The fix
Home Assistant’s Google Sheets integration appends rows to a spreadsheet via a service call. Setup is OAuth-based: authorize HA to write to your Google account, pick a target sheet, and it’s ready. The integration has been stable since it was added in 2022.11.
The one gotcha is the config_entry field in the service call — you have to grab the integration’s entry ID from the HA developer tools, not from the integration page itself. Store that ID in secrets.yaml rather than hardcoding it, so the automation stays portable if you ever recreate the integration.
The automation
alias: Log RAV4 daily KM to Google Sheets
description: Fires at 11:55 PM and appends a row to the mileage sheet
trigger:
- platform: time
at: "23:55:00"
condition: []
action:
- service: google_sheets.append_sheet
data:
config_entry: !secret google_sheets_config_entry
data:
Date: "{{ now().strftime('%Y-%m-%d') }}"
Daily KM: "{{ states('sensor.rav4_daily_km') | float | round(1) }}"
Odometer: "{{ states('sensor.rav4_odometer') | float | round(0) }}"
mode: single
It fires at 11:55 PM, grabs the day’s values, and appends a row. The sheet now holds a running log — date, daily delta, and total odometer.
Why this matters over CSV
The data now lives somewhere I can actually reach. I can chart it in Google Sheets without touching the server, share it if needed for insurance or maintenance tracking, and query it from other tools. If the VM gets rebuilt, nothing is lost because the data is in Google’s own infrastructure, not a flat file inside a VM.
What’s next
The next step is pulling the sheet into a Looker Studio dashboard so the mileage history shows up alongside the vehicle view in my Home dashboard.
Resources: HA Google Sheets integration docs · Setup walkthrough on YouTube