An intelligent Home Assistant integration that optimizes your energy consumption based on Nordpool electricity prices. Automatically control thermostats and hot water heaters to minimize costs while maintaining comfort.
Originally based on the excellent nordpool custom component.
PriceAnalyzer analyzes hourly (or 15-minute) electricity prices from Nordpool and provides smart sensors that help you:
- Save money by shifting energy consumption to cheaper hours
- Optimize comfort by preheating during low-price periods
- Reduce environmental impact by using electricity when it's greenest (often correlates with price)
If you find this useful:
- Buy me a beer or a Ko-fi
- Support on Patreon
- Get 50 EUR off Tibber smart home gadgets (referral link)
- Thinking about a Tesla? Get discounts using my referral link
Provides intelligent temperature correction recommendations (±1°C) for your thermostats based on current and upcoming electricity prices.
How it works:
- Pre-heating: Increases temperature when prices are about to rise
- Energy saving: Reduces temperature during price peaks or when prices are falling
- Smart timing: Looks ahead at the next few hours to optimize comfort and cost
Sensor attributes include:
is_ten_cheapest/is_five_cheapest/is_two_cheapest- Boolean flags for cheapest hoursten_cheapest_today/five_cheapest_today/two_cheapest_today- Lists of cheapest hoursis_gaining/is_falling- Price trend indicatorsis_over_peak/is_over_average- Price level indicatorstemperature_correction- Recommended adjustment for your thermostat- Full price data for today and tomorrow
Calculates optimal water heater temperatures based on electricity prices to ensure you always have hot water while minimizing costs.
Default temperature strategy:
- 75°C - Default and minimum price hours (always hot water)
- 70°C - Five cheapest hours
- 65°C - Ten cheapest hours
- 60°C - Low price hours
- 50°C - Normal hours and falling prices
- 40°C - Five most expensive hours (minimum safe temperature)
You can customize all these temperatures in the integration settings to match your hot water heater capacity, insulation, and household usage patterns.
Binary mode: Can also be configured as simple ON/OFF if you don't have temperature control.
Displays the current electricity price with your configured additional costs (grid fees, taxes, etc.) applied.
- Open HACS in your Home Assistant
- Click the three dots (⋮) in the top right corner
- Select Custom repositories
- Add this repository URL:
https://github.com/erlendsellie/priceanalyzer/ - Select Integration as the category
- Click Add
- Search for "PriceAnalyzer" and click Download
- Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration → Search for "PriceAnalyzer"
- Copy the
custom_components/priceanalyzerfolder to your Home Assistantconfig/custom_components/directory - Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration → Search for "PriceAnalyzer"
When adding the integration through the UI, you'll configure:
Step 1: Basic Settings
- Friendly name (optional): Custom name to distinguish multiple setups
- Region: Your Nordpool price area (e.g., NO1, NO2, SE3, DK1, etc.)
- Currency: Your preferred currency (auto-detected based on region)
- Include VAT: Whether to include VAT in prices
- Time resolution:
hourly- Standard hourly prices (default)quarterly- 15-minute price intervals (for compatible regions)
Step 2: Price Settings
- Price type: Display as kWh, MWh, or Wh
- Show in cents: Display prices in cents/øre instead of currency
- Low price cutoff: Multiplier for determining "low price" (default: 1.0 = average price)
- Additional costs template: Jinja2 template for grid fees, taxes, etc.
- Example:
{{0.50|float}}adds 0.50 to the price - Example:
{{current_price * 0.25}}adds 25% markup
- Example:
Step 3: Advanced Settings
- Multiply template: Adjustment factor for temperature correction
- Hours to boost/save: Look-ahead window for price trends
- Percent difference: Minimum price variation threshold
- Price before active: Minimum price to activate features
Step 4: Hot Water Temperature Settings Configure target temperatures for different price scenarios:
- Default temperature: Normal operating temperature (default: 75°C)
- Five most expensive hours: Minimum temperature during peaks (default: 40°C)
- Price falling: Temperature when price is declining (default: 50°C)
- Five cheapest hours: Maximum temperature for cheap hours (default: 70°C)
- Ten cheapest hours: Temperature for top 10 cheap hours (default: 65°C)
- Low price hours: Temperature below average price (default: 60°C)
- Normal hours: Temperature for average prices (default: 50°C)
- Minimum price: Temperature at lowest daily price (default: 75°C)
For binary control: Use values like 1.0 (ON) and 0.0 (OFF) instead of temperatures.
You can create multiple PriceAnalyzer integrations for the same region with different configurations. This is useful for:
- Different additional costs calculations
- Separate hot water heater configurations
- Testing different strategies
- Multiple households/installations
Each setup is identified by its friendly name and creates its own set of sensors.
To change settings after initial setup:
- Go to Settings → Devices & Services
- Find your PriceAnalyzer integration
- Click Configure
- Make your changes in the multi-step menu
Use PriceAnalyzer to automatically adjust your thermostat based on electricity prices:
Step 1: Create an Input Number helper to store your base temperature
- Click here to create:
- Name it something like "Living Room Base Temperature"
- Set min/max values appropriate for your climate (e.g., 18-24°C)
Step 2: Import the Climate Control Blueprint
- Click here:
- Select your input number, PriceAnalyzer sensor, and climate entity
- The automation will adjust your thermostat by ±1°C based on price trends
How it works:
- When prices are about to rise → Pre-heats your home
- During price peaks → Reduces temperature slightly
- When prices are falling → Lowers temperature to save energy
- Your base temperature remains in your input number for manual control
Use PriceAnalyzer to optimize hot water heating costs:
Import the Hot Water Blueprint:
- Select your VVBSensor and hot water heater thermostat/switch
- The automation sets the appropriate temperature based on current price conditions
- Ensures hot water availability while minimizing heating costs
Using cheapest hours attributes in automations:
# Example: Run dishwasher during cheapest hours
automation:
- trigger:
- platform: template
value_template: >
{{ state_attr('sensor.priceanalyzer_no3', 'current_hour')['is_two_cheapest'] }}
action:
- service: switch.turn_on
target:
entity_id: switch.dishwasherCustom templates with additional costs:
The additional costs template receives current_price as a variable:
# Add fixed grid fee + 25% tax
{{ (current_price + 0.50) * 1.25 }}
# Time-based additional costs
{% if now().hour >= 6 and now().hour < 22 %}
{{ current_price + 0.40 }} {# Day tariff #}
{% else %}
{{ current_price + 0.20 }} {# Night tariff #}
{% endif %}If you're experiencing issues, enable debug logging to see detailed information:
Via UI (Recommended):
- Go to Settings → System → Logs
- Click Configure for
custom_components.priceanalyzer - Set level to Debug
Via configuration.yaml:
logger:
default: info
logs:
custom_components.priceanalyzer: debug
nordpool: debug # For API communication issues- Wiki: https://github.com/erlendsellie/priceanalyzer/wiki
- Issues: https://github.com/erlendsellie/priceanalyzer/issues
- Discussions: Use GitHub Discussions for questions
Originally based on the excellent nordpool custom component.
MIT License - See LICENSE file for details

