---
title: "What electricity really costs in money: day and night tariff at the regulated price"
description: "How to set a day and a night electricity price in Home Assistant, so that you see consumption in leva and not only in kWh. You take the prices from your own bill; we don’t give numbers."
canonical: "https://realhomeautomations.com/en/projects/electricity-cost-in-money-day-night-tariff/"
language: en-US
updated: 2026-11-25T15:20:24+00:00
---

# What electricity really costs in money: day and night tariff at the regulated price

How to set a day and a night electricity price in Home Assistant, so that you see consumption in leva and not only in kWh. You take the prices from your own bill; we don’t give numbers.

> Canonical HTML page: https://realhomeautomations.com/en/projects/electricity-cost-in-money-day-night-tariff/

- **Difficulty:** Intermediate
- **Build time:** 45–90 minutes
- **Reading time:** 3 minutes

## Tools required

- Home Assistant (with a configured Energy dashboard)
- An energy sensor in kWh (an electricity meter, a metering device or an integration with a cumulative value)
- Latest bill (for the price of day and night energy)


## What readers will learn

- Understand the difference between price, power and energy
- Set two prices in the Energy dashboard
- Count the energy separately for day and night
- Know why the total in Home Assistant is not equal to the bill


## Skill requirements

- Find an energy sensor in Home Assistant
- Create a helper in Settings → Devices & services → Helpers

## Project kit

- [Ogemray Smart Relay 25A – Smart control for high-power loads, with full Shelly functionality](https://realhomeautomations.com/en/product/ogemray-smart-relay-25a-smart-control-for-high-power-loads-with-full-shelly-functionality/index.md)

Home Assistant shows how many kilowatt-hours (kWh) the home has used. The bill, however, is in leva and depends on the hour: day and night energy have different prices. If you set the prices, the “Energy” dashboard will show an approximate value in money, not only in kWh.

 ## What you will learn

 How to record a price per kWh in Home Assistant, how to separate day from night consumption and why the result is approximate. We don’t give electricity prices: they change and depend on your contract and supplier. Take them from your latest bill or from the regulator's published decision for the period.

 ## What you need

- Home Assistant with an already working sensor for **energy in kWh**that only increases (a total energy meter or a metering plug). Power in W is not enough.
- A latest bill or a published regulated price for day and night energy.
- If the meter is dual-tariff: information on which hours are the day tariff and which the night one. The hours are in the contract or on the supplier's website.

 ## How it works

 Home Assistant can calculate cost in two ways. The first is a **fixed price**: one number for all kWh. The second is a **price sensor**: a value that changes over time, for example between day and night. The dual-tariff case uses the second.

 To know how many kWh are day and how many night, we use the helper **Utility Meter** with two tariffs. It counts the energy in two separate counters and switches between them with your automation.

 Simeon takes the price from the HACS integration "Bulgarian Electricity Regulated Prices", with the supplier Energo-Pro and two tariffs. The night tariff is 22:00–06:00 in winter time, and the hours follow the integration. His main electricity meter is a Shelly EM Gen3.

 ## Steps

- In **Settings → Dashboards → Energy** check that the total consumption sensor has been added. If there is one price, under "Use a static price" enter the price per kWh from the bill. You are done here.
- For two tariffs, open **Settings → Devices & services → Helpers → Create helper → Utility Meter**. Set a name, choose your energy sensor and add two tariffs, for example `day` and `night`. You should see two new sensors appear, one per tariff, and a selector of the current tariff.
- Create an automation that switches the selector by hour. The hours in the example are **examples**; replace them with your own:

 ```
alias: Tariff - day/night
mode: single
triggers:
  - trigger: time
    at: "06:00:00"
  - trigger: time
    at: "22:00:00"
  - trigger: homeassistant
    event: start
actions:
  - action: select.select_option
    target:
      entity_id: select.energy_tariff
    data:
      option: >
        {{ 'day' if 6 <= now().hour < 22 else 'night' }}
```

- Create a price sensor. In **Helpers → Create helper → Template → Template a sensor** set a template that returns the day or night price depending on the selector. The numbers `0.00` are a placeholder. Enter your prices:

 ```
{{ 0.00 if is_state('select.energy_tariff', 'day') else 0.00 }}
```

- In the Energy dashboard for consumption, choose "Use an entity tracking the price" and point to this sensor. Its unit must be a currency per kWh.

 ## Checking the result

- Compare the counter readings for day and night with the electricity meter at the end of several days.
- The sum of the two counters should match the total consumption.
- After a restart, the tariff selector should point to the right tariff, because the automation also reacts at start.

 ## If it doesn't work

- Everything is counted in one tariff → the automation doesn't switch the selector → check the entity ID of `select` and the hours.
- The price in the dashboard is zero → the template returns 0 or `unknown` → check in Developer tools → Template.
- Energy jumps on restart → the sensor loses its value → use a sensor with `state_class: total_increasing`.

 ## Limitations

- The calculation in Home Assistant is approximate. The bill includes fees, surcharges and taxes that you may not have added to the price.
- If the supplier changes the price, you have to update it manually. The old days keep the price at which they were calculated only if you used a price sensor, not a fixed one.
- This project doesn't control appliances. It only shows a result.

 ## Sources and verification status

 Checked against the documentation on 22.11.2026.

- [Home Assistant: Energy – Electricity grid](https://www.home-assistant.io/docs/energy/electricity-grid/)
- [Home Assistant: Utility Meter](https://www.home-assistant.io/integrations/utility_meter/)
- [Home Assistant: Template integration](https://www.home-assistant.io/integrations/template/)