hass.tibber_prices/custom_components/tibber_prices
Julian Pawlowski fb70f29ac9 feat(services): rewrite ApexCharts service for modern workflow
Complete overhaul of the ApexCharts integration service layer to support
modern chart card workflows with flexible data formatting and filtering.

Replaced services:
- Removed: get_price, get_apexcharts_data (legacy, entity-based)
- Added: get_chartdata (flexible data service)
- Improved: get_apexcharts_yaml (now uses get_chartdata internally)

New get_chartdata service features:
- Multiple output formats (array_of_objects, array_of_arrays)
- Customizable field names for chart compatibility
- Resolution options (15-min intervals, hourly averages)
- Advanced filtering (level_filter, rating_level_filter)
- NULL insertion modes (none, segments, all) for clean gaps
- Minor currency support (cents/øre) with custom rounding
- Optional fields (level, rating_level, average)
- Multi-day support (yesterday/today/tomorrow)

Enhanced get_apexcharts_yaml service:
- Direct entry_id parameter (no entity_id lookup needed)
- Uses get_chartdata with WebSocket API (data_generator)
- Improved ApexCharts configuration:
  * Gradient fill (70% opacity → 20%)
  * Grid styling with dashed lines
  * Zoom & Pan tools (animations disabled for performance)
  * Optimized legend (top-left, compact markers)
  * Y-axis auto-scaling (min: 0 for visibility, supports negative prices)
  * 2 decimal places (improved precision)
  * Browser locale formatting (automatic comma/point)
  * insert_nulls='segments' for clean gaps between levels
- Multi-language support (translated titles, series names)
- Day selection (yesterday/today/tomorrow with correct span config)

Service translations:
- Added comprehensive field descriptions (all 5 languages: de, en, nb, nl, sv)
- Selector translations for all options (day, resolution, output_format, etc.)
- ApexCharts title translations in custom_translations/

Technical improvements:
- Hourly aggregation uses exact 4-interval windows (:00/:15/:30/:45)
- Level/rating aggregation follows sensor logic (aggregate_level_data, aggregate_rating_data)
- Midnight extension for last interval of filtered data (seamless day transitions)
- Case-insensitive filter matching (normalized to uppercase)
- Ruff complexity fixed (extracted _get_level_translation helper)

Impact: Users can now generate production-ready ApexCharts YAML with a single
service call, or use get_chartdata flexibly with any chart card (ApexCharts,
Plotly, Mini Graph, etc.). Supports complex filtering scenarios (e.g., "show
only LOW rating periods") with clean visual gaps. Full multi-language support.
2025-11-16 23:52:36 +00:00
..
binary_sensor feat(api): add multi-home support and diagnostic sensors 2025-11-16 00:11:56 +00:00
config_flow_handlers feat(api): add multi-home support and diagnostic sensors 2025-11-16 00:11:56 +00:00
custom_translations feat(services): rewrite ApexCharts service for modern workflow 2025-11-16 23:52:36 +00:00
entity_utils feat(sensors): add momentum-based trend detection with two new sensors 2025-11-16 12:49:43 +00:00
period_utils refactor(volatility): migrate to coefficient of variation calculation 2025-11-14 01:12:47 +00:00
sensor feat(sensors): improve price trend sensors with temporal context 2025-11-16 17:09:16 +00:00
translations feat(services): rewrite ApexCharts service for modern workflow 2025-11-16 23:52:36 +00:00
__init__.py fix: handle unknown integration version in setup entry 2025-11-09 16:04:04 +00:00
api.py feat(api): add multi-home support and diagnostic sensors 2025-11-16 00:11:56 +00:00
average_utils.py refactor(sensors): Refactor price sensor calculations and remove unused methods 2025-11-15 09:29:33 +00:00
config_flow.py refactor(config_flow): restructure package to satisfy hassfest validation 2025-11-15 17:40:53 +00:00
const.py feat(sensors): add momentum-based trend detection with two new sensors 2025-11-16 12:49:43 +00:00
coordinator.py feat(sensors): improve price trend sensors with temporal context 2025-11-16 17:09:16 +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 feat(api): add multi-home support and diagnostic sensors 2025-11-16 00:11:56 +00:00
manifest.json chore(release): bump version to 0.9.0 2025-11-16 00:12:20 +00:00
price_utils.py feat(sensors): add momentum-based trend detection with two new sensors 2025-11-16 12:49:43 +00:00
services.py feat(services): rewrite ApexCharts service for modern workflow 2025-11-16 23:52:36 +00:00
services.yaml feat(services): rewrite ApexCharts service for modern workflow 2025-11-16 23:52:36 +00:00