
Tracking Daily Power Usage with Shelly and Home Assistant - Part 1
One of the best parts of home automation is getting real data about how your home works — not just controlling things, but understanding them. If you’ve ever wondered how much energy your appliances are actually using, or wanted to see your daily consumption trends, you can do that easily with Shelly smart devices and Home Assistant.
In this post, I’ll walk through how to integrate Shelly devices with Home Assistant and use them to track and visualise your daily power usage.
Tutorial parts breakdown
- Part 1 - (This post) Covering basic shelly setup along with configuring Home assistant utility meters to track periodic consumption daily/weekly etc.
- Part 2 - Covering device cost tracking, building upon Part 1 and extending this to track daily, weekly costs
Why Shelly?
Shelly devices are compact, Wi-Fi–enabled smart switches and relays made by Allterco Robotics. What makes them great for energy tracking is that many models (like the Shelly 2PM, , Shelly 1PM Mini Gen3, Shelly Plug S, or Shelly EM) include built-in power monitoring.
They’re:
- Local-first (no cloud required).
- Affordable and easy to retrofit.
- Highly compatible with Home Assistant.
- Reliable for continuous energy measurement.
If you’re already running Home Assistant, Shelly is one of the most seamless ways to get per-device power metrics.
A Quick Note on Electrical Safety ⚠️
Before diving into wiring any Shelly devices, it’s really important to emphasise electrical safety.
If you’re installing in-line devices like a Shelly 1PM or 2.5 — anything that involves mains voltage wiring — make sure you fully understand what you’re doing.
- Always turn off power at the breaker before working.
- Use proper tools and insulation.
- If you’re not confident with electrical work, it’s best to get help from a qualified electrician.
- Ensure you have reviewed the manufacturer guidelines and specifications, Shelly are very good at this and link all of the documentation alongside their models. Not all relays are suitable for certain load types i.e inductive vs resistive loads!
Smart home projects are great fun and rewarding to learn from, but safety should always come first — no automation is worth a shock or a fire hazard.
Hardware Setup
For this example, you can use any of the following Shelly devices:
- 🧱 Shelly 1PM / 2.5 – inline relays with power monitoring for lights or sockets.
- 🔌 Shelly Plug S / Plug UK – smart plugs for standalone devices.
- ⚡ Shelly EM / 3EM – clamp meters for whole-circuit or multi-phase monitoring.
Connect them to your Wi-Fi and assign static IPs if possible — it helps with reliability.
Adding Shelly to Home Assistant
You have two main options for integration:
1. Native Shelly Integration (Recommended)
Home Assistant natively supports Shelly devices using the CoAP or MQTT protocol.
- In Home Assistant, go to Settings → Devices & Services → Add Integration.
- Search for Shelly.
- It should auto-discover devices on your network.
- Click Configure to add them.
Once connected, you’ll see new entities like:
sensor.shelly_plug_power
(instantaneous power, W)sensor.shelly_plug_energy
(total energy, Wh or kWh)- This is total energy over all-time rather than today/yesterday like other devices such as Sonoff / Tasmota, so Shelly requires a bit more setup to get Periodic data (Daily, Weekly etc)
switch.shelly_plug_relay
(on/off control)
2. MQTT Integration (Optional)
If you already use MQTT, you can flash Shelly devices to use it directly. Home Assistant will automatically create entities for MQTT topics like shellies/shellyplug/emeter/0/power
.
Tracking Daily Power Usage
Now that your Shelly devices are feeding data into Home Assistant, let’s turn that into meaningful daily stats.
You can use Home Assistant’s built-in Utility Meter integration to automatically track daily, weekly, or monthly energy totals.
Example Configuration
In your configuration.yaml
:
...
utility_meter:
microwave_switch_power_today:
source: sensor.microwave_switch_power
cycle: daily
microwave_switch_power_weekly:
source: sensor.microwave_switch_power
cycle: monthly
...
Example utility meters in Home Assistant configuration.yaml
This creates two new entities:
sensor.microwave_switch_power_today
sensor.microwave_switch_power_weekly
Each resets automatically at the start of a new day or month.
Visualizing in the Dashboard
Once you’ve got your utility meter entities, you can create a Lovelace dashboard card:
type: statistics-graph
title: Daily Energy Usage
entities:
- sensor.microwave_switch_power_today
- sensor.tv_daily
chart_type: bar
days_to_show: 7
stat_types:
- sum
Home assistant dashboard card showing statistics for energy meters
Now you’ll have a bar chart showing daily consumption per device — great for spotting trends and understanding where your power goes.
Bonus: Alerts & Automation
You can also use automations to warn you about unusual power usage or when an appliance finishes running. For example:
Notify when washing machine is done:
alias: Microwave Finished
trigger:
- platform: numeric_state
entity_id: sensor.microwave_switch_power
below: 2
for:
minutes: 3
action:
- service: notify.mobile_app_your_phone
data:
message: "Microwave cycle completed!"
Home assistant automation detecting when a device has finished its cycle
A simple and unnecessary but very satisfying automation.
Conclusion
Shelly devices + Home Assistant = a powerful combo for understanding your home’s energy use.
With just a few sensors and a couple of YAML lines, you can build detailed daily usage charts, track trends over time, and even trigger automations based on real power data.
Whether you’re trying to save energy, monitor appliance efficiency, or just geek out on data, this setup is one of the most practical additions to any home lab.