hacs_badge GitHub Release License
A comprehensive Home Assistant integration for Estonian electricity prices using real-time data from the Elering API (Nord Pool spot prices).
- โก Real-time pricing - Current electricity price updated hourly
- ๐ Smart pricing in cents/kWh - Easy-to-understand pricing (configurable)
- ๐ถ Automatic VAT calculation - Estonia's 22% VAT included by default
- ๐ฐ Additional costs support - Add network fees or other charges
- ๐ฎ Tomorrow's prices - Next day prices (available after 1 PM)
- ๐ฏ is_cheap - Boolean indicating if current price is below daily average
- ๐ price_percent_to_average - How current price compares to daily average (%)
- ๐ price_rank - Current price ranking (e.g., "5/24" = 5th cheapest hour)
- ๐ Statistics - Min, max, average, median prices for today and tomorrow
- ๐ Peak/off-peak averages - Separate averages for peak (7-23) and off-peak hours
- ๐ซ No API key required - Uses public Elering API
- ๐ Auto-updates - Refreshes every hour
- ๐พ Database optimized - Large price arrays excluded from recorder
- โ๏ธ UI configuration - Easy setup through Home Assistant UI
- ๐๏ธ Configurable precision - Choose decimal places (0-6)
-
Copy the
elering_eefolder to yourconfig/custom_components/directory:config/ โโโ custom_components/ โโโ elering_ee/ โโโ __init__.py โโโ config_flow.py โโโ const.py โโโ manifest.json โโโ sensor.py โโโ README.md -
Restart Home Assistant
-
Go to Settings โ Devices & Services โ Add Integration
-
Search for "Elering Estonia" and configure:
- VAT rate: 0.22 (22%, default for Estonia)
- Price in cents: Yes (shows c/kWh) or No (shows โฌ/MWh)
- Additional costs: Any fixed costs in EUR/MWh (e.g., network fees)
- Precision: Number of decimal places (default: 2)
You can still use YAML, but UI configuration is recommended:
sensor: - platform: elering_ee
Then configure via UI as described above.
| Setting | Default | Description |
|---|---|---|
| VAT | 0.22 (22%) | Estonia's VAT rate on electricity |
| Price in cents | Yes | Show price as c/kWh (easier to read) vs โฌ/MWh |
| Additional costs | 0.0 | Add network fees or other charges (in EUR/MWh) |
| Precision | 2 | Decimal places to display |
Home user with network fees:
- VAT: 0.22
- Price in cents: Yes
- Additional costs: 35.0 (EUR/MWh network fee)
- Result: ~12.5 c/kWh (spot price + VAT + network fee)
Business user without VAT:
- VAT: 0.0
- Price in cents: No
- Additional costs: 0.0
- Result: Shows raw spot price in EUR/MWh
After setup, you'll have: sensor.elering_ee_electricity_price
State: Current electricity price (in c/kWh or โฌ/MWh based on config)
# Price Intelligence is_cheap: true # Is price below average? price_percent_to_average: 87.3 # Current price vs daily average price_rank: "5/24" # 5th cheapest hour of the day # Statistics - Today average: 12.45 # Average price today min: 8.32 # Minimum price today max: 18.67 # Maximum price today median: 11.98 # Median price today peak_average: 13.21 # Average during peak hours (7-23) off_peak_average: 9.87 # Average during off-peak (23-7) # Statistics - Tomorrow tomorrow_valid: true # Are tomorrow's prices available? average_tomorrow: 11.23 # Average price tomorrow min_tomorrow: 7.45 # Minimum price tomorrow max_tomorrow: 16.34 # Maximum price tomorrow # Price Arrays prices_today: # Hourly prices for today - time: "00:00" price: 9.32 - time: "01:00" price: 8.87 # ... (24 hours) prices_tomorrow: # Hourly prices for tomorrow - time: "00:00" price: 10.12 # ... (24 hours, available after ~13:00) # Configuration Info vat_rate: 0.22 additional_costs: 35.0 unit: "c/kWh" currency: "EUR" last_updated: "2024ๅนด01ๆ15ๆฅT14:30:00"
automation: - alias: "Cheap Electricity Alert" trigger: - platform: state entity_id: sensor.elering_ee_electricity_price attribute: is_cheap to: true action: - service: notify.notify data: title: "โก Electricity is Cheap!" message: > Current price: {{ states('sensor.elering_ee_electricity_price') }} c/kWh ({{ state_attr('sensor.elering_ee_electricity_price', 'price_percent_to_average') }}% of average)
automation: - alias: "Run Dishwasher When Cheap" trigger: - platform: time_pattern hours: "*" condition: - condition: template value_template: > {{ state_attr('sensor.elering_ee_electricity_price', 'price_rank').split('/')[0]|int <= 5 }} action: - service: switch.turn_on target: entity_id: switch.dishwasher
automation: - alias: "Charge EV During Cheap Night Hours" trigger: - platform: time_pattern hours: "*" condition: - condition: time after: "22:00" before: "06:00" - condition: numeric_state entity_id: sensor.elering_ee_electricity_price below: 10 # Below 10 c/kWh action: - service: switch.turn_on target: entity_id: switch.ev_charger
automation: - alias: "Daily Electricity Price Summary" trigger: - platform: time at: "07:00" action: - service: notify.notify data: title: "๐ Today's Electricity Prices" message: > Average: {{ state_attr('sensor.elering_ee_electricity_price', 'average') }} c/kWh Min: {{ state_attr('sensor.elering_ee_electricity_price', 'min') }} c/kWh Max: {{ state_attr('sensor.elering_ee_electricity_price', 'max') }} c/kWh Peak hours avg: {{ state_attr('sensor.elering_ee_electricity_price', 'peak_average') }} c/kWh
type: entity entity: sensor.elering_ee_electricity_price name: Electricity Price icon: mdi:flash
type: entities title: โก Electricity Prices entities: - entity: sensor.elering_ee_electricity_price name: Current Price icon: mdi:flash - type: divider - type: attribute entity: sensor.elering_ee_electricity_price attribute: is_cheap name: Is Cheap? icon: mdi:tag - type: attribute entity: sensor.elering_ee_electricity_price attribute: price_rank name: Price Rank icon: mdi:podium - type: divider - type: attribute entity: sensor.elering_ee_electricity_price attribute: average name: Average Today suffix: c/kWh - type: attribute entity: sensor.elering_ee_electricity_price attribute: min name: Min Today suffix: c/kWh - type: attribute entity: sensor.elering_ee_electricity_price attribute: max name: Max Today suffix: c/kWh
type: custom:apexcharts-card header: title: Electricity Prices show: true graph_span: 2d span: start: day series: - entity: sensor.elering_ee_electricity_price name: Today data_generator: | return entity.attributes.prices_today.map((item) => { return [new Date().setHours(item.time.split(':')[0], 0, 0, 0), item.price]; }); - entity: sensor.elering_ee_electricity_price name: Tomorrow data_generator: | return entity.attributes.prices_tomorrow?.map((item) => { const tomorrow = new Date(); tomorrow.setDate(tomorrow.getDate() + 1); return [tomorrow.setHours(item.time.split(':')[0], 0, 0, 0), item.price]; }) || [];
- API: Elering (Estonian TSO) - https://dashboard.elering.ee/api/nps/price
- Data: Nord Pool spot prices for Estonia (EE price zone)
- Update frequency: Every hour
- API Key: Not required (public API)
Final Price = (Spot Price รใฐใค (1 + VAT)) + Additional Costs
If "Price in cents" is enabled:
Final Price (c/kWh) = Final Price (EUR/MWh) / 10
Example:
- Spot price: 100 EUR/MWh
- VAT: 22% (0.22)
- Additional costs: 35 EUR/MWh
- Result: (100 รใฐใค 1.22) + 35 = 157 EUR/MWh = 15.7 c/kWh
Large price arrays (prices_today, prices_tomorrow, raw_today, raw_tomorrow) are excluded from the Home Assistant database to save space while remaining accessible via attributes.
- Check Home Assistant logs for errors
- Verify internet connection
- Elering API may be temporarily unavailable
- Tomorrow's prices are published around 13:00-14:00 CET
- Before that time,
tomorrow_validwill befalse
- Verify VAT rate (Estonia: 22%)
- Check additional costs configuration
- Ensure correct unit selection (c/kWh vs EUR/MWh)
- Issues: Please report bugs or feature requests on GitHub
- Data source: Elering API documentation
- License: MIT
Data provided by Elering (Estonian TSO) via their public API.
Made with โก in Estonia