Feature Request: Add state_class to power sensors for long-term statistics support
Describe the feature you'd like
Add state_class: measurement (or appropriate value) to power sensors like ge_inverter_*_battery_power so Home Assistant generates long-term statistics and they work in Statistics Graph cards and the Energy dashboard.
Why is this feature needed?
- Currently these sensors have
device_class: power and unit_of_measurement: W but lack state_class, so HA shows history data but "No statistics found" in graphs.
- Users must create workaround template sensors to get stats working, which adds complexity for something as common as power monitoring.
- Energy dashboard integration is broken without this (instantaneous power sensors need
state_class: measurement per HA docs).
Example affected entity
sensor.ge_inverter_[SERIAL]_battery_power
Attributes:
unit_of_measurement: W
device_class: power
icon: mdi:battery-charging-wireless-60
friendly_name: GE Inverter [SERIAL] Battery Power
Missing: state_class
Suggested implementation
In custom_components/ge_cloud/sensor.py (or wherever these entities are defined), add to the sensor platform description:
SENSOR_SCHEMA = sensor.SensorEntityDescription(
# ... existing keys ...
state_class=sensor.StateClass.MEASUREMENT,
)
Additional context
Feature Request: Add
state_classto power sensors for long-term statistics supportDescribe the feature you'd like
Add
state_class: measurement(or appropriate value) to power sensors likege_inverter_*_battery_powerso Home Assistant generates long-term statistics and they work in Statistics Graph cards and the Energy dashboard.Why is this feature needed?
device_class: powerandunit_of_measurement: Wbut lackstate_class, so HA shows history data but "No statistics found" in graphs.state_class: measurementper HA docs).Example affected entity
Attributes:
Missing:
state_classSuggested implementation
In
custom_components/ge_cloud/sensor.py(or wherever these entities are defined), add to the sensor platform description:Additional context