hass.tibber_prices/custom_components/tibber_prices
Julian Pawlowski 53e73a7fda feat(period-calc): adaptive defaults + remove volatility filter
Major improvements to period calculation with smarter defaults and
simplified configuration:

**Adaptive Defaults:**
- ENABLE_MIN_PERIODS: true (was false) - Always try to find periods
- MIN_PERIODS target: 2 periods/day (ensures coverage)
- BEST_PRICE_MAX_LEVEL: "cheap" (was "any") - Prefer genuinely cheap
- PEAK_PRICE_MIN_LEVEL: "expensive" (was "any") - Prefer genuinely expensive
- GAP_TOLERANCE: 1 (was 0) - Allow 1-level deviations in sequences
- MIN_DISTANCE_FROM_AVG: 5% (was 2%) - Ensure significance
- PEAK_PRICE_MIN_PERIOD_LENGTH: 30min (was 60min) - More responsive
- PEAK_PRICE_FLEX: -20% (was -15%) - Better peak detection

**Volatility Filter Removal:**
- Removed CONF_BEST_PRICE_MIN_VOLATILITY from const.py
- Removed CONF_PEAK_PRICE_MIN_VOLATILITY from const.py
- Removed volatility filter UI controls from config_flow.py
- Removed filter_periods_by_volatility() calls from coordinator.py
- Updated all 5 translations (de, en, nb, nl, sv)

**Period Calculation Logic:**
- Level filter now integrated into _build_periods() (applied during
  interval qualification, not as post-filter)
- Gap tolerance implemented via _check_level_with_gap_tolerance()
- Short periods (<1.5h) use strict filtering (no gap tolerance)
- Relaxation now passes level_filter + gap_count directly to
  PeriodConfig
- show_periods check skipped when relaxation enabled (relaxation
  tries "any" as fallback)

**Documentation:**
- Complete rewrite of docs/user/period-calculation.md:
  * Visual examples with timelines
  * Step-by-step explanation of 4-step process
  * Configuration scenarios (5 common use cases)
  * Troubleshooting section with specific fixes
  * Advanced topics (per-day independence, early stop, etc.)
- Updated README.md: "volatility" → "distance from average"

Impact: Periods now reliably appear on most days with meaningful
quality filters. Users get warned about expensive periods and notified
about cheap opportunities without manual tuning. Relaxation ensures
coverage while keeping filters as strict as possible.

Breaking change: Volatility filter removed (was never a critical
feature, often confused users). Existing configs continue to work
(removed keys are simply ignored).
2025-11-12 13:20:14 +00:00
..
custom_translations fix(translations): restore corrupted Norwegian and Dutch translations 2025-11-09 15:31:56 +00:00
translations feat(period-calc): adaptive defaults + remove volatility filter 2025-11-12 13:20:14 +00:00
__init__.py fix: handle unknown integration version in setup entry 2025-11-09 16:04:04 +00:00
api.py fix: update return type annotation for API request method and ensure exceptions are raised 2025-11-09 16:04:12 +00:00
average_utils.py feat: Add function to calculate average price for the next N hours 2025-11-06 22:35:53 +00:00
binary_sensor.py feat(periods): add adaptive filter relaxation for minimum period guarantee 2025-11-10 03:34:09 +00:00
config_flow.py feat(period-calc): adaptive defaults + remove volatility filter 2025-11-12 13:20:14 +00:00
const.py feat(period-calc): adaptive defaults + remove volatility filter 2025-11-12 13:20:14 +00:00
coordinator.py feat(period-calc): adaptive defaults + remove volatility filter 2025-11-12 13:20:14 +00:00
data.py refactoring 2025-04-23 16:42:31 +00:00
diagnostics.py update dev environment 2025-11-03 15:54:01 +00:00
entity.py fix: Remove unused model_id attribute from TibberPricesEntity 2025-11-07 14:45:33 +00:00
manifest.json chore(release): bump version to 0.4.1 2025-11-11 21:22:36 +00:00
period_utils.py feat(period-calc): adaptive defaults + remove volatility filter 2025-11-12 13:20:14 +00:00
price_utils.py refactor(periods): move all period logic to coordinator and refactor period_utils 2025-11-09 23:46:48 +00:00
sensor.py refactor(periods): move all period logic to coordinator and refactor period_utils 2025-11-09 23:46:48 +00:00
services.py refactor(periods): move all period logic to coordinator and refactor period_utils 2025-11-09 23:46:48 +00:00
services.yaml update 2025-05-25 22:15:25 +00:00