Problem
The sensors green_energy_session and grid_energy_session are defined with
state_class = SensorStateClass.MEASUREMENT while using device_class = SensorDeviceClass.ENERGY.
Home Assistant considers this combination invalid and logs a warning at startup,
because an ENERGY device_class expects TOTAL or TOTAL_INCREASING, not MEASUREMENT.
Environment
- Integration: wallbox_gateway (installed via HACS, v0.22.0)
- Gateway firmware: v3.2.0-beta.13 (botts7/esp32-wallbox)
- Home Assistant Core (container)
Location
custom_components/wallbox_gateway/sensor.py — the green_energy_session and
grid_energy_session sensor definitions.
Suggested fix
Use SensorStateClass.TOTAL_INCREASING for both sensors, matching the sibling
session_energy sensor which is already correct.
Log
Entity ... has state class measurement and unit ... but device class energy ...
which is impossible. Please update ...
Problem
The sensors
green_energy_sessionandgrid_energy_sessionare defined withstate_class = SensorStateClass.MEASUREMENTwhile usingdevice_class = SensorDeviceClass.ENERGY.Home Assistant considers this combination invalid and logs a warning at startup,
because an ENERGY device_class expects
TOTALorTOTAL_INCREASING, notMEASUREMENT.Environment
Location
custom_components/wallbox_gateway/sensor.py— thegreen_energy_sessionandgrid_energy_sessionsensor definitions.Suggested fix
Use
SensorStateClass.TOTAL_INCREASINGfor both sensors, matching the siblingsession_energysensor which is already correct.Log