I am trying to get the info about my usage from certain time ranges to make some decisions including the amount of my firsts Solar Panels, batteries, etc.
For this, I would like to get the Usage between a range of time but in the Energy dashboard there is no way to set this up, I can only see it from 0 to 23:59 hours.
I am trying to accumulate values of the usage between from 6 to 18, and 18 to 6 again. So I can know which is my “day” usage and my “night” usage.
I already have some sensor from the main power meter:
sensor.esp_energy_monitor_technickraum_bezug_tarif_1
which reports the current total usage
sensor.esp_energy_monitor_technickraum_wirkleistung_gesamt
which reports the current usage
I would like to be able to get and store the usage from a week or so without, is this possible “out of the box”?
Thanks!
woempiej
(Woempiej)
June 2, 2025, 7:01pm
2
Maybe you can check the helper “Utility Meter”?
1 Like
I have seen and tried to do it but I do not understand how to make it from 6 to 18 for example.
The minimum cycle it has is daily
elRadix
(elRadix)
June 8, 2025, 7:26pm
4
Ultimate Guide: Track Time-Based Energy Usage in Home Assistant (Day vs. Night)
Using MeasureIt (UI-Only) or Utility Meter (Built-In)
This guide will help you split energy usage into custom time windows (e.g., 6 AM–6 PM for “day” and 6 PM–6 AM for “night”) and store long-term data.
Option 1: MeasureIt (Flexible, UI-Only)
Step 1: Install MeasureIt
Install via HACS :
Go to HACS → Integrations → Search “MeasureIt” → Install .
Restart Home Assistant.
Add Integration :
Navigate to Settings → Devices & Services → Add Integration → Search “MeasureIt” .
Step 2: Create Day/Night Energy Meters
Daytime Energy (6:00–18:00)
Add a new meter :
Go to MeasureIt → Add Meter .
Name : Daytime Energy Usage
Source Entity : Your energy sensor (e.g., sensor.esp_energy_monitor_technickraum_bezug_tarif_1
).
Configure Meter :
Meter Type : Sum
(accumulates kWh).
Reset Condition : Time-based
→ Set to 06:00:00 (resets daily at 6 AM).
Set Measurement Condition :
{{ now().hour >= 6 and now().hour < 18 }}
(Only measures between 6 AM–6 PM.)
Nighttime Energy (18:00–6:00)
Add another meter :
Name : Nighttime Energy Usage
Same Source Entity as above.
Configure Meter :
Meter Type : Sum
.
Reset Condition : Time-based
→ Set to 18:00:00 (resets daily at 6 PM).
Set Measurement Condition :
{{ now().hour >= 18 or now().hour < 6 }}
(Only measures between 6 PM–6 AM.)
Step 3: Visualize Data
Add to Dashboard :
Use a Statistics Graph card to show trends.
Or display totals with Sensor Cards .
Long-Term Storage :
Option 2: Utility Meter (Built-In, Simpler)
Step 1: Create a Utility Meter Helper
Go to Settings → Devices & Services → Helpers → Create Helper → Utility Meter .
Configure :
Name : Day/Night Energy
Meter Type : Daily
Tariffs : Add day
and night
.
Step 2: Automate Tariff Switching
Create two automations to switch between tariffs at 6 AM and 6 PM:
1. Switch to “Day” at 6 AM
2. Switch to “Night” at 6 PM
Step 3: View Data
The Utility Meter will now track day and night usage separately.
Add to dashboard via Energy Dashboard or Sensor Cards .
Which Method Should You Use?
Feature
MeasureIt
Utility Meter
No Automations
Yes
Requires automations
Custom Conditions
(e.g., sunrise/sunset)
Fixed tariffs
Built-In
Needs HACS
Native to HA
Ease of Use
Moderate
Simple
Troubleshooting
MeasureIt not resetting? Double-check reset conditions and time format (24-hour).
Utility Meter not updating? Verify automations are triggered correctly.
Data disappearing? Adjust Recorder settings to retain history.
Final Recommendation
For advanced users : MeasureIt (more flexible).
For simplicity : Utility Meter (built-in).
Measure anything in Home Assistant based on time and conditions.
1 Like
ChatGPT also gave me the recommendation for the Utility Meter but It does not work as expected right now because the counter restarts at 00 hours for both tariffs
It did not offered MeasureIt though. I will test it.