The Energy Meter integration provides functionality to track consumptions of various utilities, like the builtin Utility Meter. But on top of it, it adds entities to track costs for each tariffs.
Provides extended features on top of the builtin utility meter and energy sensors to track costs for each tariff as well as total costs. It is possible to achieve the same using templates, but it is long and error-prone to do it for every single energy entity you want to track
This repository is compatible with HACS. This is the preferred way to install the custom component.
- Download the release zip from releases pages
- Copy it within
<HA config dir>/custom_components/energy_meter
- Unzip in place
- Restart Home Assistant
The configuration of the component is mostly the same as the builtin
utility_meter
integration:
https://www.home-assistant.io/integrations/utility_meter/
The only difference is the addition of price
and price_entity
options:
price float (optional)
The static price of the tariff (in currency/kWh)
price_entity string (optional)
The entity ID of a sensor giving the current price of the tariff (in currency/kWh)
The price must be given in currency/kWh. It depends on your currency configuration. For instance, if your configured currency is dollar, it must be in $/kWh.
Only one of price
or price_entity
should be given. If both are given,
price_entity
would have precedence. If none is defined, this integration will
act as a basic utility meter, with no cost tracking.
energy_meter:
daily_energy:
source: sensor.energy
name: Daily Energy
cycle: daily
price_entity: sensor.current_energy_price
tariffs:
- peak
- offpeak
monthly_energy:
source: sensor.energy
name: Monthly Energy
cycle: monthly
price: 0.20
tariffs:
- peak
- offpeak
Usually, source energy sensors shares the same price. In order to prevent configuration issues when changing it in a config, it is advised to use the anchor feature of YAML:
energy_meter:
daily_energy:
source: sensor.energy
name: Daily Energy
cycle: daily
price_entity: &entity-price sensor.current_energy_price
tariffs:
- peak
- offpeak
monthly_energy:
source: sensor.energy
name: Monthly Energy
cycle: monthly
price: *entity-price
tariffs:
- peak
- offpeak