An electricity price integration for Home Assistant from Selectra.
Turn your devices on and off based on the real-time price of electricity. Perfect for off-peak schedules, demand-response programs, and dynamic pricing offers.
This integration is currently in beta. We are actively developing new features and improving reliability. We'd love your feedback โ whether it's a bug report, a feature request, or just an idea. Don't hesitate to open an issue or start a discussion!
- Real-time electricity pricing โ Access current and upcoming electricity prices for your plan directly in Home Assistant.
- A ready-to-automate "Planned Run" signal โ A single binary sensor that turns
onwhen it's a good time to run your devices, whatever your tariff type. - Smart automations โ Trigger automations based on price thresholds, off-peak windows, or the cheapest upcoming hours.
- Massive coverage โ 80 countries, 2,000+ energy providers, and 16,000+ electricity plans supported today.
- Always free โ This integration is and will remain free to use.
| Current | Goal (end of 2026) | |
|---|---|---|
| Countries | 80 | Worldwide |
| Energy providers | 2,000+ | All residential providers |
| Electricity plans | 16,000+ | Every residential plan |
Can't find your provider or plan? Open an issue and we'll look into adding it.
- Home Assistant 2025.12.0 or newer.
- A free Selectra API token โ see Data Source & API Access.
- Open HACS in Home Assistant.
- Search for Selectra and install it.
- Restart Home Assistant.
- Go to Settings โ Devices & Services โ Add Integration โ search for Selectra.
Not finding it? Go to HACS โ three-dot menu โ Custom repositories, paste
https://github.com/Selectra-Dev/selectra-haand select Integration.
- Download the latest release from the Releases page.
- Copy the
custom_components/selectrafolder into your Home Assistantconfig/custom_components/directory. - Restart Home Assistant.
- Go to Settings โ Devices & Services โ Add Integration โ search for Selectra.
Everything is configured through the Home Assistant UI โ no YAML required. After adding the integration you'll go through a short guided setup:
-
API token โ Paste your free Selectra API token (see below).
-
Qualification โ Identify your exact contract: country, postal code, electricity provider, offer, pricing option, subscribed power, and off-peak hours where applicable.
-
Behaviour โ For classic (multi-period) and dynamic plans, you'll then either:
- pick the active periods (classic plans, e.g. peak / off-peak), or
- choose an optimization strategy (dynamic plans).
Flat-rate plans skip this step โ the integration is ready as soon as qualification is done.
Need to change something later? Select the integration โ โฎ menu โ Reconfigure. This is Home Assistant's native reconfigure flow: it reuses your existing API token and re-runs qualification โ you won't be asked for the token again.
The integration adapts to your tariff. The Planned Run binary sensor turns on according to one of three modes:
| Mode | For which plans | When Planned Run is on |
|---|---|---|
| Flat | Single flat-rate tariffs | Always on (the price never changes). |
| Classic | Multi-period plans (e.g. peak / off-peak) | During the periods you selected at setup. |
| Dynamic | Dynamic / spot-price plans | During the cheapest hours, based on your chosen strategy. |
For dynamic plans, two strategies are available:
- Cheapest X% of the day โ the sensor is
onduring the cheapestX%of today's hours (e.g. the cheapest 30%). - Cheapest X consecutive hours โ the sensor is
onduring the single cheapest uninterrupted window ofXhours (great for EV charging or a dishwasher run).
Once configured, the integration creates the following entities:
| Entity | Type | Description |
|---|---|---|
| Planned Run | binary_sensor |
The core entity. on = good time to run your devices (see modes above). |
| Current Price | sensor |
The current electricity price per kWh, in your currency. |
| Provider | sensor (diagnostic) |
Your electricity provider. |
| Offer | sensor (diagnostic) |
Your offer/plan. Carries rich attributes (category, distributor, off-peak hours, featuresโฆ). |
| Option | sensor (diagnostic) |
Your pricing option. |
Exact entity IDs depend on your setup โ check them under Settings โ Devices & Services โ Selectra. The examples below use
binary_sensor.selectra_planned_runandsensor.selectra_current_price.
Planned Run exposes, among others:
current_period_name,current_price,currencynext_changeโ when the sensor will next switch on/offpricesโ the full list of upcoming price periods, each withname,price,start,end, andis_active. Ideal for building charts (see Visualization).
Current Price exposes period_name, period_start, period_end, and next_update.
Your entity IDs may differ from the examples below. Check the real IDs under Settings โ Devices & Services โ Selectra and adjust the automations and chart config accordingly.
Run your water heater during the planned (cheap) periods:
automation:
- alias: "Water heater โ cheap hours only"
trigger:
- platform: state
entity_id: binary_sensor.selectra_planned_run
to: "on"
action:
- action: switch.turn_on
target:
entity_id: switch.water_heater
- alias: "Water heater โ off outside cheap hours"
trigger:
- platform: state
entity_id: binary_sensor.selectra_planned_run
to: "off"
action:
- action: switch.turn_off
target:
entity_id: switch.water_heaterCharge the EV only when the price drops below a threshold:
automation:
- alias: "EV charging โ below 0.15 /kWh"
trigger:
- platform: numeric_state
entity_id: sensor.selectra_current_price
below: 0.15
action:
- action: switch.turn_on
target:
entity_id: switch.ev_chargerYou can plot today's prices using the prices attribute of the Planned Run sensor โ for example with the popular ApexCharts card:
type: custom:apexcharts-card
header:
title: Electricity prices today
series:
- entity: binary_sensor.selectra_planned_run
name: Price
type: column
data_generator: |
return entity.attributes.prices.map(p => [new Date(p.start).getTime(), p.price]);All electricity pricing data is provided by the Selectra Electricity Planning API.
This integration requires an API token. To get one:
- Visit the Selectra Electricity Planning API registration page.
- Follow the instructions to request your free API key.
- Paste the token during the integration's setup (first step).
Need help? Contact us at support.home-assistant@selectra.info.
"Reconfiguration Required" notification appears / entities show as unavailable.
Your contract details need to be refreshed (e.g. your provider changed something). Open Settings โ Devices & Services โ Selectra โ Reconfigure and re-run the setup. Entities come back automatically once reconfiguration succeeds.
"Invalid or missing API key" during setup. Double-check the token, or register for a free one at the API page. Still stuck? Email support.home-assistant@selectra.info.
"Too many requests" / rate limited. The Selectra API applies rate limits. Wait a few minutes and try again โ the integration also backs off automatically and retries on its own.
Current Price or Planned Run shows unknown / no data.
This can happen when no price data is available yet for the current day. The integration polls regularly and will populate the values as soon as data is published.
How often does it update?
Polling is dynamic: the integration follows the API's next_update hint (at most once a minute, ~every 15 minutes by default) and recalculates the Planned Run state locally at each period boundary โ so transitions are on time without hammering the API.
We welcome contributions of all kinds! Here's how you can help:
- ๐ Report bugs โ Open an issue with steps to reproduce.
- ๐ก Suggest features โ We're very open to ideas and requests. Tell us what would make this integration more useful for you.
- ๐ง Submit a PR โ Fork the repo, make your changes, and open a pull request.
This project is licensed under the Apache License 2.0.
Made with โก by Selectra