My Business Mileage Tracking Solution

I have tried Triplog and paid good money for an inaccuate solution!
I aquired a new 2022 Ford Mustang Mach-E on March 1st and thanks to FordPass and the HA integration, I now have a reliable method of tracking business mileage, if I remember to say "Alexa,…

First, the FordPass integration knows my current odometer, updated every 15 minutes. At 23:59:00 I have an automation which runs and writes to a Google sheet. That info contains the current odometer. I have an input number to remember the previous odometer, and another input number for daily business mileage. It then writes current odometer, distance since last odometer, daily busniness mileage and personal mileage to a new line ine the sheet.

I just have to remember after a business trip, which I can track via the trip odometer or current trip on the Mach-E, “Alexa, increase daily business mileage by xxx.”

alias: Record Mach-E Odometer Recording
description: ""
trigger:
  - platform: time
    at: "23:59:59"
condition: []
action:
  - service: google_sheets.append_sheet
    data:
      config_entry: 1b4a46c6cba0677bbfb5a8c53e8618b0
      worksheet: Mileage
      data:
        Date: "{{ now().strftime('%-d-%b-%y %H:%M:%S') }}"
        Odometer: "{{ states('sensor.fordpass_odometer') }}"
        Mileage Today: >-
          {{ states('sensor.fordpass_odometer')|int(0) -
          states('input_number.mach_e_previous_odometer')|int(0) }}
        Business: "{{ states('input_number.daily_business_mileage') }}"
        Personal: >-
          {{ states('sensor.fordpass_odometer')|int(0) -
          states('input_number.mach_e_previous_odometer')|int(0) -
          states('input_number.daily_business_mileage')|int(0) }}
  - service: input_number.set_value
    data:
      value: "{{ states('sensor.fordpass_odometer') }}"
    target:
      entity_id: input_number.mach_e_previous_odometer
    alias: Set Mach-E previous odometer to current
  - service: input_number.set_value
    data:
      value: 0
    target:
      entity_id: input_number.daily_business_mileage
    alias: Reset daily business mileage to zero
mode: single

image

2 Likes

I really like the idea of writing an external document with the needed values and will adopt this for my projects!! Thanks a lot for sharing this!