hass.tibber_prices/custom_components/tibber_prices
Julian Pawlowski 3a9ba55dd3 feat(sensors): improve price trend sensors with temporal context
Enhanced current_price_trend and next_price_trend_change sensors with
consistent temporal information and fixed trend calculation logic.

Changes:
- Fixed trend calculation order: Calculate final trend state (momentum +
  future outlook) BEFORE scanning for next change, ensuring consistency
  between current_price_trend state and next_price_trend_change from_direction
- Added TIME_SENSITIVE_ENTITY_KEYS registration for both trend sensors
  to enable automatic 15-minute boundary updates (Timer #2)
- Removed redundant timestamp field from _trend_change_attributes (was
  duplicate of sensor state)
- Added timestamp attribute (current interval) to both sensors as first
  attribute for temporal reference
- Implemented _find_trend_start_time() to scan backward and determine
  when current trend began
- Added trend_duration_minutes to current_price_trend showing how long
  current trend has been active
- Added from_direction to current_price_trend showing previous trend
  state (enables detection of valleys/plateaus)
- Added minutes_until_change to next_price_trend_change showing time
  until trend changes
- Removed redundant attributes: valid_until, duration_hours,
  duration_minutes from current_price_trend (can be derived from
  next_price_trend_change sensor)
- Removed redundant next_direction from current_price_trend (available
  in next_price_trend_change sensor)

current_price_trend attributes:
- timestamp: Current interval (calculation basis)
- from_direction: Previous trend state (e.g., "stable" → "falling" = starting decline)
- trend_duration_minutes: How long current trend has been active

next_price_trend_change attributes:
- timestamp: Current interval (calculation basis)
- from_direction: Current trend state (should match current_price_trend state)
- direction: Target trend state
- minutes_until_change: Time until change occurs
- current_price_now, price_at_change, avg_after_change, trend_diff_%

Impact: Users can now detect important transitions (valleys: falling→stable,
plateaus: rising→stable) and understand trend context. Both sensors update
automatically every 15 minutes with consistent information.
2025-11-16 17:09:16 +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(sensors): add momentum-based trend detection with two new sensors 2025-11-16 12:49:43 +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(sensors): add momentum-based trend detection with two new sensors 2025-11-16 12:49:43 +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 refactor(volatility): migrate to coefficient of variation calculation 2025-11-14 01:12:47 +00:00
services.yaml update 2025-05-25 22:15:25 +00:00