This Home Assistant custom integration provides a sophisticated real-time and cumulative energy cost tracking solution, ideal for monitoring electricity expenses related to fluctuating prices and varying energy consumption levels. It's specifically crafted to handle dynamic electricity prices such as those from Nord Pool, Amber, Tibber, ...
- Real-Time Cost Sensor (only Power Based): Calculates energy costs in real-time based on current power usage in watts (W) and electricity prices.
- Hourly, Daily, Weekly, Monthly and Yearly Cost (Energy and Power Based): Automatically generates daily, monthly, and yearly accumulations of costs, facilitating detailed and segmented analysis of energy expenses. These are based on actual energy usage in kilowatt-hours (kWh), providing precision aligned with the Home Assistant Energy Dashboard.
- Sensor without reset interval (Energy and Power Based) Similar to the above, but does not reset automatically. It resets only when the service
dynamic_energy_cost.reset_cost
is called. Making it perfect for calculating specific costs, such as the expenses for individual charging sessions of an electric car. - Enhanced Sensor Attributes: Energy Based Sensors include attributes for total energy used (kWh) and the average energy price, aiding in energy usage optimization during cheaper hours.
Calculating energy cost from an energy (kWh) sensor is the more precise and recommended method. If an energy sensor is available, it is advisable to use this option for accuracy comparable to the Home Assistant Energy Dashboard. If no kWh sensor is available, the integration can alternatively use a power (W) sensor.
Note: It is important that only one type of sensor (either power or energy) is configured for this integration. Both cannot be used simultaneously.
If you do not have HACS installed yet visit https://hacs.xyz for installation instructions.
To add the this repository to HACS in your Home Assistant instance, use this My button:
After installation, please restart Home Assistant. To add Dynamic Energy Cost to your Home Assistant instance, use this My button:
Manual configuration steps
- In Home Assistant go to HACS integrations section.
- Click on the 3 dots in the top right corner.
- Select "Custom repositories".
- Add the URL (https://github.com/martinarva/dynamic_energy_cost) to the repository.
- Select the integration category.
- Click the "ADD" button.
- Now you are able to download the integration.
- Download the latest release of Dynamic Energy Cost and extract its contents.
- Copy the
dynamic_energy_cost
folder into thecustom_components
directory located typically at/config/custom_components/
in your Home Assistant directory. - Restart Home Assistant to recognize the newly added custom component.
- Navigate to Settings > Devices & Services.
- Click Add Integration and search for "Dynamic Energy Cost".
- Select the Dynamic Energy Cost integration to initiate setup.
When setting up the integration, you will be prompted to provide the following:
- Input the entity IDs
- Electricity Price Sensor: Sensor that provides the current electricity price (for example Nordpool, Ember, ... fixed price, day/night).
- Power/Energy Usage Sensor: Ensure the sensor measures in Watts (W) for power or kilowatt-hours (kWh) for energy.
- Submit to complete the integration setup.
Update manually
To update the integration to a newer version:
- Download the latest release of Dynamic Energy Cost and extract its contents.
- Go to your'e Home Assistant instance.
- Make sure to make a back up first.
- Overwrite the
dynamic_energy_cost
folder into thecustom_components
directory located typically at/config/custom_components/
. - Reboot Home Assistant.
Dynamic Energy Cost provides a service dynamic_energy_cost.reset_cost
which you can call to reset energy sensors to 0. You can call this service from the GUI (Developer tools -> Services) or use this in automations.
service: dynamic_energy_cost.reset_cost
target:
entity_id: sensor.your_sensor_entity_id
Dynamic Energy Cost provides a service dynamic_energy_cost.calibrate
which you can call to change the value of a given sensor. You can call this service from the GUI (Developer tools -> Actions) or use this in automations.
action: dynamic_energy_cost.calibrate
target:
entity_id: sensor.your_sensor_entity_id
data:
value: "100"
- Electricity Price Sensor: A sensor that provides the current electricity price in EUR/kWh.
- Power Usage Sensor (optional): A sensor that monitors power usage in Watts (W).
- Energy Usage Sensor (optional): A sensor that monitors energy consumption in kilowatt-hours (kWh).
- Virtual Energy Usage Sensor (optional): Use a virtual energy sensor such as e.g. Powercalc.
- Download the latest develop ZIP file of Dynamic Energy Cost and extract its contents.
- Go to your'e Home Assistant instance.
- Make sure to make a back up first.
- Overwrite the
dynamic_energy_cost
folder into thecustom_components
directory located typically at/config/custom_components/
. - Reboot Home Assistant.
If you want, you can help with the translation via GitLocalize.
For support, additional instructions visit Home Assitant Community forum topic: Dynamic Energy Cost
To report issues, please visit the GitHub issues page associated with this repository.