22 January 2024: Added Localvolts version to repo.
18 May 2024: Added negative price support to cost/profit utility meters. Existing users: just add the line delta_values: true
to each import cost and export profit utility meter.
This package is used in Home Assistant with the Amber Electric integration or integrated Localvolts pricing to estimate usage in kilowatt hours and dollars. Example charts using the ApexCharts Card HACS frontend integration are included.
Using prices from your wholesale electricity provider integration, import and export prices are recorded at the end of each cost period (30 minutes for Amber, 5 minutes for Localvolts), as well as the cost/profit for each cost period.
Amber-Styled Charts
Combined Energy and Cost Charts
Prerequisites:
Please note that the values will not match exactly with your wholesale provider's reporting, as:
For example, my inverter typically reports imported and exported power about 2% lower than what is reported by the smart meter to my provider. In the inverter_import_power
and inverter_export_power
template sensors there is a correctionFactor
variable which helps to compensate for this - I have it set to 1.02.
The YAML is provided as a package. It can be implemented as described in the Home Assistant documentation. For example, add the following to configuration.yaml
:
# Use packages in /package folder
homeassistant:
packages: !include_dir_named package
and then copy amber_usage.yaml
to config/package/amber_usage.yaml
. Do not copy amber_usage_part2.yaml
or charts.yaml
to the package folder.
For these instructions substitute localvolts_usage.yaml
and localvolts_usage_part2.yaml
if that is your provider.
To get it running, the only changes you should need to make are in the template sensors and the automation.
amber_usage.yaml
as a package and updating the code as described below.
inverter_import_power
and inverter_export_power
return power as positive values in kW.correctionFactor
value of 1.amber_usage_part2.yaml
to amber_usage.yaml
.
amber_30_minute_import_cost_export_price
automation by updating sensor.your_amber_general_price
and sensor.your_amber_feed_in_price
to the corresponding sensor names from your Amber Electric integration.correctionFactor
is a multiplier to adjust the kW of your inverter sensor to be closer to what is reported by your smart meter to Amber. Adjust the value accordingly.