Skip to main content

Ratebook for Home Assistant

A Home Assistant custom integration that turns a Ratebook tariff into live electricity-price sensors and a cheapest-charge-window sensor — the price signal that EV chargers, evcc, EMHASS, and HA automations need to answer "what does a kWh cost right now, and when should I charge?"

It is a thin shell over the deterministic ratebook rate engine. The price math lives in the ratebook_ha package (unit-tested without Home Assistant); custom_components/ratebook is the HA binding (config flow, coordinator, sensors).

Entities

  • sensor.ratebook_electricity_price — the current marginal price ($/kWh). Attributes today / tomorrow carry the full hourly price schedule ({start, price} per hour), the shape evcc and price-aware automations consume.
  • sensor.ratebook_cheapest_charge_window — the start time of the cheapest contiguous charge block in the next 24 hours (timestamp). Attributes: end, avg_rate, hours.

Configuration

Add via Settings → Devices & Services → Add Integration → Ratebook. Pick a bundled example tariff (a generic time-of-use or flat residential plan) or paste a Ratebook tariff JSON, then set the charge-window length (hours) and currency.

A ready-made Lovelace dashboard (current price + hourly forecast chart + cheapest-charge-window) is in examples/dashboard.yaml.

Install

The integration is self-contained: the ratebook engine and ratebook_ha adapter are vendored under custom_components/ratebook/vendor/, so it has no PyPI or network dependencies.

Manual copy (works today): copy the custom_components/ratebook directory into your Home Assistant config/custom_components/ directory, restart Home Assistant, then add the integration via Settings → Devices & Services → Add Integration → Ratebook.

HACS: install from the distribution repo cbetz/ratebook-homeassistant — HACS → ⋮ → Custom repositories → add it as an Integration. That repo is a synced mirror of this directory with the root-level custom_components/ layout HACS requires (regenerate it with scripts/sync_dist_repo.sh).

Status: v0. Prices are the tariff's energy marginal price (time-of-use signal); demand charges and tier-vs-baseline position are not modeled — see the engine docs.

Metadata

Release files for ratebook-ha 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ratebook-ha 0.1.0
File Size Uploaded
ratebook_ha-0.1.0.tar.gz 96.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ratebook-ha 0.1.0
File Interpreter ABI Platform
ratebook_ha-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 120.0 kB

Release files / ratebook_ha-0.1.0.tar.gz

Download URL ratebook_ha-0.1.0.tar.gz
Size 96.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e434eec11bdf51e72e3f51b0aed9cffcd9ab62174f6e81f91cad68cd99e17715
BLAKE2b-256 checksum
How to use checksums
f9c05fb10c7478e6caa36c91db62b70127c80abff0ef8e751db0ccc02de2e663
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.4

Release files / ratebook_ha-0.1.0-py3-none-any.whl

Download URL ratebook_ha-0.1.0-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efbf5ece131a6a88a6ad247dde03678a50d54f8da69b0b1756c69b04c7928390
BLAKE2b-256 checksum
How to use checksums
8821b9ba5b62b9b69e47404cc182bd97ed5f6bae275d379b1e6e36acbfd845e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page