Per-device electricity cost explorer for your smart home

Pick any date range and see what each device in your home actually cost to run, not just how many kilowatt-hours it used.

App
Home AssistantGoogle SheetsFinancePersonal ProductivityAI ReportsResearch & Monitoring
PromptCreate

Build me an app for exploring what electricity actually costs me, device by device. I pick a date range at the top, and the main view ranks every energy sensor in my home by what it cost me over that window, showing kilowatt-hours used, the cost in my currency, and the change versus the previous equivalent period, meaning the same number of days immediately before the selected window. Clicking a device row opens a detail view with a usage chart for that device across the window.

Find my energy sensors with Home Assistant List States, keeping entities whose device_class is energy and whose unit is kWh or Wh. Store that list in app settings so I can tick devices on and off, because I have sensors that overlap (a whole-home monitor plus individual smart plugs) and I do not want them double counted in the ranking. Let me give devices friendlier display names than the raw entity ids.

Pull consumption with Home Assistant Get History, always narrowed with filter_entity_id plus start_time and end_time, never unbounded, because my instance runs on a Raspberry Pi and wide history calls will crawl. Timestamps must be ISO 8601 and URL encoded. Here is the detail that matters most: nearly all of these sensors are cumulative totals (state_class total_increasing), so usage for a window is the last reading minus the first reading inside that window, not a sum of the readings. Handle counter resets, so if a reading is lower than the one before it the counter reset and you add the pre-reset accumulation rather than producing a negative number. Skip unavailable and unknown states instead of treating them as zero. If a sensor turns out to be an instantaneous power reading in watts rather than a cumulative energy total, integrate it over time instead. If a device has no readings at all in the window, show it as no data rather than a zero cost.

Pricing lives in a Google Sheets tariff table that I maintain, read with Get Values. Rows define named rate windows (peak, off-peak, shoulder), each with a start time, an end time, and a price per kWh, plus a separate daily standing charge. Cost each device by splitting its usage across the rate windows it actually ran in and applying the matching rate, so a dishwasher that runs at 2am is priced at off-peak. Show the standing charge as its own line in the total, calculated as the daily rate times the number of days in the window, kept clearly separate from device costs because it is not attributable to any single device.

I want to edit those rates without leaving the app. Give me a tariff panel where I can change the windows, the prices, and the standing charge, and saving writes them straight back to the sheet with Update Values, after which the whole breakdown recalculates. Validate before saving: prices must be positive numbers, and the rate windows must cover the full 24 hours with no gaps and no overlaps.

Two more actions in the toolbar. First, export the current breakdown to my costs spreadsheet with Append Values, writing one row per device for the selected window (date range, device name, kWh, cost, change versus previous period), plus a row for the standing charge. Second, publish my month to date total cost back into Home Assistant with Create or Update State, writing to a sensor entity I name in settings, something like sensor.home_energy_cost_mtd, with the currency and a friendly name in the attributes so it can sit on my wall tablet dashboard. Note that Create or Update State writes a state representation only, it does not command any device, and Home Assistant drops these values on restart, so make the publish button easy to hit again.

Add an Explain this spike button on every device row and on any day in the device chart. It starts a background agent, and the app shows that device's explanation as pending while the agent runs, then displays the finished result in the detail view. The agent pulls Get History for that device across the window in question, pulls Get History for the rest of the home's energy sensors over the same window for context, and compares against a baseline period such as the same weekday previously or the previous equivalent window. It works out what was running when the cost jumped: a longer runtime, more cycles than usual, running during a peak rate window instead of off-peak, or another heavy device being on at the same time. Then it writes a plain-language explanation of what happened, in the tone of talking to a housemate rather than an engineer, plus two or three concrete savings suggestions tied to my actual tariff windows, for example shifting a specific appliance to a specific time of night. The explanation lands back in the app and also gets appended to a log tab in my spreadsheet with Append Values, so I build up a history of everything that has been explained.

Keep in app settings: my tariff spreadsheet id and tab name, my costs spreadsheet id and its export and explanation log tabs, my currency symbol, the entity id to publish the running total to, my device selections and display names, and my last used date range so the app reopens where I left it. Give me sensible date range presets: this month, last month, last 7 days, last 30 days, and custom.

To be clear about scope: this app reports costs and publishes derived values. It does not switch anything on or off, and none of its copy should suggest that it can.

What does this prompt do?

  • Ranks every energy-monitoring device in your home by what it cost over the date range you pick, with usage, cost, and the change against the previous period.
  • Prices that usage against your own peak, off-peak, and shoulder rates plus the daily standing charge, all kept in a spreadsheet you can edit without leaving the app.
  • Click any device for a usage chart, or hit Explain this spike to have an assistant work out what was running when your cost jumped and suggest two or three ways to cut it.
  • Export the breakdown to your costs spreadsheet, and publish your month to date total back to Home Assistant so it shows on your wall tablet.

What do I need to use this?

  • A Home Assistant setup with devices that report energy usage, such as smart plugs, an energy monitor, or an EV charger.
  • A Google account with a spreadsheet holding your electricity rates, and a place to log costs (the same file with two tabs is fine).
  • Your tariff details: your peak, off-peak, and shoulder prices and your daily standing charge.

How can I customize it?

  • Change the rate windows, prices, and standing charge any time from the tariff panel, and the whole breakdown recalculates instantly.
  • Choose which devices appear and rename them, so overlapping sensors like a whole-home monitor and individual plugs do not double count.
  • Pick which Home Assistant sensor the running total publishes to, so it matches the dashboard on your tablet.

FAQs

Do I need a smart meter for this to work?
No. It reads from whatever devices already report energy in Home Assistant, such as smart plugs, clamp-style energy monitors, or an EV charger. A smart meter is useful for sanity checking your whole-home total, but it is not required.
Can it handle time of use rates?
Yes, that is the main point. You set peak, off-peak, and shoulder windows with their own prices, and each device's usage is priced against the window it actually ran in. A dishwasher running at 2am gets charged at your off-peak rate.
Will this turn devices off for me?
No. It reports costs and publishes a running total back to Home Assistant so you can display it. It does not switch anything on or off.
Why does my total not match my electricity bill exactly?
Individual device sensors rarely add up to your whole home usage, and real bills include taxes and rounding on top of the standing charge. Treat this as an accurate ranking of where your money goes rather than a replica of your bill.
Can I use a currency other than dollars?
Yes. You set your currency symbol once and everything displays in it. All the rates come from your own spreadsheet, so any currency and any tariff structure works.

Related templates

Prospecting desk that builds account lists from the live web

Stop buying stale lists. Reps run a saved search, work the results like an inbox, and only the accounts they approve ever reach your CRM.

Hyperbrowser
HubSpot
Google Sheets
App
Influencer campaign roster board with AI creator briefs

Drag creators through Sourced to Wrapped on a board grouped by campaign, with audience stats on every card and a one-click brief for each creator.

HypeAuditor
Google Sheets
Notion
App
Morning repricing console for Shopify with margin-safe rules

Pick a repricing rule, send an assistant out to check competitor pages, then approve the new prices that clear your margin floor.

Hyperbrowser
Shopify
Google Sheets
App
Pre-flight bounce check before you launch a cold email sequence

See the projected bounce rate for any outbound send before it goes out, and keep the launch button locked until the list is clean enough to be safe.

Hunter
Google Sheets
App
Smart home entity health cockpit for Home Assistant

Open one screen to find every unavailable, stale, or low-battery device in your smart home, see which hub is really at fault, and clear out the dead entries in bulk.

Home Assistant
Notion
App
Build a PR media list from real worldwide news coverage

Search three months of global coverage on your topic, rank the outlets actually writing about it, and draft a tailored pitch for each one.

GDELT
Google Sheets
Gmail
App

Stop guessing which device is running up your electricity bill.

Build a cost explorer that prices every device against your real tariff and explains what changed.