[Custom Component] Ratebook: real US electricity tariffs (TOU/tiered) for your energy dashboard


US energy dashboards have a gap: dynamic-tariff support is great for EU day-ahead markets, but US rates are time-of-use / tiered / seasonal schedules buried in utility PDFs, and the one open dataset (NREL's URDB) is mostly stale and bundles distribution, generation, and transmission into a single number you can't take apart. On a real PECO bill, the filed rate sheet turns out to price only about half of what you actually pay. The other half is generation and transmission, filed separately.

Ratebook is an open-source integration that turns a real US tariff into two sensors:

  • sensor.ratebook_electricity_price: the current marginal price ($/kWh), with the full hourly schedule for today/tomorrow as attributes (the evcc-compatible shape).

  • sensor.ratebook_cheapest_charge_window: the start of the cheapest contiguous charge block in the next 24 hours (for EVs, batteries, water heaters).

It's a thin shell over a deterministic rate engine (pure functions, property-tested, cross-validated against NREL's PySAM). No cloud account and no API key. The engine and its data are bundled into the integration, so it installs with zero external dependencies.

Install (HACS custom repository):

  1. HACS → ⋮ → Custom repositories → add GitHub - cbetz/ratebook-homeassistant: Ratebook for Home Assistant — live US electricity-price & cheapest-charge-window sensors (HACS). Source: github.com/cbetz/ratebook · GitHub, category Integration.

  2. Install Ratebook, restart HA.

  3. Settings → Devices & Services → Add Integration → Ratebook. Pick one of the bundled real-utility plans, or paste your own tariff JSON, and set your charge-window length.

Source, the rate engine, an MCP server, the open dataset, and how I checked the rate-sheet-vs-bill gap (failure cases and all): GitHub - cbetz/ratebook: Open database of US electricity tariffs, a deterministic rate engine, and an MCP server — so any app, device, or agent can answer: what will this kWh cost, and when should I charge? · GitHub · This thread is the support
channel: post your utility and plan and I'll help get a tariff in. Tariff corrections especially
welcome.