Prerequisites

Grid Lens requires Home Assistant 2024.1 or later with the following already working:

  • The Energy dashboard configured with at least grid consumption sensors
  • Your electricity retailer and current plan details (tariff rates, peak/off-peak times)

Solar, battery, and EV sensors are optional but unlock more accurate modelling.

Note: Grid Lens works with any HA-compatible energy sensor. You don't need a specific inverter or meter brand.

Install the App

Via HACS (recommended)

Add the Grid Lens repository to HACS as a custom repository:

  1. Open HACS → Integrations → ⋮ menu → Custom repositories
  2. Add https://github.com/dankasak/gridlens with category Integration
  3. Search for "Grid Lens" and install
  4. Restart Home Assistant

Manual install

Copy the custom_components/grid_lens folder from the GitHub repo into your HA config/custom_components/ directory, then restart.

Configure

After restarting, go to Settings → Devices & Services → Add Integration and search for Grid Lens.

Setup is four short screens:

  1. Your state and email address. If more than one network in your state has plan data, you'll be asked which distributor operates the poles and wires at your address — it's printed on your bill, and it isn't your retailer.
  2. Your energy sensors (grid import, and optionally export, solar and price). These are pre-filled from your Home Assistant Energy dashboard if you've set one up.
  3. Your battery, if you have one — capacity and charge/discharge rates. The checkbox is pre-ticked if your Energy dashboard already has a battery configured.
  4. Your current electricity plan.

If your Energy dashboard lists individual appliances, you'll also get a screen to pick which of them can be shifted to cheaper hours, and set each one's maximum power.

Everything else — controlled load, allowed run hours, modulating charger control, battery efficiency and charge limits — has a sensible default and can be changed later under Grid Lens → Configure. Nothing you skip at setup is lost.

Proof-of-concept phase: Grid Lens currently supports NSW — Ausgrid (Sydney, Central Coast, Newcastle, and Hunter regions). We are expanding to Endeavour Energy, Essential Energy, and other states rapidly. If your network isn't covered yet, setup will tell you so on the first screen rather than letting you fill in the rest.
Free plan: Setup never asks you to pay. Your free account models your current plan at no cost; upgrading to compare against every plan is offered afterwards as a notification.

View the dashboard

Grid Lens adds a Grid Lens dashboard to your Home Assistant sidebar automatically — no cards to add, no YAML. It has three views:

  • Plan Comparison — cost across all modelled plans for a date range you choose, the optimal usage profile under each, and the estimated bill for the period.
  • Battery Plan — live energy flow, forecast vs. measured power, the battery state-of-charge curve, and the planned dispatch timeline.
  • Settings — deferrable load controls, allowed run times, and optimiser tuning.

The cards find their own entities, so they keep working as you add, remove, or reconfigure loads.

Required sensors

Grid Lens needs at least one of the following entity types, already configured in your Energy dashboard:

Sensor typeRequired?Notes
Grid consumption (kWh)RequiredTotal energy drawn from grid
Grid export (kWh)OptionalNeeded for feed-in tariff modelling
Solar production (kWh)OptionalEnables solar self-consumption analysis
Battery charge / discharge (kWh)OptionalEnables battery optimisation
EV / deferrable load (kWh)OptionalEnables load-shifting recommendations

Deferrable loads

A deferrable load is electricity usage you can shift to a cheaper time of day — for example an EV charger, pool pump, hot water system, or air conditioner.

To include a deferrable load in the optimisation, you need a sensor that measures its consumption. Grid Lens will model what each plan would cost if you shifted that load to its cheapest window.

Configure deferrable loads under Settings → Devices & Services → Grid Lens → Configure after setup.

No consumption sensor at all for a controllable appliance (common for an IR-remote-controlled aircon)? Grid Lens can estimate one for you — see Estimated loads under Load control below.

Allowed run times

Each deferrable load has a weekly schedule — a per-weekday, half-hourly grid of when that appliance is allowed to run. Grid Lens picks the cheapest half-hours inside your rules; it never runs a load outside them.

Edit it on the Allowed Run Times card on the Grid Lens dashboard by painting hours with the mouse. A pool pump might be daytime-only; an EV charger might be unrestricted.

Note: the optimiser plans forward from now, not from midnight, so its first day spans two weekdays. Anywhere Grid Lens shows you "hours available", it means the next 24 hours — not a calendar day.

Today Boost

Grid Lens learns how much energy each deferrable load needs per day from its own sensor, averaged over the last 14 days. When today isn't typical — a long drive tomorrow, guests staying — override it with Today Boost on the Deferrable Loads card.

Set the kWh you actually need today; 0 means "use the historical average". The plan re-solves around it immediately.

A small bar chart next to the input shows each device's actual daily use over the last two weeks, with the average of those days beside it — so you can see what "typical" is before deciding how far above it to go.

If you ask for more than the load's allowed window can physically deliver, the card shows you that ceiling rather than silently ignoring the excess.

Battery control

Comparison and planning are read-only. Battery control is the optional step where Grid Lens actually operates your inverter to follow the plan it found.

Turn on the Battery Control switch. From then on, every five minutes Grid Lens reconciles your battery against the current plan — charging from solar, charging from the grid during genuinely free or cheap windows, holding, or discharging into expensive periods.

  • Your configured minimum and maximum state-of-charge are always respected.
  • If you've told Grid Lens not to grid-charge, it will only ever charge from solar surplus.
  • The Minimum Export Price setting lets you say "below this feed-in rate, don't bother selling" — the optimiser will prefer storing the energy or spending it on a deferrable load instead.
Failure behaviour: if Home Assistant restarts, the plan goes stale, or you turn the switch off, Grid Lens hands the battery straight back to your inverter's own energy management system. It never leaves your battery stuck in a forced mode.

Battery control is brand-agnostic by design. Sigenergy is supported today; more inverter drivers are being added.

Load control

Grid Lens can also switch simple on/off appliances — anything exposed to Home Assistant as a switch entity that draws roughly a fixed power when running (a pool pump, a smart-plug-fed charger, a resistive heater) — or as a climate entity, so an air conditioner works the same way. Grid Lens only ever decides when it runs, never its mode or target temperature — those stay under your own control.

An EV charger that accepts a charging-current limit is handled differently, and better — see EV chargers below.

Assign a control switch (or climate entity) to a deferrable load via Grid Lens → Configure. Each controllable load then gets its own controls on the Deferrable Loads card:

ControlDefaultWhat it does
Control switchOffMaster opt-in — Grid Lens drives this appliance per the plan.
On now / Off nowManual override. Forces the appliance and stops Grid Lens driving it entirely, until you choose Auto.
AutoHands control back to the plan.
Everything is off by default. A fresh install never touches an appliance until you explicitly enable control for it. And Grid Lens will never force a running appliance off because it had a problem — if it loses its plan or Home Assistant restarts, it stops driving the load and leaves it exactly as it is.

EV chargers — variable charging current

An EV charger is not really an on/off appliance. Most can be told how many amps to deliver, and Grid Lens will use that: instead of slamming the charger fully on or fully off, it dials the charging current up and down to match what the plan wants and what your solar is actually producing right now.

This works with any charger integration that exposes a charging-current limit as a Home Assistant number entity — which is essentially all of them. Known-good shapes include OCPP (number.…_maximum_current), Easee, Wallbox, Zaptec, go-e, openEVSE, Tesla and Sigenergy. Point Grid Lens at that entity under Grid Lens → Configure and it takes over from there; there's no per-brand setup.

SettingDefaultWhat it does
Charging current entityThe charger's current-limit number entity. Leave it empty to keep plain on/off control.
Units / phases / voltageAutoDetected from the entity itself. Only set these if auto-detection gets it wrong.
Minimum current6 AThe lowest current your car will accept. Rarely needs changing.
Plugged-in sensorOptional. Lets Grid Lens stop commanding a charger with no car attached.
Max CurrentCharger maximumYour own ceiling — "never charge above 10 A", whatever the plan wants.

With Greedy Consumption switched on, a modulating charger does something an on/off one can't: it tracks your surplus continuously, every 30 seconds, ramping the current to absorb exactly what you're exporting. An on/off appliance has to wait until the whole of its draw is covered before it can switch on at all. For live surplus tracking you'll also need a grid power sensor configured — without one, the charger simply follows the optimiser's plan instead.

Why 6 amps matters. An electric car can't charge below about 6 A — offer it less and it won't charge slowly, it will refuse outright. So Grid Lens never commands an in-between current: it either charges at 6 A or more, or not at all. It also holds on a little past the point where it would otherwise stop, because a car that gets cut off can take half a minute to start again — better to ride out a passing cloud than restart the session.

Estimated loads

Some controllable appliances have no way to report their energy use at all — the classic case is an air conditioner driven by an infrared blaster, which can only send commands, never read anything back. You can still add these under Grid Lens → Configure → Estimated loads: give it a name, its control entity, and a rough estimate of its power draw in kW.

Turn on auto-refine and point Grid Lens at a whole-house load power sensor, and it will quietly improve that estimate over time: whenever the appliance switches on, it compares your house's power draw just before and a few minutes after (long enough for a compressor to spin up) and folds a plausible reading into a running estimate. It learns from ordinary use — you don't need to do anything for it to collect data — and discards anything that looks unreliable (another controlled device changing state at the same time, an implausible jump). Leave auto-refine off, or skip the load power sensor, and it simply stays on your manual estimate.

Once configured, an estimated load behaves exactly like any other deferrable load — it gets its own schedule, Today Boost, Greedy Consumption, and all the same controls above.

Also fixes the Power Flow card for devices with no live power sensor — even ones that already have a real energy meter. Some devices (many ECHONET Lite air conditioners, for example) only report a running energy total, never an instant wattage, and the Power Flow card needs a live number to draw a node. The moment you set the whole-house load power sensor above, Grid Lens automatically builds one for every controllable device that's missing it — nothing else to configure.

Greedy Consumption

On most solar homes there are hours every day when your battery is full, your panels are still producing, and the surplus goes to the grid for a feed-in tariff of almost nothing. That's free energy leaving the house.

Greedy Consumption lets a load opportunistically run whenever energy is genuinely free, regardless of what the plan scheduled for that moment. Enable it per appliance. There are three triggers:

TriggerFires whenCan it cost money?
Free importYour plan's import price for this window is zero.No
Export surplusYour feed-in price is zero and you're already exporting at least as much as this appliance draws — so running it can't create new grid import.No
Forecast surplusOver the next few hours the plan expects to spill more free energy than this appliance could use running flat out for that entire window.Yes — briefly

The first two only fire once free energy is already flowing. That's often too late: mid-morning your battery absorbs every spare watt, so nothing looks free, even though the plan already knows the afternoon will spill far more than the appliance could ever consume. By the time surplus export actually appears, hours of run-time are gone.

Forecast surplus fixes that by starting the load early. It's a separate opt-in because it's the one trigger that can draw a little priced grid power in the moment, in exchange for capturing a much larger forecast spill — on a house with a battery, that gap gets refilled by energy that would otherwise have been exported for nothing.

The bar is deliberately high: it only fires when the plan would still be wasting free energy even with this appliance running continuously for the whole look-ahead window. A little spare solar never trips it.

Optional guardrails: Greedy Respects Schedule confines greedy to the appliance's own allowed run times. And a manual override always wins — greedy is suppressed entirely while you have a load forced On or Off.

Setting up the export-surplus trigger

The export surplus trigger needs a live signed grid power sensor — positive when importing, negative when exporting — configured as grid_power_sensor under Grid Lens → Configure. Without it that one trigger simply never fires; the other two still work.

Note this is a power (W) sensor, not one of the cumulative kWh sensors from your Energy dashboard.

Seeing why it acted

Anything that acts on your house should be able to explain itself. Every automated decision Grid Lens makes is visible on the dashboard:

  • Deferrable Loads card — per appliance: whether Grid Lens is controlling it, which greedy trigger is currently holding it on, or why greedy is blocked. When the forecast-surplus trigger is armed, a progress bar shows how close it is to firing.
  • Power Flow card — a badge appears on an appliance while greedy, rather than the plan, is the reason it's running. Hover it for the numbers behind the decision.
  • Power Chart card — free-energy shading. Orange marks periods where the plan expects to spill energy it can't sell; teal marks free import windows. Hover a band for the detail.
  • Entity attributes — every Grid Lens switch exposes its full decision state for use in your own automations and templates.

API key

The free plan requires no API key — Grid Lens registers your installation automatically and grants access to model your current plan.

A Pro subscription ($1/month) gives you an API key that unlocks all available plans. Enter it under Grid Lens → Configure → API key & connection.

If you remove and re-add the integration, setup will tell you the installation is already registered and ask for your existing key. We only store a hashed copy, so we can't show it to you again — keep it somewhere safe, or email support@gridlens.au from your registered address for a replacement.

Troubleshooting

Integration not appearing after install

Ensure you fully restarted Home Assistant (not just reloaded). Custom integrations require a full restart to register.

Sensor not found during setup

Make sure your energy sensors appear in the Energy dashboard first. Grid Lens reads from the same sensor list.

Optimiser returns no results

Grid Lens needs at least 24 hours of sensor history to run the LP optimiser. If you've just set it up, check back the following day.

Enable debug logging

Add to your configuration.yaml:

logger:
  logs:
    custom_components.grid_lens: debug

Then check Settings → System → Logs for grid_lens entries.

Still stuck? Email support@gridlens.au.