mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 05:13:40 +00:00
1 line
No EOL
113 KiB
JSON
1 line
No EOL
113 KiB
JSON
{"searchDocs":[{"title":"Core Concepts","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/concepts","content":"","keywords":"","version":"Next 🚧"},{"title":"Price Intervals","type":1,"pageTitle":"Core Concepts","url":"/hass.tibber_prices/user/concepts#price-intervals","content":" The integration works with quarter-hourly intervals (15 minutes): Each interval has a start time (e.g., 14:00, 14:15, 14:30, 14:45)Prices are fixed for the entire intervalSynchronized with Tibber's smart meter readings ","version":"Next 🚧","tagName":"h2"},{"title":"Price Ratings","type":1,"pageTitle":"Core Concepts","url":"/hass.tibber_prices/user/concepts#price-ratings","content":" Prices are automatically classified into rating levels: VERY_CHEAP - Exceptionally low prices (great for energy-intensive tasks)CHEAP - Below average prices (good for flexible loads)NORMAL - Around average prices (regular consumption)EXPENSIVE - Above average prices (reduce consumption if possible)VERY_EXPENSIVE - Exceptionally high prices (avoid heavy loads) Rating is based on statistical analysis comparing current price to: Daily averageTrailing 24-hour averageUser-configured thresholds ","version":"Next 🚧","tagName":"h2"},{"title":"Price Periods","type":1,"pageTitle":"Core Concepts","url":"/hass.tibber_prices/user/concepts#price-periods","content":" Best Price Periods and Peak Price Periods are automatically detected time windows: Best Price Period - Consecutive intervals with favorable prices (for scheduling energy-heavy tasks)Peak Price Period - Time windows with highest prices (to avoid or shift consumption) Periods can: Span multiple hoursCross midnight boundariesAdapt based on your configuration (flex, min_distance, rating levels) See Period Calculation for detailed configuration. ","version":"Next 🚧","tagName":"h2"},{"title":"Statistical Analysis","type":1,"pageTitle":"Core Concepts","url":"/hass.tibber_prices/user/concepts#statistical-analysis","content":" The integration enriches every interval with context: Trailing 24h Average - Average price over the last 24 hoursLeading 24h Average - Average price over the next 24 hoursPrice Difference - How much current price deviates from average (in %)Volatility - Price stability indicator (LOW, MEDIUM, HIGH) This helps you understand if current prices are exceptional or typical. ","version":"Next 🚧","tagName":"h2"},{"title":"Multi-Home Support","type":1,"pageTitle":"Core Concepts","url":"/hass.tibber_prices/user/concepts#multi-home-support","content":" You can add multiple Tibber homes to track prices for: Different locationsDifferent electricity contractsComparison between regions Each home gets its own set of sensors with unique entity IDs. 💡 Next Steps: Glossary - Detailed term definitionsSensors - How to use sensor dataAutomation Examples - Practical use cases ","version":"Next 🚧","tagName":"h2"},{"title":"Actions (Services)","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/actions","content":"","keywords":"","version":"Next 🚧"},{"title":"Available Actions","type":1,"pageTitle":"Actions (Services)","url":"/hass.tibber_prices/user/actions#available-actions","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"tibber_prices.get_chartdata","type":1,"pageTitle":"Actions (Services)","url":"/hass.tibber_prices/user/actions#tibber_pricesget_chartdata","content":" Purpose: Returns electricity price data in chart-friendly formats for visualization and analysis. Key Features: Flexible Output Formats: Array of objects or array of arraysTime Range Selection: Filter by day (yesterday, today, tomorrow)Price Filtering: Filter by price level or ratingPeriod Support: Return best/peak price period summaries instead of intervalsResolution Control: Interval (15-minute) or hourly aggregationCustomizable Field Names: Rename output fields to match your chart libraryCurrency Control: Major (EUR/NOK) or minor (ct/øre) units Basic Example: service: tibber_prices.get_chartdata data: entry_id: YOUR_ENTRY_ID day: ["today", "tomorrow"] output_format: array_of_objects response_variable: chart_data Response Format: { "data": [ { "start_time": "2025-11-17T00:00:00+01:00", "price_per_kwh": 0.2534 }, { "start_time": "2025-11-17T00:15:00+01:00", "price_per_kwh": 0.2498 } ] } Common Parameters: Parameter\tDescription\tDefaultentry_id\tIntegration entry ID (required)\t- day\tDays to include: yesterday, today, tomorrow\t["today", "tomorrow"] output_format\tarray_of_objects or array_of_arrays\tarray_of_objects resolution\tinterval (15-min) or hourly\tinterval minor_currency\tReturn prices in ct/øre instead of EUR/NOK\tfalse round_decimals\tDecimal places (0-10)\t4 (major) or 2 (minor) Rolling Window Mode: Omit the day parameter to get a dynamic 48-hour rolling window that automatically adapts to data availability: service: tibber_prices.get_chartdata data: entry_id: YOUR_ENTRY_ID # Omit 'day' for rolling window output_format: array_of_objects response_variable: chart_data Behavior: When tomorrow data available (typically after ~13:00): Returns today + tomorrowWhen tomorrow data not available: Returns yesterday + today This is useful for charts that should always show a 48-hour window without manual day selection. Period Filter Example: Get best price periods as summaries instead of intervals: service: tibber_prices.get_chartdata data: entry_id: YOUR_ENTRY_ID period_filter: best_price # or peak_price day: ["today", "tomorrow"] include_level: true include_rating_level: true response_variable: periods Advanced Filtering: service: tibber_prices.get_chartdata data: entry_id: YOUR_ENTRY_ID level_filter: ["VERY_CHEAP", "CHEAP"] # Only cheap periods rating_level_filter: ["LOW"] # Only low-rated prices insert_nulls: segments # Add nulls at segment boundaries Complete Documentation: For detailed parameter descriptions, open Developer Tools → Actions (the UI label) and select tibber_prices.get_chartdata. The inline documentation is still stored in services.yaml because actions are backed by services. ","version":"Next 🚧","tagName":"h3"},{"title":"tibber_prices.get_apexcharts_yaml","type":1,"pageTitle":"Actions (Services)","url":"/hass.tibber_prices/user/actions#tibber_pricesget_apexcharts_yaml","content":" ⚠️ IMPORTANT: This action generates a basic example configuration as a starting point, NOT a complete solution for all ApexCharts features. This integration is primarily a data provider. The generated YAML demonstrates how to use the get_chartdata action to fetch price data. Due to the segmented nature of our data (different time periods per series) and the use of Home Assistant's service API instead of entity attributes, many advanced ApexCharts features (like in_header, certain transformations) are not compatible or require manual customization. You are welcome to customize the generated YAML for your specific needs, but comprehensive ApexCharts configuration support is beyond the scope of this integration. Community contributions with improved configurations are always appreciated! For custom solutions: Use the get_chartdata action directly to build your own charts with full control over the data format and visualization. Purpose: Generates a basic ApexCharts card YAML configuration example for visualizing electricity prices with automatic color-coding by price level. Prerequisites: ApexCharts Card (required for all configurations)Config Template Card (required only for rolling window modes - enables dynamic Y-axis scaling) ✨ Key Features: Automatic Color-Coded Series: Separate series for each price level (VERY_CHEAP, CHEAP, NORMAL, EXPENSIVE, VERY_EXPENSIVE) or rating (LOW, NORMAL, HIGH)Dynamic Y-Axis Scaling: Rolling window modes automatically use chart_metadata sensor for optimal Y-axis boundsBest Price Period Highlights: Optional vertical bands showing detected best price periodsTranslated Labels: Automatically uses your Home Assistant language settingClean Gap Visualization: Proper NULL insertion for missing data segments Quick Example: service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID day: today # Optional: yesterday, today, tomorrow, rolling_window, rolling_window_autozoom level_type: rating_level # or "level" for 5-level classification highlight_best_price: true # Show best price period overlays response_variable: apexcharts_config Day Parameter Options: Fixed days (yesterday, today, tomorrow): Static 24-hour views, no additional dependenciesRolling Window (default when omitted or rolling_window): Dynamic 48-hour window that automatically shifts between yesterday+today and today+tomorrow based on data availability ✨ Includes dynamic Y-axis scaling via chart_metadata sensor Rolling Window (Auto-Zoom) (rolling_window_autozoom): Same as rolling window, but additionally zooms in progressively (2h lookback + remaining time until midnight, graph span decreases every 15 minutes) ✨ Includes dynamic Y-axis scaling via chart_metadata sensor Dynamic Y-Axis Scaling (Rolling Window Modes): Rolling window configurations automatically integrate with the chart_metadata sensor for optimal chart appearance: Automatic bounds: Y-axis min/max adjust to data rangeNo manual configuration: Works out of the box if sensor is enabledFallback behavior: If sensor is disabled, uses ApexCharts auto-scalingReal-time updates: Y-axis adapts when price data changes Example: Today's Prices (Static View) service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID day: today level_type: rating_level response_variable: config # Use in dashboard: type: custom:apexcharts-card # ... paste generated config Example: Rolling 48h Window (Dynamic View) service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID # Omit 'day' for rolling window (or use 'rolling_window') level_type: level # 5-level classification highlight_best_price: true response_variable: config # Use in dashboard: type: custom:config-template-card entities: - sensor.tibber_home_tomorrow_data - sensor.tibber_home_chart_metadata # For dynamic Y-axis card: # ... paste generated config Screenshots: Screenshots coming soon for all 4 modes: today, tomorrow, rolling_window, rolling_window_autozoom Level Type Options: rating_level (default): 3 series (LOW, NORMAL, HIGH) - based on your personal thresholdslevel: 5 series (VERY_CHEAP, CHEAP, NORMAL, EXPENSIVE, VERY_EXPENSIVE) - absolute price ranges Best Price Period Highlights: When highlight_best_price: true: Vertical bands overlay the chart showing detected best price periodsTooltip shows "Best Price Period" label when hovering over highlighted areasOnly appears when best price periods are configured and detected Important Notes: Config Template Card is only required for rolling window modes (enables dynamic Y-axis)Fixed day views (today, tomorrow, yesterday) work with ApexCharts Card aloneGenerated YAML is a starting point - customize colors, styling, features as neededAll labels are automatically translated to your Home Assistant language Use the response in Lovelace dashboards by copying the generated YAML. Documentation: Refer to Developer Tools → Actions for descriptions of the fields exposed by this action. ","version":"Next 🚧","tagName":"h3"},{"title":"tibber_prices.refresh_user_data","type":1,"pageTitle":"Actions (Services)","url":"/hass.tibber_prices/user/actions#tibber_pricesrefresh_user_data","content":" Purpose: Forces an immediate refresh of user data (homes, subscriptions) from the Tibber API. Example: service: tibber_prices.refresh_user_data data: entry_id: YOUR_ENTRY_ID Note: User data is cached for 24 hours. Trigger this action only when you need immediate updates (e.g., after changing Tibber subscriptions). ","version":"Next 🚧","tagName":"h3"},{"title":"Migration from Chart Data Export Sensor","type":1,"pageTitle":"Actions (Services)","url":"/hass.tibber_prices/user/actions#migration-from-chart-data-export-sensor","content":" If you're still using the sensor.tibber_home_chart_data_export sensor, consider migrating to the tibber_prices.get_chartdata action: Benefits: No HA restart required for configuration changesMore flexible filtering and formatting optionsBetter performance (on-demand instead of polling)Future-proof (active development) Migration Steps: Note your current sensor configuration (Step 7 in Options Flow)Create automation/script that calls tibber_prices.get_chartdata with the same parametersTest the new approachDisable the old sensor when satisfied ","version":"Next 🚧","tagName":"h2"},{"title":"Chart Examples","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/chart-examples","content":"","keywords":"","version":"Next 🚧"},{"title":"Overview","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#overview","content":" The integration can generate 4 different chart modes, each optimized for specific use cases: Mode\tDescription\tBest For\tDependenciesToday\tStatic 24h view of today's prices\tQuick daily overview\tApexCharts Card Tomorrow\tStatic 24h view of tomorrow's prices\tPlanning tomorrow\tApexCharts Card Rolling Window\tDynamic 48h view (today+tomorrow or yesterday+today)\tAlways-current overview\tApexCharts + Config Template Card Rolling Window Auto-Zoom\tDynamic view that zooms in as day progresses\tReal-time focus on remaining day\tApexCharts + Config Template Card Screenshots available for: ✅ Today (static) - Representative of all fixed day views✅ Rolling Window - Shows dynamic Y-axis scaling✅ Rolling Window Auto-Zoom - Shows progressive zoom effect ","version":"Next 🚧","tagName":"h2"},{"title":"All Chart Modes","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#all-chart-modes","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"1. Today's Prices (Static)","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#1-todays-prices-static","content":" When to use: Simple daily price overview, no dynamic updates needed. Dependencies: ApexCharts Card only Generate: service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID day: today level_type: rating_level highlight_best_price: true Screenshot: Key Features: ✅ Color-coded price levels (LOW, NORMAL, HIGH)✅ Best price period highlights (vertical bands)✅ Static 24-hour view (00:00 - 23:59)✅ Works with ApexCharts Card alone Note: Tomorrow view (day: tomorrow) works identically to Today view, just showing tomorrow's data. All fixed day views (yesterday/today/tomorrow) use the same visualization approach. ","version":"Next 🚧","tagName":"h3"},{"title":"2. Rolling 48h Window (Dynamic)","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#2-rolling-48h-window-dynamic","content":" When to use: Always-current view that automatically switches between yesterday+today and today+tomorrow. Dependencies: ApexCharts Card + Config Template Card Generate: service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID # Omit 'day' for rolling window level_type: rating_level highlight_best_price: true Screenshot: Key Features: ✅ Dynamic Y-axis scaling via chart_metadata sensor✅ Automatic data selection: today+tomorrow (when available) or yesterday+today✅ Always shows 48 hours of data✅ Updates automatically when tomorrow's data arrives✅ Color gradients for visual appeal How it works: Before ~13:00: Shows yesterday + todayAfter ~13:00: Shows today + tomorrowY-axis automatically adjusts to data range for optimal visualization ","version":"Next 🚧","tagName":"h3"},{"title":"3. Rolling Window Auto-Zoom (Dynamic)","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#3-rolling-window-auto-zoom-dynamic","content":" When to use: Real-time focus on remaining day - progressively zooms in as day advances. Dependencies: ApexCharts Card + Config Template Card Generate: service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID day: rolling_window_autozoom level_type: rating_level highlight_best_price: true Screenshot: Key Features: ✅ Progressive zoom: Graph span decreases every 15 minutes✅ Dynamic Y-axis scaling via chart_metadata sensor✅ Always shows: 2 hours lookback + remaining time until midnight✅ Perfect for real-time price monitoring✅ Example: At 18:00, shows 16:00 → 00:00 (8h window) How it works: 00:00: Shows full 48h window (same as rolling window)06:00: Shows 04:00 → midnight (20h window)12:00: Shows 10:00 → midnight (14h window)18:00: Shows 16:00 → midnight (8h window)23:45: Shows 21:45 → midnight (2.25h window) This creates a "zooming in" effect that focuses on the most relevant remaining time. ","version":"Next 🚧","tagName":"h3"},{"title":"Comparison: Level Type Options","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#comparison-level-type-options","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Rating Level (3 series)","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#rating-level-3-series","content":" Based on your personal price thresholds (configured in Options Flow): LOW (Green): Below your "cheap" thresholdNORMAL (Blue): Between thresholdsHIGH (Red): Above your "expensive" threshold Best for: Personal decision-making based on your budget ","version":"Next 🚧","tagName":"h3"},{"title":"Level (5 series)","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#level-5-series","content":" Based on absolute price ranges (calculated from daily min/max): VERY_CHEAP (Dark Green): Bottom 20%CHEAP (Light Green): 20-40%NORMAL (Blue): 40-60%EXPENSIVE (Orange): 60-80%VERY_EXPENSIVE (Red): Top 20% Best for: Objective price distribution visualization ","version":"Next 🚧","tagName":"h3"},{"title":"Dynamic Y-Axis Scaling","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#dynamic-y-axis-scaling","content":" Rolling window modes (2 & 3) automatically integrate with the chart_metadata sensor for optimal visualization: Without chart_metadata sensor (disabled): ┌─────────────────────┐ │ │ ← Lots of empty space │ ___ │ │ ___/ \\___ │ │_/ \\_ │ ├─────────────────────┤ 0 100 ct With chart_metadata sensor (enabled): ┌─────────────────────┐ │ ___ │ ← Y-axis fitted to data │ ___/ \\___ │ │_/ \\_ │ ├─────────────────────┤ 18 28 ct ← Optimal range Requirements: ✅ The sensor.tibber_home_chart_metadata must be enabled (it's enabled by default!)✅ That's it! The generated YAML automatically uses the sensor for dynamic scaling Important: Do NOT disable the chart_metadata sensor if you want optimal Y-axis scaling in rolling window modes! Note: Fixed day views (today, tomorrow) use ApexCharts' built-in auto-scaling and don't require the metadata sensor. ","version":"Next 🚧","tagName":"h2"},{"title":"Best Price Period Highlights","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#best-price-period-highlights","content":" When highlight_best_price: true, vertical bands overlay the chart showing detected best price periods: Example: Price │ 30│ ┌─────────┐ Normal prices │ │ │ 25│ ▓▓▓▓▓▓│ │ ← Best price period (shaded) │ ▓▓▓▓▓▓│ │ 20│─────▓▓▓▓▓▓│─────────│ │ ▓▓▓▓▓▓ └─────────────────────── Time 06:00 12:00 18:00 Features: Automatic detection based on your configuration (see Period Calculation Guide)Tooltip shows "Best Price Period" labelOnly appears when periods are configured and detectedCan be disabled with highlight_best_price: false ","version":"Next 🚧","tagName":"h2"},{"title":"Prerequisites","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#prerequisites","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Required for All Modes","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#required-for-all-modes","content":" ApexCharts Card: Core visualization library # Install via HACS HACS → Frontend → Search "ApexCharts Card" → Download ","version":"Next 🚧","tagName":"h3"},{"title":"Required for Rolling Window Modes Only","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#required-for-rolling-window-modes-only","content":" Config Template Card: Enables dynamic configuration # Install via HACS HACS → Frontend → Search "Config Template Card" → Download Note: Fixed day views (today, tomorrow) work with ApexCharts Card alone! ","version":"Next 🚧","tagName":"h3"},{"title":"Tips & Tricks","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#tips--tricks","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Customizing Colors","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#customizing-colors","content":" Edit the colors array in the generated YAML: apex_config: colors: - "#00FF00" # Change LOW/VERY_CHEAP color - "#0000FF" # Change NORMAL color - "#FF0000" # Change HIGH/VERY_EXPENSIVE color ","version":"Next 🚧","tagName":"h3"},{"title":"Changing Chart Height","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#changing-chart-height","content":" Add to the card configuration: type: custom:apexcharts-card graph_span: 48h header: show: true title: My Custom Title apex_config: chart: height: 400 # Adjust height in pixels ","version":"Next 🚧","tagName":"h3"},{"title":"Combining with Other Cards","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#combining-with-other-cards","content":" Wrap in a vertical stack for dashboard integration: type: vertical-stack cards: - type: entity entity: sensor.tibber_home_current_interval_price - type: custom:apexcharts-card # ... generated chart config ","version":"Next 🚧","tagName":"h3"},{"title":"Next Steps","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#next-steps","content":" Actions Guide: Complete documentation of get_apexcharts_yaml parametersChart Metadata Sensor: Learn about dynamic Y-axis scalingPeriod Calculation Guide: Configure best price period detection ","version":"Next 🚧","tagName":"h2"},{"title":"Screenshots","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#screenshots","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Gallery","type":1,"pageTitle":"Chart Examples","url":"/hass.tibber_prices/user/chart-examples#gallery","content":" Today View (Static) - Representative of all fixed day views (yesterday/today/tomorrow) Rolling Window (Dynamic) - Shows dynamic Y-axis scaling and 48h window Rolling Window Auto-Zoom (Dynamic) - Shows progressive zoom effect Note: Tomorrow view is visually identical to Today view (same chart type, just different data). ","version":"Next 🚧","tagName":"h3"},{"title":"Configuration","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/configuration","content":"","keywords":"","version":"Next 🚧"},{"title":"Initial Setup","type":1,"pageTitle":"Configuration","url":"/hass.tibber_prices/user/configuration#initial-setup","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Configuration Options","type":1,"pageTitle":"Configuration","url":"/hass.tibber_prices/user/configuration#configuration-options","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Price Thresholds","type":1,"pageTitle":"Configuration","url":"/hass.tibber_prices/user/configuration#price-thresholds","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Automation Examples","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/automation-examples","content":"","keywords":"","version":"Next 🚧"},{"title":"Table of Contents","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#table-of-contents","content":" Price-Based AutomationsVolatility-Aware AutomationsBest Hour DetectionApexCharts Cards ","version":"Next 🚧","tagName":"h2"},{"title":"Price-Based Automations","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#price-based-automations","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Volatility-Aware Automations","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#volatility-aware-automations","content":" These examples show how to handle low-volatility days where period classifications may flip at midnight despite minimal absolute price changes. ","version":"Next 🚧","tagName":"h2"},{"title":"Use Case: Only Act on High-Volatility Days","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#use-case-only-act-on-high-volatility-days","content":" On days with low price variation (< 15% volatility), the difference between "cheap" and "expensive" periods is minimal. This automation only runs appliances when the savings are meaningful: automation: - alias: "Dishwasher - Best Price (High Volatility Only)" description: "Start dishwasher during Best Price period, but only on days with meaningful price differences" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: # Only act if volatility > 15% (meaningful savings) - condition: numeric_state entity_id: sensor.tibber_home_volatility_today above: 15 # Optional: Ensure dishwasher is idle and door closed - condition: state entity_id: binary_sensor.dishwasher_door state: "off" action: - service: switch.turn_on target: entity_id: switch.dishwasher_smart_plug - service: notify.mobile_app data: message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ states('sensor.tibber_home_volatility_today') }}%)" Why this works: On high-volatility days (e.g., 25% span), Best Price periods save 5-10 ct/kWhOn low-volatility days (e.g., 8% span), savings are only 1-2 ct/kWhUser can manually start dishwasher on low-volatility days without automation interference ","version":"Next 🚧","tagName":"h3"},{"title":"Use Case: Absolute Price Threshold","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#use-case-absolute-price-threshold","content":" Instead of relying on relative classification, check if the absolute price is cheap enough: automation: - alias: "Water Heater - Cheap Enough" description: "Heat water when price is below absolute threshold, regardless of period classification" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: # Absolute threshold: Only run if < 20 ct/kWh - condition: numeric_state entity_id: sensor.tibber_home_current_interval_price_ct below: 20 # Optional: Check water temperature - condition: numeric_state entity_id: sensor.water_heater_temperature below: 55 # Only heat if below 55°C action: - service: switch.turn_on target: entity_id: switch.water_heater - delay: hours: 2 # Heat for 2 hours - service: switch.turn_off target: entity_id: switch.water_heater Why this works: Period classification can flip at midnight on low-volatility daysAbsolute threshold (20 ct/kWh) is stable across midnight boundaryUser sets their own "cheap enough" price based on local rates ","version":"Next 🚧","tagName":"h3"},{"title":"Use Case: Combined Volatility and Price Check","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#use-case-combined-volatility-and-price-check","content":" Most robust approach: Check both volatility and absolute price: automation: - alias: "EV Charging - Smart Strategy" description: "Charge EV using volatility-aware logic" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: # Check battery level - condition: numeric_state entity_id: sensor.ev_battery_level below: 80 # Strategy: High volatility OR cheap enough - condition: or conditions: # Path 1: High volatility day - trust period classification - condition: numeric_state entity_id: sensor.tibber_home_volatility_today above: 15 # Path 2: Low volatility but price is genuinely cheap - condition: numeric_state entity_id: sensor.tibber_home_current_interval_price_ct below: 18 action: - service: switch.turn_on target: entity_id: switch.ev_charger - service: notify.mobile_app data: message: > EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh (Volatility: {{ states('sensor.tibber_home_volatility_today') }}%) Why this works: On high-volatility days (> 15%): Trust the Best Price classificationOn low-volatility days (< 15%): Only charge if price is actually cheap (< 18 ct/kWh)Handles midnight flips gracefully: Continues charging if price stays cheap ","version":"Next 🚧","tagName":"h3"},{"title":"Use Case: Ignore Period Flips During Active Period","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#use-case-ignore-period-flips-during-active-period","content":" Prevent automations from stopping mid-cycle when a period flips at midnight: automation: - alias: "Washing Machine - Complete Cycle" description: "Start washing machine during Best Price, ignore midnight flips" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: # Only start if washing machine is idle - condition: state entity_id: sensor.washing_machine_state state: "idle" # And volatility is meaningful - condition: numeric_state entity_id: sensor.tibber_home_volatility_today above: 15 action: - service: button.press target: entity_id: button.washing_machine_eco_program # Create input_boolean to track active cycle - service: input_boolean.turn_on target: entity_id: input_boolean.washing_machine_auto_started # Separate automation: Clear flag when cycle completes - alias: "Washing Machine - Cycle Complete" trigger: - platform: state entity_id: sensor.washing_machine_state to: "finished" condition: # Only clear flag if we auto-started it - condition: state entity_id: input_boolean.washing_machine_auto_started state: "on" action: - service: input_boolean.turn_off target: entity_id: input_boolean.washing_machine_auto_started - service: notify.mobile_app data: message: "Washing cycle complete" Why this works: Uses input_boolean to track auto-started cyclesWon't trigger multiple times if period flips during the 2-3 hour wash cycleOnly triggers on "off" → "on" transitions, not during "on" → "on" continuity ","version":"Next 🚧","tagName":"h3"},{"title":"Use Case: Per-Period Day Volatility","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#use-case-per-period-day-volatility","content":" The simplest approach: Use the period's day volatility attribute directly: automation: - alias: "Heat Pump - Smart Heating" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: # Check if the PERIOD'S DAY has meaningful volatility - condition: template value_template: > {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} action: - service: climate.set_temperature target: entity_id: climate.heat_pump data: temperature: 22 # Boost temperature during cheap period Available per-period attributes: day_volatility_%: Percentage volatility of the period's day (e.g., 8.2 for 8.2%)day_price_min: Minimum price of the day in minor currency (ct/øre)day_price_max: Maximum price of the day in minor currency (ct/øre)day_price_span: Absolute difference (max - min) in minor currency (ct/øre) These attributes are available on both binary_sensor.tibber_home_best_price_period and binary_sensor.tibber_home_peak_price_period. Why this works: Each period knows its day's volatilityNo need to query separate sensorsTemplate checks if saving is meaningful (> 15% volatility) ","version":"Next 🚧","tagName":"h3"},{"title":"Best Hour Detection","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#best-hour-detection","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"ApexCharts Cards","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#apexcharts-cards","content":" ⚠️ IMPORTANT: The tibber_prices.get_apexcharts_yaml service generates a basic example configuration as a starting point. It is NOT a complete solution for all ApexCharts features. This integration is primarily a data provider. Due to technical limitations (segmented time periods, service API usage), many advanced ApexCharts features require manual customization or may not be compatible. For advanced customization: Use the get_chartdata service directly to build charts tailored to your specific needs. Community contributions with improved configurations are welcome! The tibber_prices.get_apexcharts_yaml service generates basic ApexCharts card configuration examples for visualizing electricity prices. ","version":"Next 🚧","tagName":"h2"},{"title":"Prerequisites","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#prerequisites","content":" Required: ApexCharts Card - Install via HACS Optional (for rolling window mode): Config Template Card - Install via HACS ","version":"Next 🚧","tagName":"h3"},{"title":"Installation","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#installation","content":" Open HACS → FrontendSearch for "ApexCharts Card" and install(Optional) Search for "Config Template Card" and install if you want rolling window mode ","version":"Next 🚧","tagName":"h3"},{"title":"Example: Fixed Day View","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#example-fixed-day-view","content":" # Generate configuration via automation/script service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID day: today # or "yesterday", "tomorrow" level_type: rating_level # or "level" for 5-level view response_variable: apexcharts_config Then copy the generated YAML into your Lovelace dashboard. ","version":"Next 🚧","tagName":"h3"},{"title":"Example: Rolling 48h Window","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#example-rolling-48h-window","content":" For a dynamic chart that automatically adapts to data availability: service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID day: rolling_window # Or omit for same behavior (default) level_type: rating_level response_variable: apexcharts_config Behavior: When tomorrow data available (typically after ~13:00): Shows today + tomorrowWhen tomorrow data not available: Shows yesterday + todayFixed 48h span: Always shows full 48 hours Auto-Zoom Variant: For progressive zoom-in throughout the day: service: tibber_prices.get_apexcharts_yaml data: entry_id: YOUR_ENTRY_ID day: rolling_window_autozoom level_type: rating_level response_variable: apexcharts_config Same data loading as rolling windowProgressive zoom: Graph span starts at ~26h in the morning and decreases to ~14h by midnightUpdates every 15 minutes: Always shows 2h lookback + remaining time until midnight Note: Rolling window modes require Config Template Card to dynamically adjust the time range. ","version":"Next 🚧","tagName":"h3"},{"title":"Features","type":1,"pageTitle":"Automation Examples","url":"/hass.tibber_prices/user/automation-examples#features","content":" Color-coded price levels/ratings (green = cheap, yellow = normal, red = expensive)Best price period highlighting (semi-transparent green overlay)Automatic NULL insertion for clean gapsTranslated labels based on your Home Assistant languageInteractive zoom and panLive marker showing current time ","version":"Next 🚧","tagName":"h3"},{"title":"FAQ - Frequently Asked Questions","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/faq","content":"","keywords":"","version":"Next 🚧"},{"title":"General Questions","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#general-questions","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Why don't I see tomorrow's prices yet?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#why-dont-i-see-tomorrows-prices-yet","content":" Tomorrow's prices are published by Tibber around 13:00 CET (12:00 UTC in winter, 11:00 UTC in summer). Before publication: Sensors show unavailable or use today's dataAfter publication: Integration automatically fetches new data within 15 minutesNo manual refresh needed - polling happens automatically ","version":"Next 🚧","tagName":"h3"},{"title":"How often does the integration update data?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#how-often-does-the-integration-update-data","content":" API Polling: Every 15 minutesSensor Updates: On quarter-hour boundaries (00, 15, 30, 45 minutes)Cache: Price data cached until midnight (reduces API load) ","version":"Next 🚧","tagName":"h3"},{"title":"Can I use multiple Tibber homes?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#can-i-use-multiple-tibber-homes","content":" Yes! Use the "Add another home" option: Settings → Devices & Services → Tibber PricesClick "Configure" → "Add another home"Select additional home from dropdownEach home gets separate sensors with unique entity IDs ","version":"Next 🚧","tagName":"h3"},{"title":"Does this work without a Tibber subscription?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#does-this-work-without-a-tibber-subscription","content":" No, you need: Active Tibber electricity contractAPI token from developer.tibber.com The integration is free, but requires Tibber as your electricity provider. ","version":"Next 🚧","tagName":"h3"},{"title":"Configuration Questions","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#configuration-questions","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"What are good values for price thresholds?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#what-are-good-values-for-price-thresholds","content":" Default values work for most users: High Price Threshold: 30% above averageLow Price Threshold: 15% below average Adjust if: You're in a market with high volatility → increase thresholdsYou want more sensitive ratings → decrease thresholdsSeasonal changes → review every few months ","version":"Next 🚧","tagName":"h3"},{"title":"How do I optimize Best Price Period detection?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#how-do-i-optimize-best-price-period-detection","content":" Key parameters: Flex: 15-20% is optimal (default 15%)Min Distance: 5-10% recommended (default 5%)Rating Levels: Start with "CHEAP + VERY_CHEAP" (default)Relaxation: Keep enabled (helps find periods on expensive days) See Period Calculation for detailed tuning guide. ","version":"Next 🚧","tagName":"h3"},{"title":"Why do I sometimes only get 1 period instead of 2?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#why-do-i-sometimes-only-get-1-period-instead-of-2","content":" This happens on high-price days when: Few intervals meet your criteriaRelaxation is disabledFlex is too lowMin Distance is too strict Solutions: Enable relaxation (recommended)Increase flex to 20-25%Reduce min_distance to 3-5%Add more rating levels (include "NORMAL") ","version":"Next 🚧","tagName":"h3"},{"title":"Troubleshooting","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#troubleshooting","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Sensors show \"unavailable\"","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#sensors-show-unavailable","content":" Common causes: API Token invalid → Check token at developer.tibber.comNo internet connection → Check HA networkTibber API down → Check status.tibber.comIntegration not loaded → Restart Home Assistant ","version":"Next 🚧","tagName":"h3"},{"title":"Best Price Period is ON all day","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#best-price-period-is-on-all-day","content":" This means all intervals meet your criteria (very cheap day!): Not an error - enjoy the low prices!Consider tightening filters (lower flex, higher min_distance)Or add automation to only run during first detected period ","version":"Next 🚧","tagName":"h3"},{"title":"Prices are in wrong currency","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#prices-are-in-wrong-currency","content":" Integration uses currency from your Tibber subscription: EUR → displays in ct/kWhNOK/SEK → displays in øre/kWh Cannot be changed (tied to your electricity contract). ","version":"Next 🚧","tagName":"h3"},{"title":"Tomorrow data not appearing at all","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#tomorrow-data-not-appearing-at-all","content":" Check: Your Tibber home has hourly price contract (not fixed price)API token has correct permissionsIntegration logs for API errors (/config/home-assistant.log)Tibber actually published data (check Tibber app) ","version":"Next 🚧","tagName":"h3"},{"title":"Automation Questions","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#automation-questions","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"How do I run dishwasher during cheap period?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#how-do-i-run-dishwasher-during-cheap-period","content":" automation: - alias: "Dishwasher during Best Price" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: - condition: time after: "20:00:00" # Only start after 8 PM action: - service: switch.turn_on target: entity_id: switch.dishwasher See Automation Examples for more recipes. ","version":"Next 🚧","tagName":"h3"},{"title":"Can I avoid peak prices automatically?","type":1,"pageTitle":"FAQ - Frequently Asked Questions","url":"/hass.tibber_prices/user/faq#can-i-avoid-peak-prices-automatically","content":" Yes! Use Peak Price Period binary sensor: automation: - alias: "Disable charging during peak prices" trigger: - platform: state entity_id: binary_sensor.tibber_home_peak_price_period to: "on" action: - service: switch.turn_off target: entity_id: switch.ev_charger 💡 Still need help? Troubleshooting GuideGitHub Issues ","version":"Next 🚧","tagName":"h3"},{"title":"Dashboard Examples","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/dashboard-examples","content":"","keywords":"","version":"Next 🚧"},{"title":"Basic Price Display Card","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#basic-price-display-card","content":" Simple card showing current price with dynamic color: type: entities title: Current Electricity Price entities: - entity: sensor.tibber_home_current_interval_price name: Current Price icon: mdi:flash - entity: sensor.tibber_home_current_interval_rating name: Price Rating - entity: sensor.tibber_home_next_interval_price name: Next Price ","version":"Next 🚧","tagName":"h2"},{"title":"Period Status Cards","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#period-status-cards","content":" Show when best/peak price periods are active: type: horizontal-stack cards: - type: entity entity: binary_sensor.tibber_home_best_price_period name: Best Price Active icon: mdi:currency-eur-off - type: entity entity: binary_sensor.tibber_home_peak_price_period name: Peak Price Active icon: mdi:alert ","version":"Next 🚧","tagName":"h2"},{"title":"Custom Button Card Examples","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#custom-button-card-examples","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Price Level Card","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#price-level-card","content":" type: custom:button-card entity: sensor.tibber_home_current_interval_level name: Price Level show_state: true styles: card: - background: | [[[ if (entity.state === 'LOWEST') return 'linear-gradient(135deg, #00ffa3 0%, #00d4ff 100%)'; if (entity.state === 'LOW') return 'linear-gradient(135deg, #4dddff 0%, #00ffa3 100%)'; if (entity.state === 'NORMAL') return 'linear-gradient(135deg, #ffd700 0%, #ffb800 100%)'; if (entity.state === 'HIGH') return 'linear-gradient(135deg, #ff8c00 0%, #ff6b00 100%)'; if (entity.state === 'HIGHEST') return 'linear-gradient(135deg, #ff4500 0%, #dc143c 100%)'; return 'var(--card-background-color)'; ]]] ","version":"Next 🚧","tagName":"h3"},{"title":"Lovelace Layouts","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#lovelace-layouts","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Compact Mobile View","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#compact-mobile-view","content":" Optimized for mobile devices: type: vertical-stack cards: - type: custom:mini-graph-card entities: - entity: sensor.tibber_home_current_interval_price name: Today's Prices hours_to_show: 24 points_per_hour: 4 - type: glance entities: - entity: sensor.tibber_home_best_price_start_time name: Best Period Starts - entity: binary_sensor.tibber_home_best_price_period name: Active Now ","version":"Next 🚧","tagName":"h3"},{"title":"Desktop Dashboard","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#desktop-dashboard","content":" Full-width layout for desktop: type: grid columns: 3 square: false cards: - type: custom:apexcharts-card # See chart-examples.md for ApexCharts config - type: vertical-stack cards: - type: entities title: Current Status entities: - sensor.tibber_home_current_interval_price - sensor.tibber_home_current_interval_rating - type: vertical-stack cards: - type: entities title: Statistics entities: - sensor.tibber_home_daily_avg_today - sensor.tibber_home_daily_min_today - sensor.tibber_home_daily_max_today ","version":"Next 🚧","tagName":"h3"},{"title":"Icon Color Integration","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#icon-color-integration","content":" Using the icon_color attribute for dynamic colors: type: custom:mushroom-chips-card chips: - type: entity entity: sensor.tibber_home_current_interval_price icon_color: "{{ state_attr('sensor.tibber_home_current_interval_price', 'icon_color') }}" - type: entity entity: binary_sensor.tibber_home_best_price_period icon_color: green - type: entity entity: binary_sensor.tibber_home_peak_price_period icon_color: red See Icon Colors for detailed color mapping. ","version":"Next 🚧","tagName":"h2"},{"title":"Picture Elements Dashboard","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#picture-elements-dashboard","content":" Advanced interactive dashboard: type: picture-elements image: /local/electricity_dashboard_bg.png elements: - type: state-label entity: sensor.tibber_home_current_interval_price style: top: 20% left: 50% font-size: 32px font-weight: bold - type: state-badge entity: binary_sensor.tibber_home_best_price_period style: top: 40% left: 30% # Add more elements... ","version":"Next 🚧","tagName":"h2"},{"title":"Auto-Entities Dynamic Lists","type":1,"pageTitle":"Dashboard Examples","url":"/hass.tibber_prices/user/dashboard-examples#auto-entities-dynamic-lists","content":" Automatically list all price sensors: type: custom:auto-entities card: type: entities title: All Price Sensors filter: include: - entity_id: "sensor.tibber_*_price" exclude: - state: unavailable sort: method: state numeric: true 💡 Related: Chart Examples - ApexCharts configurationsDynamic Icons - Icon behaviorIcon Colors - Color attributes ","version":"Next 🚧","tagName":"h2"},{"title":"Installation","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/installation","content":"","keywords":"","version":"Next 🚧"},{"title":"HACS Installation (Recommended)","type":1,"pageTitle":"Installation","url":"/hass.tibber_prices/user/installation#hacs-installation-recommended","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Manual Installation","type":1,"pageTitle":"Installation","url":"/hass.tibber_prices/user/installation#manual-installation","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Configuration","type":1,"pageTitle":"Installation","url":"/hass.tibber_prices/user/installation#configuration","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Glossary","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/glossary","content":"","keywords":"","version":"Next 🚧"},{"title":"A","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#a","content":" API Token: Your personal access key from Tibber. Get it at developer.tibber.com. Attributes: Additional data attached to each sensor (timestamps, statistics, metadata). Access via state_attr() in templates. ","version":"Next 🚧","tagName":"h2"},{"title":"B","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#b","content":" Best Price Period: Automatically detected time window with favorable electricity prices. Ideal for scheduling dishwashers, heat pumps, EV charging. Binary Sensor: Sensor with ON/OFF state (e.g., "Best Price Period Active"). Used in automations as triggers. ","version":"Next 🚧","tagName":"h2"},{"title":"C","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#c","content":" Currency Units: Minor currency units used for display (ct for EUR, øre for NOK/SEK). Integration handles conversion automatically. Coordinator: Home Assistant component managing data fetching and updates. Polls Tibber API every 15 minutes. ","version":"Next 🚧","tagName":"h2"},{"title":"D","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#d","content":" Dynamic Icons: Icons that change based on sensor state (e.g., battery icons showing price level). See Dynamic Icons. ","version":"Next 🚧","tagName":"h2"},{"title":"F","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#f","content":" Flex (Flexibility): Configuration parameter controlling how strict period detection is. Higher flex = more periods found, but potentially at higher prices. ","version":"Next 🚧","tagName":"h2"},{"title":"I","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#i","content":" Interval: 15-minute time slot with fixed electricity price (00:00-00:15, 00:15-00:30, etc.). ","version":"Next 🚧","tagName":"h2"},{"title":"L","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#l","content":" Level: Price classification within a day (LOWEST, LOW, NORMAL, HIGH, HIGHEST). Based on daily min/max prices. ","version":"Next 🚧","tagName":"h2"},{"title":"M","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#m","content":" Min Distance: Threshold requiring periods to be at least X% below daily average. Prevents detecting "cheap" periods during expensive days. ","version":"Next 🚧","tagName":"h2"},{"title":"P","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#p","content":" Peak Price Period: Time window with highest electricity prices. Use to avoid heavy consumption. Price Info: Complete dataset with all intervals (yesterday, today, tomorrow) including enriched statistics. ","version":"Next 🚧","tagName":"h2"},{"title":"Q","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#q","content":" Quarter-Hourly: 15-minute precision (4 intervals per hour, 96 per day). ","version":"Next 🚧","tagName":"h2"},{"title":"R","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#r","content":" Rating: Statistical price classification (VERY_CHEAP, CHEAP, NORMAL, EXPENSIVE, VERY_EXPENSIVE). Based on 24h averages and thresholds. Relaxation: Automatic loosening of period detection filters when target period count isn't met. Ensures you always get usable periods. ","version":"Next 🚧","tagName":"h2"},{"title":"S","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#s","content":" State: Current value of a sensor (e.g., price in ct/kWh, "ON"/"OFF" for binary sensors). State Class: Home Assistant classification for long-term statistics (MEASUREMENT, TOTAL, or none). ","version":"Next 🚧","tagName":"h2"},{"title":"T","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#t","content":" Trailing Average: Average price over the past 24 hours from current interval. Leading Average: Average price over the next 24 hours from current interval. ","version":"Next 🚧","tagName":"h2"},{"title":"V","type":1,"pageTitle":"Glossary","url":"/hass.tibber_prices/user/glossary#v","content":" Volatility: Measure of price stability (LOW, MEDIUM, HIGH). High volatility = large price swings = good for timing optimization. 💡 See Also: Core Concepts - In-depth explanationsSensors - How sensors use these conceptsPeriod Calculation - Deep dive into period detection ","version":"Next 🚧","tagName":"h2"},{"title":"Dynamic Icons","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/dynamic-icons","content":"","keywords":"","version":"Next 🚧"},{"title":"What are Dynamic Icons?","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#what-are-dynamic-icons","content":" Instead of having a fixed icon, some sensors update their icon to reflect their current state: Price level sensors show different cash/money icons depending on whether prices are cheap or expensivePrice rating sensors show thumbs up/down based on how the current price compares to averageVolatility sensors show different chart types based on price stabilityBinary sensors show different icons when ON vs OFF (e.g., piggy bank when in best price period) The icons change automatically - no configuration needed! ","version":"Next 🚧","tagName":"h2"},{"title":"How to Check if a Sensor Has Dynamic Icons","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#how-to-check-if-a-sensor-has-dynamic-icons","content":" To see which icon a sensor currently uses: Go to Developer Tools → States in Home AssistantSearch for your sensor (e.g., sensor.tibber_home_current_interval_price_level)Look at the icon displayed in the entity rowChange conditions (wait for price changes) and check if the icon updates Common sensor types with dynamic icons: Price level sensors (e.g., current_interval_price_level)Price rating sensors (e.g., current_interval_price_rating)Volatility sensors (e.g., volatility_today)Binary sensors (e.g., best_price_period, peak_price_period) ","version":"Next 🚧","tagName":"h2"},{"title":"Using Dynamic Icons in Your Dashboard","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#using-dynamic-icons-in-your-dashboard","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Standard Entity Cards","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#standard-entity-cards","content":" Dynamic icons work automatically in standard Home Assistant cards: type: entities entities: - entity: sensor.tibber_home_current_interval_price_level - entity: sensor.tibber_home_current_interval_price_rating - entity: sensor.tibber_home_volatility_today - entity: binary_sensor.tibber_home_best_price_period The icons will update automatically as the sensor states change. ","version":"Next 🚧","tagName":"h3"},{"title":"Glance Card","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#glance-card","content":" type: glance entities: - entity: sensor.tibber_home_current_interval_price_level name: Price Level - entity: sensor.tibber_home_current_interval_price_rating name: Rating - entity: binary_sensor.tibber_home_best_price_period name: Best Price ","version":"Next 🚧","tagName":"h3"},{"title":"Custom Button Card","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#custom-button-card","content":" type: custom:button-card entity: sensor.tibber_home_current_interval_price_level name: Current Price Level show_state: true # Icon updates automatically - no need to specify it! ","version":"Next 🚧","tagName":"h3"},{"title":"Mushroom Entity Card","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#mushroom-entity-card","content":" type: custom:mushroom-entity-card entity: sensor.tibber_home_volatility_today name: Price Volatility # Icon changes automatically based on volatility level ","version":"Next 🚧","tagName":"h3"},{"title":"Overriding Dynamic Icons","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#overriding-dynamic-icons","content":" If you want to use a fixed icon instead of the dynamic one: ","version":"Next 🚧","tagName":"h2"},{"title":"In Entity Cards","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#in-entity-cards","content":" type: entities entities: - entity: sensor.tibber_home_current_interval_price_level icon: mdi:lightning-bolt # Fixed icon, won't change ","version":"Next 🚧","tagName":"h3"},{"title":"In Custom Button Card","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#in-custom-button-card","content":" type: custom:button-card entity: sensor.tibber_home_current_interval_price_rating name: Price Rating icon: mdi:chart-line # Fixed icon overrides dynamic behavior show_state: true ","version":"Next 🚧","tagName":"h3"},{"title":"Combining with Dynamic Colors","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#combining-with-dynamic-colors","content":" Dynamic icons work great together with dynamic colors! See the Dynamic Icon Colors Guide for examples. Example: Dynamic icon AND color type: custom:button-card entity: sensor.tibber_home_current_interval_price_level name: Current Price show_state: true # Icon changes automatically (cheap/expensive cash icons) styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] This gives you both: ✅ Different icon based on state (e.g., cash-plus when cheap, cash-remove when expensive)✅ Different color based on state (e.g., green when cheap, red when expensive) ","version":"Next 🚧","tagName":"h2"},{"title":"Icon Behavior Details","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#icon-behavior-details","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Binary Sensors","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#binary-sensors","content":" Binary sensors may have different icons for different states: ON state: Typically shows an active/alert iconOFF state: May show different icons depending on whether future periods exist Has upcoming periods: Timer/waiting iconNo upcoming periods: Sleep/inactive icon Example: binary_sensor.tibber_home_best_price_period When ON: Shows a piggy bank (good time to save money)When OFF with future periods: Shows a timer (waiting for next period)When OFF without future periods: Shows a sleep icon (no periods expected soon) ","version":"Next 🚧","tagName":"h3"},{"title":"State-Based Icons","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#state-based-icons","content":" Sensors with text states (like cheap, normal, expensive) typically show icons that match the meaning: Lower/better values → More positive iconsHigher/worse values → More cautionary iconsNormal/average values → Neutral icons The exact icons are chosen to be intuitive and meaningful in the Home Assistant ecosystem. ","version":"Next 🚧","tagName":"h3"},{"title":"Troubleshooting","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#troubleshooting","content":" Icon not changing: Wait for the sensor state to actually change (prices update every 15 minutes)Check in Developer Tools → States that the sensor state is changingIf you've set a custom icon in your card, it will override the dynamic icon Want to see the icon code: Look at the entity in Developer Tools → StatesThe icon attribute shows the current Material Design icon code (e.g., mdi:cash-plus) Want different icons: You can override icons in your card configuration (see examples above)Or create a template sensor with your own icon logic ","version":"Next 🚧","tagName":"h2"},{"title":"See Also","type":1,"pageTitle":"Dynamic Icons","url":"/hass.tibber_prices/user/dynamic-icons#see-also","content":" Dynamic Icon Colors - Color your icons based on stateSensors Reference - Complete list of available sensorsAutomation Examples - Use dynamic icons in automations ","version":"Next 🚧","tagName":"h2"},{"title":"User Documentation","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/intro","content":"","keywords":"","version":"Next 🚧"},{"title":"📚 Documentation","type":1,"pageTitle":"User Documentation","url":"/hass.tibber_prices/user/intro#-documentation","content":" Installation - How to install via HACS and configure the integrationConfiguration - Setting up your Tibber API token and price thresholdsPeriod Calculation - How Best/Peak Price periods are calculated and configuredSensors - Available sensors, their states, and attributesDynamic Icons - State-based automatic icon changesDynamic Icon Colors - Using icon_color attribute for color-coded dashboardsActions - Custom actions (service endpoints) and how to use themChart Examples - ✨ ApexCharts visualizations with screenshotsAutomation Examples - Ready-to-use automation recipesTroubleshooting - Common issues and solutions ","version":"Next 🚧","tagName":"h2"},{"title":"🚀 Quick Start","type":1,"pageTitle":"User Documentation","url":"/hass.tibber_prices/user/intro#-quick-start","content":" Install via HACS (add as custom repository)Add Integration in Home Assistant → Settings → Devices & ServicesEnter Tibber API Token (get yours at developer.tibber.com)Configure Price Thresholds (optional, defaults work for most users)Start Using Sensors in automations, dashboards, and scripts! ","version":"Next 🚧","tagName":"h2"},{"title":"✨ Key Features","type":1,"pageTitle":"User Documentation","url":"/hass.tibber_prices/user/intro#-key-features","content":" Quarter-hourly precision - 15-minute intervals for accurate price trackingStatistical analysis - Trailing/leading 24h averages for contextPrice ratings - LOW/NORMAL/HIGH classification based on your thresholdsBest/Peak hour detection - Automatic detection of cheapest/peak periods with configurable filters (learn how)Beautiful ApexCharts - Auto-generated chart configurations with dynamic Y-axis scaling (see examples)Chart metadata sensor - Dynamic chart configuration for optimal visualizationMulti-currency support - EUR, NOK, SEK with proper minor units (ct, øre, öre) ","version":"Next 🚧","tagName":"h2"},{"title":"🔗 Useful Links","type":1,"pageTitle":"User Documentation","url":"/hass.tibber_prices/user/intro#-useful-links","content":" GitHub RepositoryIssue TrackerRelease NotesHome Assistant Community ","version":"Next 🚧","tagName":"h2"},{"title":"🤝 Need Help?","type":1,"pageTitle":"User Documentation","url":"/hass.tibber_prices/user/intro#-need-help","content":" Check the Troubleshooting GuideSearch existing issuesOpen a new issue if needed Note: These guides are for end users. If you want to contribute to development, see the Developer Documentation. ","version":"Next 🚧","tagName":"h2"},{"title":"Sensors","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/sensors","content":"","keywords":"","version":"Next 🚧"},{"title":"Binary Sensors","type":1,"pageTitle":"Sensors","url":"/hass.tibber_prices/user/sensors#binary-sensors","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Best Price Period & Peak Price Period","type":1,"pageTitle":"Sensors","url":"/hass.tibber_prices/user/sensors#best-price-period--peak-price-period","content":" These binary sensors indicate when you're in a detected best or peak price period. See the Period Calculation Guide for a detailed explanation of how these periods are calculated and configured. Quick overview: Best Price Period: Turns ON during periods with significantly lower prices than the daily averagePeak Price Period: Turns ON during periods with significantly higher prices than the daily average Both sensors include rich attributes with period details, intervals, relaxation status, and more. ","version":"Next 🚧","tagName":"h3"},{"title":"Core Price Sensors","type":1,"pageTitle":"Sensors","url":"/hass.tibber_prices/user/sensors#core-price-sensors","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Statistical Sensors","type":1,"pageTitle":"Sensors","url":"/hass.tibber_prices/user/sensors#statistical-sensors","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Rating Sensors","type":1,"pageTitle":"Sensors","url":"/hass.tibber_prices/user/sensors#rating-sensors","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Diagnostic Sensors","type":1,"pageTitle":"Sensors","url":"/hass.tibber_prices/user/sensors#diagnostic-sensors","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Chart Metadata","type":1,"pageTitle":"Sensors","url":"/hass.tibber_prices/user/sensors#chart-metadata","content":" Entity ID: sensor.tibber_home_NAME_chart_metadata ✨ New Feature: This sensor provides dynamic chart configuration metadata for optimal visualization. Perfect for use with the get_apexcharts_yaml action! This diagnostic sensor provides essential chart configuration values as sensor attributes, enabling dynamic Y-axis scaling and optimal chart appearance in rolling window modes. Key Features: Dynamic Y-Axis Bounds: Automatically calculates optimal yaxis_min and yaxis_max for your price dataAutomatic Updates: Refreshes when price data changes (coordinator updates)Lightweight: Metadata-only mode (no data processing) for fast responseState Indicator: Shows pending (initialization), ready (data available), or error (service call failed) Attributes: timestamp: When the metadata was last fetchedyaxis_min: Suggested minimum value for Y-axis (optimal scaling)yaxis_max: Suggested maximum value for Y-axis (optimal scaling)currency: Currency code (e.g., "EUR", "NOK")resolution: Interval duration in minutes (usually 15)error: Error message if service call failed Usage: The tibber_prices.get_apexcharts_yaml action automatically uses this sensor for dynamic Y-axis scaling in rolling_window and rolling_window_autozoom modes! No manual configuration needed - just enable the action's result with config-template-card and the sensor provides optimal Y-axis bounds automatically. See the Chart Examples Guide for practical examples! ","version":"Next 🚧","tagName":"h3"},{"title":"Chart Data Export","type":1,"pageTitle":"Sensors","url":"/hass.tibber_prices/user/sensors#chart-data-export","content":" Entity ID: sensor.tibber_home_NAME_chart_data_exportDefault State: Disabled (must be manually enabled) ⚠️ Legacy Feature: This sensor is maintained for backward compatibility. For new integrations, use the tibber_prices.get_chartdata service instead, which offers more flexibility and better performance. This diagnostic sensor provides cached chart-friendly price data that can be consumed by chart cards (ApexCharts, custom cards, etc.). Key Features: Configurable via Options Flow: Service parameters can be configured through the integration's options menu (Step 7 of 7)Automatic Updates: Data refreshes on coordinator updates (every 15 minutes)Attribute-Based Output: Chart data is stored in sensor attributes for easy accessState Indicator: Shows pending (before first call), ready (data available), or error (service call failed) Important Notes: ⚠️ Disabled by default - must be manually enabled in entity settings⚠️ Consider using the service instead for better control and flexibility⚠️ Configuration updates require HA restart Attributes: The sensor exposes chart data with metadata in attributes: timestamp: When the data was last fetchederror: Error message if service call faileddata (or custom name): Array of price data points in configured format Configuration: To configure the sensor's output format: Go to Settings → Devices & Services → Tibber PricesClick Configure on your Tibber homeNavigate through the options wizard to Step 7: Chart Data Export SettingsConfigure output format, filters, field names, and other optionsSave and restart Home Assistant Available Settings: See the tibber_prices.get_chartdata service documentation below for a complete list of available parameters. All service parameters can be configured through the options flow. Example Usage: # ApexCharts card consuming the sensor type: custom:apexcharts-card series: - entity: sensor.tibber_home_chart_data_export data_generator: | return entity.attributes.data; Migration Path: If you're currently using this sensor, consider migrating to the service: # Old approach (sensor) - service: apexcharts_card.update data: entity: sensor.tibber_home_chart_data_export # New approach (service) - service: tibber_prices.get_chartdata data: entry_id: YOUR_ENTRY_ID day: ["today", "tomorrow"] output_format: array_of_objects response_variable: chart_data ","version":"Next 🚧","tagName":"h3"},{"title":"Troubleshooting","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/troubleshooting","content":"","keywords":"","version":"Next 🚧"},{"title":"Common Issues","type":1,"pageTitle":"Troubleshooting","url":"/hass.tibber_prices/user/troubleshooting#common-issues","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Debug Logging","type":1,"pageTitle":"Troubleshooting","url":"/hass.tibber_prices/user/troubleshooting#debug-logging","content":" Coming soon... ","version":"Next 🚧","tagName":"h2"},{"title":"Getting Help","type":1,"pageTitle":"Troubleshooting","url":"/hass.tibber_prices/user/troubleshooting#getting-help","content":" Check existing issuesOpen a new issue with detailed informationInclude logs, configuration, and steps to reproduce ","version":"Next 🚧","tagName":"h2"},{"title":"Dynamic Icon Colors","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/icon-colors","content":"","keywords":"","version":"Next 🚧"},{"title":"What is icon_color?","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#what-is-icon_color","content":" The icon_color attribute contains a CSS variable name (not a direct color value) that changes based on the sensor's state. For example: Price level sensors: var(--success-color) for cheap, var(--error-color) for expensiveBinary sensors: var(--success-color) when in best price period, var(--error-color) during peak priceVolatility: var(--success-color) for low volatility, var(--error-color) for very high ","version":"Next 🚧","tagName":"h2"},{"title":"Why CSS Variables?","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#why-css-variables","content":" Using CSS variables like var(--success-color) instead of hardcoded colors (like #00ff00) has important advantages: ✅ Automatic theme adaptation - Colors change with light/dark mode✅ Consistent with your theme - Uses your theme's color scheme✅ Future-proof - Works with custom themes and future HA updates You can use the icon_color attribute directly in your card templates, or interpret the sensor state yourself if you prefer custom colors (see examples below). ","version":"Next 🚧","tagName":"h3"},{"title":"Which Sensors Support icon_color?","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#which-sensors-support-icon_color","content":" Many sensors provide the icon_color attribute for dynamic styling. To see if a sensor has this attribute: Go to Developer Tools → States in Home AssistantSearch for your sensor (e.g., sensor.tibber_home_current_interval_price_level)Look for icon_color in the attributes section Common sensor types with icon_color: Price level sensors (e.g., current_interval_price_level)Price rating sensors (e.g., current_interval_price_rating)Volatility sensors (e.g., volatility_today)Price trend sensors (e.g., price_trend_next_3h)Binary sensors (e.g., best_price_period, peak_price_period)Timing sensors (e.g., best_price_time_until_start, best_price_progress) The colors adapt to the sensor's state - cheaper prices typically show green, expensive prices red, and neutral states gray. ","version":"Next 🚧","tagName":"h2"},{"title":"When to Use icon_color vs. State Value","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#when-to-use-icon_color-vs-state-value","content":" Use icon_color when: ✅ You can apply the CSS variable directly (icons, text colors, borders)✅ Your card supports CSS variable substitution✅ You want simple, clean code without if/else logic Use the state value directly when: ⚠️ You need to convert the color (e.g., CSS variable → RGBA with transparency)⚠️ You need different colors than what icon_color provides⚠️ You're building complex conditional logic anyway Example of when NOT to use icon_color: # ❌ DON'T: Converting icon_color requires if/else anyway card: - background: | [[[ const color = entity.attributes.icon_color; if (color === 'var(--success-color)') return 'rgba(76, 175, 80, 0.1)'; if (color === 'var(--error-color)') return 'rgba(244, 67, 54, 0.1)'; // ... more if statements ]]] # ✅ DO: Interpret state directly if you need custom logic card: - background: | [[[ const level = entity.state; if (level === 'very_cheap' || level === 'cheap') return 'rgba(76, 175, 80, 0.1)'; if (level === 'very_expensive' || level === 'expensive') return 'rgba(244, 67, 54, 0.1)'; return 'transparent'; ]]] The advantage of icon_color is simplicity - if you need complex logic, you lose that advantage. ","version":"Next 🚧","tagName":"h2"},{"title":"How to Use icon_color in Your Dashboard","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#how-to-use-icon_color-in-your-dashboard","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Method 1: Custom Button Card (Recommended)","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#method-1-custom-button-card-recommended","content":" The custom:button-card from HACS supports dynamic icon colors. Example: Icon color only type: custom:button-card entity: sensor.tibber_home_current_interval_price_level name: Current Price Level show_state: true icon: mdi:cash styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] Example: Icon AND state value with same color type: custom:button-card entity: sensor.tibber_home_current_interval_price_level name: Current Price Level show_state: true icon: mdi:cash styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] state: - color: | [[[ return entity.attributes.icon_color || 'var(--primary-text-color)'; ]]] - font-weight: bold ","version":"Next 🚧","tagName":"h3"},{"title":"Method 2: Entities Card with card_mod","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#method-2-entities-card-with-card_mod","content":" Use Home Assistant's built-in entities card with card_mod for icon and state colors: type: entities entities: - entity: sensor.tibber_home_current_interval_price_level card_mod: style: hui-generic-entity-row: $: | state-badge { color: {{ state_attr('sensor.tibber_home_current_interval_price_level', 'icon_color') }} !important; } .info { color: {{ state_attr('sensor.tibber_home_current_interval_price_level', 'icon_color') }} !important; } ","version":"Next 🚧","tagName":"h3"},{"title":"Method 3: Mushroom Cards","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#method-3-mushroom-cards","content":" The Mushroom cards support card_mod for icon and text colors: Icon color only: type: custom:mushroom-entity-card entity: binary_sensor.tibber_home_best_price_period name: Best Price Period icon: mdi:piggy-bank card_mod: style: | ha-card { --card-mod-icon-color: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'icon_color') }}; } Icon and state value: type: custom:mushroom-entity-card entity: sensor.tibber_home_current_interval_price_level name: Price Level card_mod: style: | ha-card { --card-mod-icon-color: {{ state_attr('sensor.tibber_home_current_interval_price_level', 'icon_color') }}; --primary-text-color: {{ state_attr('sensor.tibber_home_current_interval_price_level', 'icon_color') }}; } ","version":"Next 🚧","tagName":"h3"},{"title":"Method 4: Glance Card with card_mod","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#method-4-glance-card-with-card_mod","content":" Combine multiple sensors with dynamic colors: type: glance entities: - entity: sensor.tibber_home_current_interval_price_level - entity: sensor.tibber_home_volatility_today - entity: binary_sensor.tibber_home_best_price_period card_mod: style: | ha-card div.entity:nth-child(1) state-badge { color: {{ state_attr('sensor.tibber_home_current_interval_price_level', 'icon_color') }} !important; } ha-card div.entity:nth-child(2) state-badge { color: {{ state_attr('sensor.tibber_home_volatility_today', 'icon_color') }} !important; } ha-card div.entity:nth-child(3) state-badge { color: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'icon_color') }} !important; } ","version":"Next 🚧","tagName":"h3"},{"title":"Complete Dashboard Example","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#complete-dashboard-example","content":" Here's a complete example combining multiple sensors with dynamic colors: type: vertical-stack cards: # Current price status - type: horizontal-stack cards: - type: custom:button-card entity: sensor.tibber_home_current_interval_price_level name: Price Level show_state: true styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] - type: custom:button-card entity: sensor.tibber_home_current_interval_price_rating name: Price Rating show_state: true styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] # Binary sensors for periods - type: horizontal-stack cards: - type: custom:button-card entity: binary_sensor.tibber_home_best_price_period name: Best Price Period show_state: true icon: mdi:piggy-bank styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] - type: custom:button-card entity: binary_sensor.tibber_home_peak_price_period name: Peak Price Period show_state: true icon: mdi:alert-circle styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] # Volatility and trends - type: horizontal-stack cards: - type: custom:button-card entity: sensor.tibber_home_volatility_today name: Volatility show_state: true styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] - type: custom:button-card entity: sensor.tibber_home_price_trend_next_3h name: Next 3h Trend show_state: true styles: icon: - color: | [[[ return entity.attributes.icon_color || 'var(--state-icon-color)'; ]]] ","version":"Next 🚧","tagName":"h2"},{"title":"CSS Color Variables","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#css-color-variables","content":" The integration uses Home Assistant's standard CSS variables for theme compatibility: var(--success-color) - Green (good/cheap/low)var(--info-color) - Blue (informational)var(--warning-color) - Orange (caution/expensive)var(--error-color) - Red (alert/very expensive/high)var(--state-icon-color) - Gray (neutral/normal)var(--disabled-color) - Light gray (no data/inactive) These automatically adapt to your theme's light/dark mode and custom color schemes. ","version":"Next 🚧","tagName":"h2"},{"title":"Using Custom Colors","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#using-custom-colors","content":" If you want to override the theme colors with your own, you have two options: Option 1: Use icon_color but Override in Your Theme Define custom colors in your theme configuration (themes.yaml): my_custom_theme: # Override standard variables success-color: "#00C853" # Custom green error-color: "#D32F2F" # Custom red warning-color: "#F57C00" # Custom orange info-color: "#0288D1" # Custom blue The icon_color attribute will automatically use your custom theme colors. Option 2: Interpret State Value Directly Instead of using icon_color, read the sensor state and apply your own colors: Example: Custom colors for price level type: custom:button-card entity: sensor.tibber_home_current_interval_price_level name: Current Price Level show_state: true icon: mdi:cash styles: icon: - color: | [[[ const level = entity.state; if (level === 'very_cheap') return '#00E676'; // Bright green if (level === 'cheap') return '#66BB6A'; // Light green if (level === 'normal') return '#9E9E9E'; // Gray if (level === 'expensive') return '#FF9800'; // Orange if (level === 'very_expensive') return '#F44336'; // Red return 'var(--state-icon-color)'; // Fallback ]]] Example: Custom colors for binary sensor type: custom:button-card entity: binary_sensor.tibber_home_best_price_period name: Best Price Period show_state: true icon: mdi:piggy-bank styles: icon: - color: | [[[ // Use state directly, not icon_color return entity.state === 'on' ? '#4CAF50' : '#9E9E9E'; ]]] card: - background: | [[[ return entity.state === 'on' ? 'rgba(76, 175, 80, 0.1)' : 'transparent'; ]]] Example: Custom colors for volatility type: custom:button-card entity: sensor.tibber_home_volatility_today name: Volatility Today show_state: true styles: icon: - color: | [[[ const volatility = entity.state; if (volatility === 'low') return '#4CAF50'; // Green if (volatility === 'moderate') return '#2196F3'; // Blue if (volatility === 'high') return '#FF9800'; // Orange if (volatility === 'very_high') return '#F44336'; // Red return 'var(--state-icon-color)'; ]]] Example: Custom colors for price rating type: custom:button-card entity: sensor.tibber_home_current_interval_price_rating name: Price Rating show_state: true styles: icon: - color: | [[[ const rating = entity.state; if (rating === 'low') return '#00C853'; // Dark green if (rating === 'normal') return '#78909C'; // Blue-gray if (rating === 'high') return '#D32F2F'; // Dark red return 'var(--state-icon-color)'; ]]] ","version":"Next 🚧","tagName":"h3"},{"title":"Which Approach Should You Use?","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#which-approach-should-you-use","content":" Use Case\tRecommended ApproachWant theme-consistent colors\t✅ Use icon_color directly Want light/dark mode support\t✅ Use icon_color directly Want custom theme colors\t✅ Override CSS variables in theme Want specific hardcoded colors\t⚠️ Interpret state value directly Multiple themes with different colors\t✅ Use icon_color directly Recommendation: Use icon_color whenever possible for better theme integration. Only interpret the state directly if you need very specific color values that shouldn't change with themes. ","version":"Next 🚧","tagName":"h3"},{"title":"Troubleshooting","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#troubleshooting","content":" Icons not changing color: Make sure you're using a card that supports custom styling (like custom:button-card or card_mod)Check that the entity actually has the icon_color attribute (inspect in Developer Tools → States)Verify your Home Assistant theme supports the CSS variables Colors look wrong: The colors are theme-dependent. Try switching themes to see if they appear correctlySome custom themes may override the standard CSS variables with unexpected colors Want different colors? You can override the colors in your theme configurationOr use conditional logic in your card templates based on the state value instead of icon_color ","version":"Next 🚧","tagName":"h2"},{"title":"See Also","type":1,"pageTitle":"Dynamic Icon Colors","url":"/hass.tibber_prices/user/icon-colors#see-also","content":" Sensors Reference - Complete list of available sensorsAutomation Examples - Use color-coded sensors in automationsConfiguration Guide - Adjust thresholds for price levels and ratings ","version":"Next 🚧","tagName":"h2"},{"title":"Period Calculation","type":0,"sectionRef":"#","url":"/hass.tibber_prices/user/period-calculation","content":"","keywords":"","version":"Next 🚧"},{"title":"Table of Contents","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#table-of-contents","content":" Quick StartHow It WorksConfiguration GuideUnderstanding RelaxationCommon ScenariosTroubleshooting No Periods FoundPeriods Split Into Small PiecesMidnight Price Classification Changes Advanced Topics ","version":"Next 🚧","tagName":"h2"},{"title":"Quick Start","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#quick-start","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"What Are Price Periods?","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#what-are-price-periods","content":" The integration finds time windows when electricity is especially cheap (Best Price) or expensive (Peak Price): Best Price Periods 🟢 - When to run your dishwasher, charge your EV, or heat waterPeak Price Periods 🔴 - When to reduce consumption or defer non-essential loads ","version":"Next 🚧","tagName":"h3"},{"title":"Default Behavior","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#default-behavior","content":" Out of the box, the integration: Best Price: Finds cheapest 1-hour+ windows that are at least 5% below the daily averagePeak Price: Finds most expensive 30-minute+ windows that are at least 5% above the daily averageRelaxation: Automatically loosens filters if not enough periods are found Most users don't need to change anything! The defaults work well for typical use cases. ℹ️ Why do Best Price and Peak Price have different defaults? The integration sets different initial defaults because the features serve different purposes: Best Price (60 min, 15% flex): Longer duration ensures appliances can complete their cyclesStricter flex (15%) focuses on genuinely cheap timesUse case: Running dishwasher, EV charging, water heating Peak Price (30 min, 20% flex): Shorter duration acceptable for early warningsMore flexible (20%) catches price spikes earlierUse case: Alerting to expensive periods, even brief ones You can adjust all these values in the configuration if the defaults don't fit your use case. The asymmetric defaults simply provide good starting points for typical scenarios. ","version":"Next 🚧","tagName":"h3"},{"title":"Example Timeline","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#example-timeline","content":" 00:00 ████████████████ Best Price Period (cheap prices) 04:00 ░░░░░░░░░░░░░░░░ Normal 08:00 ████████████████ Peak Price Period (expensive prices) 12:00 ░░░░░░░░░░░░░░░░ Normal 16:00 ████████████████ Peak Price Period (expensive prices) 20:00 ████████████████ Best Price Period (cheap prices) ","version":"Next 🚧","tagName":"h3"},{"title":"How It Works","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#how-it-works","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"The Basic Idea","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#the-basic-idea","content":" Each day, the integration analyzes all 96 quarter-hourly price intervals and identifies continuous time ranges that meet specific criteria. Think of it like this: Find potential windows - Times close to the daily MIN (Best Price) or MAX (Peak Price)Filter by quality - Ensure they're meaningfully different from averageCheck duration - Must be long enough to be usefulApply preferences - Optional: only show stable prices, avoid mediocre times ","version":"Next 🚧","tagName":"h3"},{"title":"Step-by-Step Process","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#step-by-step-process","content":" 1. Define the Search Range (Flexibility) Best Price: How much MORE than the daily minimum can a price be? Daily MIN: 20 ct/kWh Flexibility: 15% (default) → Search for times ≤ 23 ct/kWh (20 + 15%) Peak Price: How much LESS than the daily maximum can a price be? Daily MAX: 40 ct/kWh Flexibility: -15% (default) → Search for times ≥ 34 ct/kWh (40 - 15%) Why flexibility? Prices rarely stay at exactly MIN/MAX. Flexibility lets you capture realistic time windows. 2. Ensure Quality (Distance from Average) Periods must be meaningfully different from the daily average: Daily AVG: 30 ct/kWh Minimum distance: 5% (default) Best Price: Must be ≤ 28.5 ct/kWh (30 - 5%) Peak Price: Must be ≥ 31.5 ct/kWh (30 + 5%) Why? This prevents marking mediocre times as "best" just because they're slightly below average. 3. Check Duration Periods must be long enough to be practical: Default: 60 minutes minimum 45-minute period → Discarded 90-minute period → Kept ✓ 4. Apply Optional Filters You can optionally require: Absolute quality (level filter) - "Only show if prices are CHEAP/EXPENSIVE (not just below/above average)" 5. Automatic Price Spike Smoothing Isolated price spikes are automatically detected and smoothed to prevent unnecessary period fragmentation: Original prices: 18, 19, 35, 20, 19 ct ← 35 ct is an isolated outlier Smoothed: 18, 19, 19, 20, 19 ct ← Spike replaced with trend prediction Result: Continuous period 00:00-01:15 instead of split periods Important: Original prices are always preserved (min/max/avg show real values)Smoothing only affects which intervals are combined into periodsThe attribute period_interval_smoothed_count shows if smoothing was active ","version":"Next 🚧","tagName":"h3"},{"title":"Visual Example","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#visual-example","content":" Timeline for a typical day: Hour: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Price: 18 19 20 28 29 30 35 34 33 32 30 28 25 24 26 28 30 32 31 22 21 20 19 18 Daily MIN: 18 ct | Daily MAX: 35 ct | Daily AVG: 26 ct Best Price (15% flex = ≤20.7 ct): ████████ ████████████████ 00:00-03:00 (3h) 19:00-24:00 (5h) Peak Price (-15% flex = ≥29.75 ct): ████████████████████████ 06:00-11:00 (5h) ","version":"Next 🚧","tagName":"h3"},{"title":"Configuration Guide","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#configuration-guide","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Basic Settings","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#basic-settings","content":" Flexibility What: How far from MIN/MAX to search for periodsDefault: 15% (Best Price), -15% (Peak Price)Range: 0-100% best_price_flex: 15 # Can be up to 15% more expensive than daily MIN peak_price_flex: -15 # Can be up to 15% less expensive than daily MAX When to adjust: Increase (20-25%) → Find more/longer periodsDecrease (5-10%) → Find only the very best/worst times 💡 Tip: Very high flexibility (>30%) is rarely useful. Recommendation: Start with 15-20% and enable relaxation – it adapts automatically to each day's price pattern. Minimum Period Length What: How long a period must be to show itDefault: 60 minutes (Best Price), 30 minutes (Peak Price)Range: 15-240 minutes best_price_min_period_length: 60 peak_price_min_period_length: 30 When to adjust: Increase (90-120 min) → Only show longer periods (e.g., for heat pump cycles)Decrease (30-45 min) → Show shorter windows (e.g., for quick tasks) Distance from Average What: How much better than average a period must beDefault: 5%Range: 0-20% best_price_min_distance_from_avg: 5 peak_price_min_distance_from_avg: 5 When to adjust: Increase (5-10%) → Only show clearly better timesDecrease (0-1%) → Show any time below/above average ℹ️ Note: Both flexibility and distance filters must be satisfied. When using high flexibility values (>30%), the distance filter may become the limiting factor. For best results, use moderate flexibility (15-20%) with relaxation enabled. ","version":"Next 🚧","tagName":"h3"},{"title":"Optional Filters","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#optional-filters","content":" Level Filter (Absolute Quality) What: Only show periods with CHEAP/EXPENSIVE intervals (not just below/above average)Default: any (disabled)Options: any | cheap | very_cheap (Best Price) | expensive | very_expensive (Peak Price) best_price_max_level: any # Show any period below average best_price_max_level: cheap # Only show if at least one interval is CHEAP Use case: "Only notify me when prices are objectively cheap/expensive" ℹ️ Volatility Thresholds: The level filter also supports volatility-based levels (volatility_low, volatility_medium, volatility_high). These use fixed internal thresholds (LOW < 10%, MEDIUM < 20%, HIGH ≥ 20%) that are separate from the sensor volatility thresholds you configure in the UI. This separation ensures that changing sensor display preferences doesn't affect period calculation behavior. Gap Tolerance (for Level Filter) What: Allow some "mediocre" intervals within an otherwise good periodDefault: 0 (strict)Range: 0-10 best_price_max_level: cheap best_price_max_level_gap_count: 2 # Allow up to 2 NORMAL intervals per period Use case: "Don't split periods just because one interval isn't perfectly CHEAP" ","version":"Next 🚧","tagName":"h3"},{"title":"Tweaking Strategy: What to Adjust First?","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#tweaking-strategy-what-to-adjust-first","content":" When you're not happy with the default behavior, adjust settings in this order: 1. Start with Relaxation (Easiest) If you're not finding enough periods: enable_min_periods_best: true # Already default! min_periods_best: 2 # Already default! relaxation_attempts_best: 11 # Already default! Why start here? Relaxation automatically finds the right balance for each day. Much easier than manual tuning. 2. Adjust Period Length (Simple) If periods are too short/long for your use case: best_price_min_period_length: 90 # Increase from 60 for longer periods # OR best_price_min_period_length: 45 # Decrease from 60 for shorter periods Safe to change: This only affects duration, not price selection logic. 3. Fine-tune Flexibility (Moderate) If you consistently want more/fewer periods: best_price_flex: 20 # Increase from 15% for more periods # OR best_price_flex: 10 # Decrease from 15% for stricter selection ⚠️ Watch out: Values >25% may conflict with distance filter. Use relaxation instead. 4. Adjust Distance from Average (Advanced) Only if periods seem "mediocre" (not really cheap/expensive): best_price_min_distance_from_avg: 10 # Increase from 5% for stricter quality ⚠️ Careful: High values (>10%) can make it impossible to find periods on flat price days. 5. Enable Level Filter (Expert) Only if you want absolute quality requirements: best_price_max_level: cheap # Only show objectively CHEAP periods ⚠️ Very strict: Many days may have zero qualifying periods. Always enable relaxation when using this! ","version":"Next 🚧","tagName":"h3"},{"title":"Common Mistakes to Avoid","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#common-mistakes-to-avoid","content":" ❌ Don't increase flexibility to >30% manually → Use relaxation instead ❌ Don't combine high distance (>10%) with strict level filter → Too restrictive ❌ Don't disable relaxation with strict filters → You'll get zero periods on some days ❌ Don't change all settings at once → Adjust one at a time and observe results ✅ Do use defaults + relaxation → Works for 90% of cases ✅ Do adjust one setting at a time → Easier to understand impact ✅ Do check sensor attributes → Shows why periods were/weren't found ","version":"Next 🚧","tagName":"h3"},{"title":"Understanding Relaxation","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#understanding-relaxation","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"What Is Relaxation?","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#what-is-relaxation","content":" Sometimes, strict filters find too few periods (or none). Relaxation automatically loosens filters until a minimum number of periods is found. ","version":"Next 🚧","tagName":"h3"},{"title":"How to Enable","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#how-to-enable","content":" enable_min_periods_best: true min_periods_best: 2 # Try to find at least 2 periods per day relaxation_attempts_best: 11 # Flex levels to test (default: 11 steps = 22 filter combinations) ℹ️ Good news: Relaxation is enabled by default with sensible settings. Most users don't need to change anything here! Set the matching relaxation_attempts_peak value when tuning Peak Price periods. Both sliders accept 1-12 attempts, and the default of 11 flex levels translates to 22 filter-combination tries (11 flex levels × 2 filter combos) for each of Best and Peak calculations. Lower it for quick feedback, or raise it when either sensor struggles to hit the minimum-period target on volatile days. ","version":"Next 🚧","tagName":"h3"},{"title":"Why Relaxation Is Better Than Manual Tweaking","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#why-relaxation-is-better-than-manual-tweaking","content":" Problem with manual settings: You set flex to 25% → Works great on Monday (volatile prices)Same 25% flex on Tuesday (flat prices) → Finds "best price" periods that aren't really cheapYou're stuck with one setting for all days Solution with relaxation: Monday (volatile): Uses flex 15% (original) → Finds 2 perfect periods ✓Tuesday (flat): Escalates to flex 21% → Finds 2 decent periods ✓Wednesday (mixed): Uses flex 18% → Finds 2 good periods ✓ Each day gets exactly the flexibility it needs! ","version":"Next 🚧","tagName":"h3"},{"title":"How It Works (Adaptive Matrix)","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#how-it-works-adaptive-matrix","content":" Relaxation uses a matrix approach - trying N flexibility levels (your configured relaxation attempts) with 2 filter combinations per level. With the default of 11 attempts, that means 11 flex levels × 2 filter combinations = 22 total filter-combination tries per day; fewer attempts mean fewer flex increases, while more attempts extend the search further before giving up. Important: The flexibility increment is fixed at 3% per step (hard-coded for reliability). This means: Base flex 15% → 18% → 21% → 24% → ... → 48% (with 11 attempts)Base flex 20% → 23% → 26% → 29% → ... → 50% (with 11 attempts) Phase Matrix For each day, the system tries: Flexibility Levels (Attempts): Attempt 1 = Original flex (e.g., 15%)Attempt 2 = +3% step (18%)Attempt 3 = +3% step (21%)Attempt 4 = +3% step (24%)… Attempts 5-11 (default) continue adding +3% each time… Additional attempts keep extending the same pattern up to the 12-attempt maximum (up to 51%) 2 Filter Combinations (per flexibility level): Original filters (your configured level filter)Remove level filter (level=any) Example progression: Flex 15% + Original filters → Not enough periods Flex 15% + Level=any → Not enough periods Flex 18% + Original filters → Not enough periods Flex 18% + Level=any → SUCCESS! Found 2 periods ✓ (stops here - no need to try more) ","version":"Next 🚧","tagName":"h3"},{"title":"Choosing the Number of Attempts","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#choosing-the-number-of-attempts","content":" Default (11 attempts) balances speed and completeness for most grids (22 combinations per day for both Best and Peak)Lower (4-8 attempts) if you only want mild relaxation and keep processing time minimal (reaches ~27-39% flex)Higher (12 attempts) for extremely volatile days when you must reach near the 50% maximum (24 combinations)Remember: each additional attempt adds two more filter combinations because every new flex level still runs both filter overrides (original + level=any) Per-Day Independence Critical: Each day relaxes independently: Day 1: Finds 2 periods with flex 15% (original) → No relaxation needed Day 2: Needs flex 21% + level=any → Uses relaxed settings Day 3: Finds 2 periods with flex 15% (original) → No relaxation needed Why? Price patterns vary daily. Some days have clear cheap/expensive windows (strict filters work), others don't (relaxation needed). ","version":"Next 🚧","tagName":"h3"},{"title":"Common Scenarios","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#common-scenarios","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"Scenario 1: Simple Best Price (Default)","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#scenario-1-simple-best-price-default","content":" Goal: Find the cheapest time each day to run dishwasher Configuration: # Use defaults - no configuration needed! best_price_flex: 15 # (default) best_price_min_period_length: 60 # (default) best_price_min_distance_from_avg: 5 # (default) What you get: 1-3 periods per day with prices ≤ MIN + 15%Each period at least 1 hour longAll periods at least 5% cheaper than daily average Automation example: automation: - trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" action: - service: switch.turn_on target: entity_id: switch.dishwasher ","version":"Next 🚧","tagName":"h3"},{"title":"Troubleshooting","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#troubleshooting","content":" ","version":"Next 🚧","tagName":"h2"},{"title":"No Periods Found","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#no-periods-found","content":" Symptom: binary_sensor.tibber_home_best_price_period never turns "on" Common Solutions: Check if relaxation is enabled enable_min_periods_best: true # Should be true (default) min_periods_best: 2 # Try to find at least 2 periods If still no periods, check filters Look at sensor attributes: relaxation_active and relaxation_levelIf relaxation exhausted all attempts: Filters too strict or flat price day Try increasing flexibility slightly best_price_flex: 20 # Increase from default 15% Or reduce period length requirement best_price_min_period_length: 45 # Reduce from default 60 minutes ","version":"Next 🚧","tagName":"h3"},{"title":"Periods Split Into Small Pieces","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#periods-split-into-small-pieces","content":" Symptom: Many short periods instead of one long period Common Solutions: If using level filter, add gap tolerance best_price_max_level: cheap best_price_max_level_gap_count: 2 # Allow 2 NORMAL intervals Slightly increase flexibility best_price_flex: 20 # From 15% → captures wider price range Check for price spikes Automatic smoothing should handle thisCheck attribute: period_interval_smoothed_countIf 0: Not isolated spikes, but real price levels ","version":"Next 🚧","tagName":"h3"},{"title":"Understanding Sensor Attributes","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#understanding-sensor-attributes","content":" Key attributes to check: # Entity: binary_sensor.tibber_home_best_price_period # When "on" (period active): start: "2025-11-11T02:00:00+01:00" # Period start time end: "2025-11-11T05:00:00+01:00" # Period end time duration_minutes: 180 # Duration in minutes price_avg: 18.5 # Average price in the period rating_level: "LOW" # All intervals have LOW rating # Relaxation info (shows if filter loosening was needed): relaxation_active: true # This day needed relaxation relaxation_level: "price_diff_18.0%+level_any" # Found at 18% flex, level filter removed # Optional (only shown when relevant): period_interval_smoothed_count: 2 # Number of price spikes smoothed period_interval_level_gap_count: 1 # Number of "mediocre" intervals tolerated ","version":"Next 🚧","tagName":"h3"},{"title":"Midnight Price Classification Changes","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#midnight-price-classification-changes","content":" Symptom: A Best Price period at 23:45 suddenly changes to Peak Price at 00:00 (or vice versa), even though the absolute price barely changed. Why This Happens: This is mathematically correct behavior caused by how electricity prices are set in the day-ahead market: Market Timing: The EPEX SPOT Day-Ahead auction closes at 12:00 CET each dayAll prices for the next day (00:00-23:45) are set at this momentLate-day intervals (23:45) are priced ~36 hours before deliveryEarly-day intervals (00:00) are priced ~12 hours before delivery Why Prices Jump at Midnight: Forecast Uncertainty: Weather, demand, and renewable generation forecasts are more uncertain 36 hours ahead than 12 hours aheadRisk Buffer: Late-day prices include a risk premium for this uncertaintyIndependent Days: Each day has its own min/max/avg calculated from its 96 intervalsRelative Classification: Periods are classified based on their position within the day's price range, not absolute prices Example: # Day 1 (low volatility, narrow range) Price range: 18-22 ct/kWh (4 ct span) Daily average: 20 ct/kWh 23:45: 18.5 ct/kWh → 7.5% below average → BEST PRICE ✅ # Day 2 (low volatility, narrow range) Price range: 17-21 ct/kWh (4 ct span) Daily average: 19 ct/kWh 00:00: 18.6 ct/kWh → 2.1% below average → PEAK PRICE ❌ # Observation: Absolute price barely changed (18.5 → 18.6 ct) # But relative position changed dramatically: # - Day 1: Near the bottom of the range # - Day 2: Near the middle/top of the range When This Occurs: Low-volatility days: When price span is narrow (< 5 ct/kWh)Stable weather: Similar conditions across multiple daysMarket transitions: Switching between high/low demand seasons How to Detect: Check the volatility sensors to understand if a period flip is meaningful: # Check daily volatility (available in integration) sensor.tibber_home_volatility_today: 8.2% # Low volatility sensor.tibber_home_volatility_tomorrow: 7.9% # Also low # Low volatility (< 15%) means: # - Small absolute price differences between periods # - Classification changes may not be economically significant # - Consider ignoring period classification on such days Handling in Automations: You can make your automations volatility-aware: # Option 1: Only act on high-volatility days automation: - alias: "Dishwasher - Best Price (High Volatility Only)" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: - condition: numeric_state entity_id: sensor.tibber_home_volatility_today above: 15 # Only act if volatility > 15% action: - service: switch.turn_on entity_id: switch.dishwasher # Option 2: Check absolute price, not just classification automation: - alias: "Heat Water - Cheap Enough" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: - condition: numeric_state entity_id: sensor.tibber_home_current_interval_price_ct below: 20 # Absolute threshold: < 20 ct/kWh action: - service: switch.turn_on entity_id: switch.water_heater # Option 3: Use per-period day volatility (available on period sensors) automation: - alias: "EV Charging - Volatility-Aware" trigger: - platform: state entity_id: binary_sensor.tibber_home_best_price_period to: "on" condition: # Check if the period's day has meaningful volatility - condition: template value_template: > {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} action: - service: switch.turn_on entity_id: switch.ev_charger Available Per-Period Attributes: Each period sensor exposes day volatility and price statistics: binary_sensor.tibber_home_best_price_period: day_volatility_%: 8.2 # Volatility % of the period's day day_price_min: 1800.0 # Minimum price of the day (ct/kWh) day_price_max: 2200.0 # Maximum price of the day (ct/kWh) day_price_span: 400.0 # Difference (max - min) in ct These attributes allow automations to check: "Is the classification meaningful on this particular day?" Summary: ✅ Expected behavior: Periods are evaluated per-day, midnight is a natural boundary✅ Market reality: Late-day prices have more uncertainty than early-day prices✅ Solution: Use volatility sensors, absolute price thresholds, or per-period day volatility attributes ","version":"Next 🚧","tagName":"h3"},{"title":"Advanced Topics","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#advanced-topics","content":" For advanced configuration patterns and technical deep-dive, see: Automation Examples - Real-world automation patternsActions - Using the tibber_prices.get_chartdata action for custom visualizations ","version":"Next 🚧","tagName":"h2"},{"title":"Quick Reference","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#quick-reference","content":" Configuration Parameters: Parameter\tDefault\tRange\tPurposebest_price_flex\t15%\t0-100%\tSearch range from daily MIN best_price_min_period_length\t60 min\t15-240\tMinimum duration best_price_min_distance_from_avg\t5%\t0-20%\tQuality threshold best_price_max_level\tany\tany/cheap/vcheap\tAbsolute quality best_price_max_level_gap_count\t0\t0-10\tGap tolerance enable_min_periods_best\ttrue\ttrue/false\tEnable relaxation min_periods_best\t2\t1-10\tTarget periods per day relaxation_attempts_best\t11\t1-12\tFlex levels (attempts) per day Peak Price: Same parameters with peak_price_* prefix (defaults: flex=-15%, same otherwise) ","version":"Next 🚧","tagName":"h3"},{"title":"Price Levels Reference","type":1,"pageTitle":"Period Calculation","url":"/hass.tibber_prices/user/period-calculation#price-levels-reference","content":" The Tibber API provides price levels for each 15-minute interval: Levels (based on trailing 24h average): VERY_CHEAP - Significantly below averageCHEAP - Below averageNORMAL - Around averageEXPENSIVE - Above averageVERY_EXPENSIVE - Significantly above average Last updated: November 20, 2025Integration version: 2.0+ ","version":"Next 🚧","tagName":"h3"}],"options":{"id":"default"}} |