I would like to make a template to measure the amount consumed by charging my electric car. Unfortunately I do not have a charger that is able to connect to home assistant (EVBox Livo) and do not track the energy used by the charger by this device.
I have an Ioniq 5 linked to home assistant using the Hyundai / Kia Connect integration. Within this integration is an entity called IONIQ 5 EV Charging Power (sensor.ioniq_5_ev_charging_power).
Is it possible to make a template which also accounts for the condition that the car is at home? WIthin the same integration is a sensor on the location of the vehicle which has states such as home or away. (device_tracker.ioniq_5_location).
This way it only accounts for the charging when using my home charger but does not count when charging somewhere on the road :). Any thoughts on how to accomplish this?
You can use the tariff feature un utility meters. The tariff you set determine which counter is increased. Note that you do not have to set a reset cycle. Without it you’ll get an ever increasing total.
However, I cannot find my entity in the energy dashboard for tracking. I did the following:
I think I set up the utility meter right by using different tarrifs for selecting if the car is at home or not. I could not find the option for multiple tarriffs in the UI so I set it up in yaml by:
utility_meter:
energy:
source: sensor.ioniq_5_ev_charging_power
name: energy_charged_ioniq5
tariffs:
- home
- other
After that I made an automation to differentiate between the 2 tarriffs when the car is at home.
alias: car energy
description: "geeft aan dat energie geladen door ioniq5 van eigen gebruik is"
triggers:
- device_id: ***
domain: device_tracker
entity_id: ***
type: enters
trigger: device
zone: zone.home
id: ioniq5_home
- device_id: ***
domain: device_tracker
entity_id: ***
type: leaves
trigger: device
zone: zone.home
id: ioniq5nothome
conditions: []
actions:
- if:
- condition: trigger
id:
- ioniq5_home
then:
- action: select.select_option
metadata: {}
data:
option: home
target:
entity_id: select.energy
- if:
- condition: trigger
id:
- ioniq5nothome
then:
- action: select.select_option
metadata: {}
data:
option: other
target:
entity_id: select.energy
mode: single
added benefit would be that I now also have a sensor for keeping track of the charges outside my home :).
However, this does not show the entity in the list at the energy dashboard. My thoughts are that this is due the number produced does not have a device_class of power which i cannot set in the utility meter. Is this correct or is there another way to get the energy visible in the energy dashboard?