diff --git a/homeassistant/components/vicare/sensor.py b/homeassistant/components/vicare/sensor.py index a0d7208f1b2..6f1b6097c4f 100644 --- a/homeassistant/components/vicare/sensor.py +++ b/homeassistant/components/vicare/sensor.py @@ -189,10 +189,74 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = ( state_class=SensorStateClass.MEASUREMENT, ), ViCareSensorEntityDescription( - key="solar power production", - name="Solar Power Production", + key="solar power production today", + name="Solar power production today", native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, - value_getter=lambda api: api.getSolarPowerProduction(), + value_getter=lambda api: api.getSolarPowerProductionToday(), + unit_getter=lambda api: api.getSolarPowerProductionUnit(), + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="solar power production this week", + name="Solar power production this week", + native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, + value_getter=lambda api: api.getSolarPowerProductionThisWeek(), + unit_getter=lambda api: api.getSolarPowerProductionUnit(), + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="solar power production this month", + name="Solar power production this month", + native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, + value_getter=lambda api: api.getSolarPowerProductionThisMonth(), + unit_getter=lambda api: api.getSolarPowerProductionUnit(), + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="solar power production this year", + name="Solar power production this year", + native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, + value_getter=lambda api: api.getSolarPowerProductionThisYear(), + unit_getter=lambda api: api.getSolarPowerProductionUnit(), + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="power consumption today", + name="Power consumption today", + native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, + value_getter=lambda api: api.getPowerConsumptionToday(), + unit_getter=lambda api: api.getPowerConsumptionUnit(), + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="power consumption this week", + name="Power consumption this week", + native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, + value_getter=lambda api: api.getPowerConsumptionThisWeek(), + unit_getter=lambda api: api.getPowerConsumptionUnit(), + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="power consumption this month", + name="Power consumption this month", + native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, + value_getter=lambda api: api.getPowerConsumptionThisMonth(), + unit_getter=lambda api: api.getPowerConsumptionUnit(), + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="power consumption this year", + name="Power consumption this year", + native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, + value_getter=lambda api: api.getPowerConsumptionThisYear(), + unit_getter=lambda api: api.getPowerConsumptionUnit(), device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, ),