mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 05:13:40 +00:00
Replaced absolute volatility thresholds (ct/øre) with relative coefficient of variation (CV = std_dev / mean * 100%) for scale-independent volatility measurement that works across all price levels. Changes to volatility calculation: - price_utils.py: Rewrote calculate_volatility_level() to accept price list instead of spread value, using statistics.mean() and statistics.stdev() - sensor.py: Updated volatility sensors to pass price lists (not spread) - services.py: Modified _get_price_stats() to calculate CV from prices - period_statistics.py: Extract prices for CV calculation in period summaries - const.py: Updated default thresholds to 15%/30%/50% (was 5/15/30 ct) with comprehensive documentation explaining CV-based approach Dead code removal: - period_utils/core.py: Removed filter_periods_by_volatility() function (86 lines of code that was never actually called) - period_utils/__init__.py: Removed dead function export - period_utils/relaxation.py: Simplified callback signature from Callable[[str|None, str|None], bool] to Callable[[str|None], bool] - coordinator.py: Updated lambda callbacks to match new signature - const.py: Replaced RELAXATION_VOLATILITY_ANY with RELAXATION_LEVEL_ANY Bug fix: - relaxation.py: Added int() conversion for max_relaxation_attempts (line 435: attempts = max(1, int(max_relaxation_attempts))) Fixes TypeError when config value arrives as float Configuration UI: - config_flow.py: Changed volatility threshold unit display from "ct" to "%" Translations (all 5 languages): - Updated volatility descriptions to explain coefficient of variation - Changed threshold labels from "spread ≥ value" to "CV ≥ percentage" - Languages: de, en, nb, nl, sv Documentation: - period-calculation.md: Removed volatility filter section (dead feature) Impact: Breaking change for users with custom volatility thresholds. Old absolute values (e.g., 5 ct) will be interpreted as percentages (5%). However, new defaults (15%/30%/50%) are more conservative and work universally across all currencies and price levels. No data migration needed - existing configs continue to work with new interpretation. |
||
|---|---|---|
| .. | ||
| automation-examples.md | ||
| configuration.md | ||
| installation.md | ||
| period-calculation.md | ||
| README.md | ||
| sensors.md | ||
| services.md | ||
| troubleshooting.md | ||
User Documentation
Welcome to Tibber Prices! This integration provides enhanced electricity price data from Tibber with quarter-hourly precision, statistical analysis, and intelligent ratings.
📚 Documentation
- Installation - How to install via HACS and configure the integration
- Configuration - Setting up your Tibber API token and price thresholds
- Period Calculation - How Best/Peak Price periods are calculated and configured
- Sensors - Available sensors, their states, and attributes
- Services - Custom services and how to use them
- Automation Examples - Ready-to-use automation recipes
- Troubleshooting - Common issues and solutions
🚀 Quick Start
- Install via HACS (add as custom repository)
- Add Integration in Home Assistant → Settings → Devices & Services
- Enter 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!
✨ Key Features
- Quarter-hourly precision - 15-minute intervals for accurate price tracking
- Statistical analysis - Trailing/leading 24h averages for context
- Price ratings - LOW/NORMAL/HIGH classification based on your thresholds
- Best/Peak hour detection - Automatic detection of cheapest/peak periods with configurable filters (learn how)
- ApexCharts integration - Custom services for beautiful price charts
- Multi-currency support - EUR, NOK, SEK with proper minor units (ct, øre, öre)
🔗 Useful Links
🤝 Need Help?
- Check the Troubleshooting Guide
- Search existing issues
- Open a new issue if needed
Note: These guides are for end users. If you want to contribute to development, see the Developer Documentation.