Custom Home Assistant integration for updating a Tibber vehicle battery state of charge.
Big credit to Elibart-home for the original solution and inspiration behind this integration:
The integration exposes a Home Assistant service that can be called from an automation with a SoC value produced by an earlier step.
- Add this repository to HACS as a custom repository of type
Integration. - Install
Tibber Vehicle SoC Updatefrom HACS. - Restart Home Assistant.
- Add the integration from Settings > Devices & Services.
- Copy
custom_components/tibber_vehicle_soc_updateinto your Home Assistantcustom_componentsdirectory. - Restart Home Assistant.
- Add the integration from Settings > Devices & Services.
- The repository is structured for HACS with the integration under
custom_components/tibber_vehicle_soc_update. hacs.jsonis included at the repository root so HACS can recognize the repo as a custom integration.- For normal HACS upgrades, publish versioned GitHub releases that match the
versionvalue incustom_components/tibber_vehicle_soc_update/manifest.json.
The config flow asks for:
- Friendly car name
- Tibber email
- Tibber password
- Tibber home ID
- Tibber vehicle ID
The friendly car name is used as the integration entry name in Home Assistant, so you do not have to identify the setup by raw vehicle_id.
You need to use Tibber's Open Data API to find the correct values:
- Documentation: https://data-api.tibber.com/docs/
- Playground: https://data-api.tibber.com/playground/
Typical flow:
- Create an OAuth client in Tibber's Data API and authorize it.
- Call
GET https://data-api.tibber.com/v1/homesto find yourhome_id. - Call
GET https://data-api.tibber.com/v1/homes/{homeId}/devicesto list devices for that home. - Find your vehicle in the returned devices list.
Important for vehicle_id:
- Do not use the Tibber internal device
id. - Use the vehicle's external identifier field instead, i.e.
externalId.
Tibber's API distinguishes between its own stable internal device ID and the external/vendor ID. This integration expects the external vehicle identifier as vehicle_id.
Service name: tibber_vehicle_soc_update.set_soc
Fields:
config_entry_id(required): choose the configured vehicle from the dropdown in the action editorsoc(required): target battery percentage from 0 to 100
Calling the service updates the integration's stored current SoC so the last written value remains available internally.
In the visual action editor, the config_entry_id field is presented as a dropdown showing the friendly car names from your configured vehicles. In YAML mode, Home Assistant stores the selected value as the underlying config entry ID.
alias: Update Tibber vehicle SoC
sequence:
- service: tibber_vehicle_soc_update.set_soc
data:
config_entry_id: 0123456789abcdef0123456789abcdef
soc: "{{ states('sensor.calculated_soc') | int }}"