1.4 KiB
1.4 KiB
Home Assistant files
Three files to connect Home Assistant to Kilometer Log. They are the same as what the app shows under Admin → Home Assistant, filled in for a Volvo XC40.
| File | Where it goes |
|---|---|
configuration.yaml |
Add to Home Assistant's configuration.yaml, then restart Home Assistant. |
secrets.yaml.example |
Add the line to Home Assistant's secrets.yaml, with your HA_TOKEN after Bearer . |
automation.yaml |
Settings → Automations & scenes → Create automation → ⋮ → Edit in YAML: replace everything with it and save. |
Before you use them:
- Plate: replace
AB-123-Cinconfiguration.yamlwith your car's plate. - Entity names: if your car's entities have other names than
sensor.volvo_xc40_odometeranddevice_tracker.volvo_xc40_location, change them inautomation.yaml. - Address:
configuration.yamlreaches the app over Docker's internal network, athttp://kilometer-log:3000.- Home Assistant runs with
network_mode: host? Usehttp://127.0.0.1:3077and uncomment theports:lines in the compose file. - Using the public address instead? Use the exact
https://address, without a redirect.
- Home Assistant runs with
To test it, open the automation and choose Run actions. After a minute, Admin → Home Assistant shows "First reading saved".
The automation reads the sensor directly, so this manual test works; older versions used trigger.to_state and failed when run by hand.