refactor(sensors): optimize default entity activation for better UX

Adjusted entity_registry_enabled_default flags to reduce initial entity
count while keeping most useful sensors active by default.

Changes:
- Disabled rating sensors (current/next interval, hourly, daily) - Level
  sensors provide better granularity (5 levels vs 3) for automations
- Disabled leading 24h window sensors (avg/min/max) - Advanced use case,
  overlaps with tomorrow statistics
- Disabled additional volatility sensors (tomorrow, next_24h,
  today_tomorrow) - Today's volatility sufficient for typical use cases

Rationale:
- Price level sensors (5 states: very_cheap → very_expensive) are more
  commonly used than rating sensors (3 states: low → high)
- Leading 24h windows overlap with tomorrow daily statistics which have
  clearer boundaries
- Single volatility indicator (today) covers most automation needs

Impact: Reduces default active entities from ~65 to ~50 while maintaining
all essential functionality. Advanced users can enable additional sensors
as needed. Improves initial setup experience by focusing on most relevant
sensors.
This commit is contained in:
Julian Pawlowski 2025-11-15 21:47:09 +00:00
parent dae0b43971
commit 4e64cf7598

View file

@ -136,6 +136,7 @@ INTERVAL_RATING_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "normal", "high"], options=["low", "normal", "high"],
entity_registry_enabled_default=False, # Level is more commonly used
), ),
SensorEntityDescription( SensorEntityDescription(
key="next_interval_price_rating", key="next_interval_price_rating",
@ -145,6 +146,7 @@ INTERVAL_RATING_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "normal", "high"], options=["low", "normal", "high"],
entity_registry_enabled_default=False, # Level is more commonly used
), ),
SensorEntityDescription( SensorEntityDescription(
key="previous_interval_price_rating", key="previous_interval_price_rating",
@ -222,6 +224,7 @@ ROLLING_HOUR_RATING_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "normal", "high"], options=["low", "normal", "high"],
entity_registry_enabled_default=False, # Level is more commonly used
), ),
SensorEntityDescription( SensorEntityDescription(
key="next_hour_price_rating", key="next_hour_price_rating",
@ -232,6 +235,7 @@ ROLLING_HOUR_RATING_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "normal", "high"], options=["low", "normal", "high"],
entity_registry_enabled_default=False, # Level is more commonly used
), ),
) )
@ -355,6 +359,7 @@ DAILY_RATING_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "normal", "high"], options=["low", "normal", "high"],
entity_registry_enabled_default=False, # Level is more commonly used
), ),
SensorEntityDescription( SensorEntityDescription(
key="tomorrow_price_rating", key="tomorrow_price_rating",
@ -365,6 +370,7 @@ DAILY_RATING_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "normal", "high"], options=["low", "normal", "high"],
entity_registry_enabled_default=False, # Level is more commonly used
), ),
) )
@ -391,6 +397,7 @@ WINDOW_24H_SENSORS = (
icon="mdi:chart-line-variant", icon="mdi:chart-line-variant",
device_class=SensorDeviceClass.MONETARY, device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.TOTAL, # MONETARY requires TOTAL or None state_class=SensorStateClass.TOTAL, # MONETARY requires TOTAL or None
entity_registry_enabled_default=False, # Advanced use case
suggested_display_precision=1, suggested_display_precision=1,
), ),
SensorEntityDescription( SensorEntityDescription(
@ -420,6 +427,7 @@ WINDOW_24H_SENSORS = (
icon="mdi:arrow-collapse-down", icon="mdi:arrow-collapse-down",
device_class=SensorDeviceClass.MONETARY, device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.TOTAL, # MONETARY requires TOTAL or None state_class=SensorStateClass.TOTAL, # MONETARY requires TOTAL or None
entity_registry_enabled_default=False, # Advanced use case
suggested_display_precision=1, suggested_display_precision=1,
), ),
SensorEntityDescription( SensorEntityDescription(
@ -429,6 +437,7 @@ WINDOW_24H_SENSORS = (
icon="mdi:arrow-collapse-up", icon="mdi:arrow-collapse-up",
device_class=SensorDeviceClass.MONETARY, device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.TOTAL, # MONETARY requires TOTAL or None state_class=SensorStateClass.TOTAL, # MONETARY requires TOTAL or None
entity_registry_enabled_default=False, # Advanced use case
suggested_display_precision=1, suggested_display_precision=1,
), ),
) )
@ -635,6 +644,7 @@ VOLATILITY_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "moderate", "high", "very_high"], options=["low", "moderate", "high", "very_high"],
entity_registry_enabled_default=False, # Today's volatility is usually sufficient
), ),
SensorEntityDescription( SensorEntityDescription(
key="next_24h_volatility", key="next_24h_volatility",
@ -645,6 +655,7 @@ VOLATILITY_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "moderate", "high", "very_high"], options=["low", "moderate", "high", "very_high"],
entity_registry_enabled_default=False, # Advanced use case
), ),
SensorEntityDescription( SensorEntityDescription(
key="today_tomorrow_volatility", key="today_tomorrow_volatility",
@ -655,6 +666,7 @@ VOLATILITY_SENSORS = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
state_class=None, # Enum values: no statistics state_class=None, # Enum values: no statistics
options=["low", "moderate", "high", "very_high"], options=["low", "moderate", "high", "very_high"],
entity_registry_enabled_default=False, # Advanced use case
), ),
) )