hass.tibber_prices/custom_components/tibber_prices/utils
Julian Pawlowski 6f5261785b feat(sensor): add price rank sensors and IQR-based volatility attributes
Add three new price rank sensors that show where today's/tomorrow's/combined
average price falls relative to all intervals in the evaluated window:
- price_rank_today: today's average price percentile rank (0–100%)
- price_rank_tomorrow: tomorrow's average price percentile rank
- price_rank_today_tomorrow: combined today+tomorrow percentile rank

Extend all volatility sensors with IQR-based band statistics:
- price_typical_spread: interquartile range (IQR) in currency subunit
- price_typical_spread_%: IQR as percentage of daily average
- price_spike_count: number of intervals outside Tukey fences (outliers)

Add calculate_iqr_stats() utility function in utils/price.py that computes
the 25th/75th percentiles, IQR, outer fences (Q1 - 1.5×IQR / Q3 + 1.5×IQR),
and outlier count for any list of price values. Entity keys and attribute
names use plain language (`price_rank`, `price_typical_spread`) as primary
labels; technical terms (percentile rank, IQR) are included parenthetically
in descriptions and documentation.

Impact: Users can now see where current day prices rank compared to their window and how tightly clustered or spike-prone a day's prices are.
2026-04-12 14:13:47 +00:00
..
__init__.py feat(utils): add coefficient of variation (CV) calculation 2025-12-22 23:21:38 +00:00
average.py feat(sensors): always show both mean and median in average sensor attributes 2025-12-18 15:12:30 +00:00
price.py feat(sensor): add price rank sensors and IQR-based volatility attributes 2026-04-12 14:13:47 +00:00
price_window.py feat(services): add 5 scheduling services for price-optimized time windows 2026-04-11 18:58:27 +00:00