diff --git a/homeassistant/components/solarlog/const.py b/homeassistant/components/solarlog/const.py index a339f5c873d..e4e10b3a7e6 100644 --- a/homeassistant/components/solarlog/const.py +++ b/homeassistant/components/solarlog/const.py @@ -167,9 +167,10 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = ( SolarLogSensorEntityDescription( key="total_power", json_key="totalPOWER", - name="total power", + name="installed peak power", icon="mdi:solar-power", - native_unit_of_measurement="Wp", + native_unit_of_measurement=POWER_WATT, + device_class=DEVICE_CLASS_POWER, ), SolarLogSensorEntityDescription( key="alternator_loss", @@ -185,7 +186,8 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = ( json_key="CAPACITY", name="capacity", icon="mdi:solar-power", - native_unit_of_measurement="W/Wp", + native_unit_of_measurement=PERCENTAGE, + device_class=DEVICE_CLASS_POWER_FACTOR, state_class=STATE_CLASS_MEASUREMENT, ), SolarLogSensorEntityDescription( diff --git a/homeassistant/components/solarlog/sensor.py b/homeassistant/components/solarlog/sensor.py index 5df86d64997..e87977f64e5 100644 --- a/homeassistant/components/solarlog/sensor.py +++ b/homeassistant/components/solarlog/sensor.py @@ -97,7 +97,7 @@ class SolarlogData: self.data["consumptionTOTAL"] = self.api.consumption_total / 1000 self.data["totalPOWER"] = self.api.total_power self.data["alternatorLOSS"] = self.api.alternator_loss - self.data["CAPACITY"] = round(self.api.capacity, 3) + self.data["CAPACITY"] = round(self.api.capacity * 100, 0) self.data["EFFICIENCY"] = round(self.api.efficiency * 100, 0) self.data["powerAVAILABLE"] = self.api.power_available self.data["USAGE"] = round(self.api.usage * 100, 0)