mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Vicare Gas & Power consumption summary sensors (#66458)
This commit is contained in:
parent
1cc9800a93
commit
20d9f2d3b7
@ -27,6 +27,7 @@ from homeassistant.const import (
|
|||||||
POWER_WATT,
|
POWER_WATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TIME_HOURS,
|
TIME_HOURS,
|
||||||
|
VOLUME_CUBIC_METERS,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -132,6 +133,126 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
unit_getter=lambda api: api.getGasConsumptionHeatingUnit(),
|
unit_getter=lambda api: api.getGasConsumptionHeatingUnit(),
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="gas_summary_consumption_heating_currentday",
|
||||||
|
name="Heating gas consumption current day",
|
||||||
|
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||||
|
value_getter=lambda api: api.getGasSummaryConsumptionHeatingCurrentDay(),
|
||||||
|
unit_getter=lambda api: api.getGasSummaryConsumptionHeatingUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="gas_summary_consumption_heating_currentmonth",
|
||||||
|
name="Heating gas consumption current month",
|
||||||
|
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||||
|
value_getter=lambda api: api.getGasSummaryConsumptionHeatingCurrentMonth(),
|
||||||
|
unit_getter=lambda api: api.getGasSummaryConsumptionHeatingUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="gas_summary_consumption_heating_currentyear",
|
||||||
|
name="Heating gas consumption current year",
|
||||||
|
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||||
|
value_getter=lambda api: api.getGasSummaryConsumptionHeatingCurrentYear(),
|
||||||
|
unit_getter=lambda api: api.getGasSummaryConsumptionHeatingUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="hotwater_gas_summary_consumption_heating_currentday",
|
||||||
|
name="Hot water gas consumption current day",
|
||||||
|
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||||
|
value_getter=lambda api: api.getGasSummaryConsumptionDomesticHotWaterCurrentDay(),
|
||||||
|
unit_getter=lambda api: api.getGasSummaryConsumptionDomesticHotWaterUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="hotwater_gas_summary_consumption_heating_currentmonth",
|
||||||
|
name="Hot water gas consumption current month",
|
||||||
|
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||||
|
value_getter=lambda api: api.getGasSummaryConsumptionDomesticHotWaterCurrentMonth(),
|
||||||
|
unit_getter=lambda api: api.getGasSummaryConsumptionDomesticHotWaterUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="hotwater_gas_summary_consumption_heating_currentyear",
|
||||||
|
name="Hot water gas consumption current year",
|
||||||
|
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||||
|
value_getter=lambda api: api.getGasSummaryConsumptionDomesticHotWaterCurrentYear(),
|
||||||
|
unit_getter=lambda api: api.getGasSummaryConsumptionDomesticHotWaterUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="hotwater_gas_summary_consumption_heating_lastsevendays",
|
||||||
|
name="Hot water gas consumption last seven days",
|
||||||
|
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||||
|
value_getter=lambda api: api.getGasSummaryConsumptionDomesticHotWaterLastSevenDays(),
|
||||||
|
unit_getter=lambda api: api.getGasSummaryConsumptionDomesticHotWaterUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="energy_summary_consumption_heating_currentday",
|
||||||
|
name="Energy consumption of gas heating current day",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
value_getter=lambda api: api.getPowerSummaryConsumptionHeatingCurrentDay(),
|
||||||
|
unit_getter=lambda api: api.getPowerSummaryConsumptionHeatingUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="energy_summary_consumption_heating_currentmonth",
|
||||||
|
name="Energy consumption of gas heating current month",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
value_getter=lambda api: api.getPowerSummaryConsumptionHeatingCurrentMonth(),
|
||||||
|
unit_getter=lambda api: api.getPowerSummaryConsumptionHeatingUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="energy_summary_consumption_heating_currentyear",
|
||||||
|
name="Energy consumption of gas heating current year",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
value_getter=lambda api: api.getPowerSummaryConsumptionHeatingCurrentYear(),
|
||||||
|
unit_getter=lambda api: api.getPowerSummaryConsumptionHeatingUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="energy_summary_consumption_heating_lastsevendays",
|
||||||
|
name="Energy consumption of gas heating last seven days",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
value_getter=lambda api: api.getPowerSummaryConsumptionHeatingLastSevenDays(),
|
||||||
|
unit_getter=lambda api: api.getPowerSummaryConsumptionHeatingUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="energy_dhw_summary_consumption_heating_currentday",
|
||||||
|
name="Energy consumption of hot water gas heating current day",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
value_getter=lambda api: api.getPowerSummaryConsumptionDomesticHotWaterCurrentDay(),
|
||||||
|
unit_getter=lambda api: api.getPowerSummaryConsumptionDomesticHotWaterUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="energy_dhw_summary_consumption_heating_currentmonth",
|
||||||
|
name="Energy consumption of hot water gas heating current month",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
value_getter=lambda api: api.getPowerSummaryConsumptionDomesticHotWaterCurrentMonth(),
|
||||||
|
unit_getter=lambda api: api.getPowerSummaryConsumptionDomesticHotWaterUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="energy_dhw_summary_consumption_heating_currentyear",
|
||||||
|
name="Energy consumption of hot water gas heating current year",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
value_getter=lambda api: api.getPowerSummaryConsumptionDomesticHotWaterCurrentYear(),
|
||||||
|
unit_getter=lambda api: api.getPowerSummaryConsumptionDomesticHotWaterUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="energy_summary_dhw_consumption_heating_lastsevendays",
|
||||||
|
name="Energy consumption of hot water gas heating last seven days",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
value_getter=lambda api: api.getPowerSummaryConsumptionDomesticHotWaterLastSevenDays(),
|
||||||
|
unit_getter=lambda api: api.getPowerSummaryConsumptionDomesticHotWaterUnit(),
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="power_production_current",
|
key="power_production_current",
|
||||||
name="Power production current",
|
name="Power production current",
|
||||||
@ -142,7 +263,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="power_production_today",
|
key="power_production_today",
|
||||||
name="Power production today",
|
name="Energy production today",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getPowerProductionToday(),
|
value_getter=lambda api: api.getPowerProductionToday(),
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
@ -158,7 +279,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="power_production_this_month",
|
key="power_production_this_month",
|
||||||
name="Power production this month",
|
name="Energy production this month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getPowerProductionThisMonth(),
|
value_getter=lambda api: api.getPowerProductionThisMonth(),
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
@ -166,7 +287,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="power_production_this_year",
|
key="power_production_this_year",
|
||||||
name="Power production this year",
|
name="Energy production this year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getPowerProductionThisYear(),
|
value_getter=lambda api: api.getPowerProductionThisYear(),
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
@ -190,7 +311,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="solar power production today",
|
key="solar power production today",
|
||||||
name="Solar power production today",
|
name="Solar energy production today",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getSolarPowerProductionToday(),
|
value_getter=lambda api: api.getSolarPowerProductionToday(),
|
||||||
unit_getter=lambda api: api.getSolarPowerProductionUnit(),
|
unit_getter=lambda api: api.getSolarPowerProductionUnit(),
|
||||||
@ -199,7 +320,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="solar power production this week",
|
key="solar power production this week",
|
||||||
name="Solar power production this week",
|
name="Solar energy production this week",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getSolarPowerProductionThisWeek(),
|
value_getter=lambda api: api.getSolarPowerProductionThisWeek(),
|
||||||
unit_getter=lambda api: api.getSolarPowerProductionUnit(),
|
unit_getter=lambda api: api.getSolarPowerProductionUnit(),
|
||||||
@ -208,7 +329,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="solar power production this month",
|
key="solar power production this month",
|
||||||
name="Solar power production this month",
|
name="Solar energy production this month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getSolarPowerProductionThisMonth(),
|
value_getter=lambda api: api.getSolarPowerProductionThisMonth(),
|
||||||
unit_getter=lambda api: api.getSolarPowerProductionUnit(),
|
unit_getter=lambda api: api.getSolarPowerProductionUnit(),
|
||||||
@ -217,7 +338,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="solar power production this year",
|
key="solar power production this year",
|
||||||
name="Solar power production this year",
|
name="Solar energy production this year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getSolarPowerProductionThisYear(),
|
value_getter=lambda api: api.getSolarPowerProductionThisYear(),
|
||||||
unit_getter=lambda api: api.getSolarPowerProductionUnit(),
|
unit_getter=lambda api: api.getSolarPowerProductionUnit(),
|
||||||
@ -226,7 +347,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="power consumption today",
|
key="power consumption today",
|
||||||
name="Power consumption today",
|
name="Energy consumption today",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getPowerConsumptionToday(),
|
value_getter=lambda api: api.getPowerConsumptionToday(),
|
||||||
unit_getter=lambda api: api.getPowerConsumptionUnit(),
|
unit_getter=lambda api: api.getPowerConsumptionUnit(),
|
||||||
@ -244,7 +365,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="power consumption this month",
|
key="power consumption this month",
|
||||||
name="Power consumption this month",
|
name="Energy consumption this month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getPowerConsumptionThisMonth(),
|
value_getter=lambda api: api.getPowerConsumptionThisMonth(),
|
||||||
unit_getter=lambda api: api.getPowerConsumptionUnit(),
|
unit_getter=lambda api: api.getPowerConsumptionUnit(),
|
||||||
@ -253,7 +374,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="power consumption this year",
|
key="power consumption this year",
|
||||||
name="Power consumption this year",
|
name="Energy consumption this year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
value_getter=lambda api: api.getPowerConsumptionThisYear(),
|
value_getter=lambda api: api.getPowerConsumptionThisYear(),
|
||||||
unit_getter=lambda api: api.getPowerConsumptionUnit(),
|
unit_getter=lambda api: api.getPowerConsumptionUnit(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user