Use UnitOfEnergy in integrations (a-n) (#84220)
This commit is contained in:
parent
ebdf9a8658
commit
0dd20fb309
29 changed files with 191 additions and 202 deletions
|
@ -20,7 +20,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CURRENCY_DOLLAR, ENERGY_KILO_WATT_HOUR, PERCENTAGE
|
from homeassistant.const import CURRENCY_DOLLAR, PERCENTAGE, UnitOfEnergy
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
@ -34,7 +34,7 @@ ICONS = {
|
||||||
"feed_in": "mdi:solar-power",
|
"feed_in": "mdi:solar-power",
|
||||||
}
|
}
|
||||||
|
|
||||||
UNIT = f"{CURRENCY_DOLLAR}/{ENERGY_KILO_WATT_HOUR}"
|
UNIT = f"{CURRENCY_DOLLAR}/{UnitOfEnergy.KILO_WATT_HOUR}"
|
||||||
|
|
||||||
|
|
||||||
def format_cents_to_dollars(cents: float) -> float:
|
def format_cents_to_dollars(cents: float) -> float:
|
||||||
|
|
|
@ -17,7 +17,7 @@ from homeassistant.const import (
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
CONF_PASSWORD,
|
CONF_PASSWORD,
|
||||||
CONF_USERNAME,
|
CONF_USERNAME,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -266,7 +266,7 @@ class AtomeSensor(SensorEntity):
|
||||||
self._attr_state_class = SensorStateClass.MEASUREMENT
|
self._attr_state_class = SensorStateClass.MEASUREMENT
|
||||||
else:
|
else:
|
||||||
self._attr_device_class = SensorDeviceClass.ENERGY
|
self._attr_device_class = SensorDeviceClass.ENERGY
|
||||||
self._attr_native_unit_of_measurement = ENERGY_KILO_WATT_HOUR
|
self._attr_native_unit_of_measurement = UnitOfEnergy.KILO_WATT_HOUR
|
||||||
self._attr_state_class = SensorStateClass.TOTAL_INCREASING
|
self._attr_state_class = SensorStateClass.TOTAL_INCREASING
|
||||||
|
|
||||||
def update(self) -> None:
|
def update(self) -> None:
|
||||||
|
|
|
@ -14,7 +14,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ENERGY_KILO_WATT_HOUR, TEMP_CELSIUS, UnitOfPower
|
from homeassistant.const import TEMP_CELSIUS, UnitOfEnergy, UnitOfPower
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -43,7 +43,7 @@ SENSOR_TYPES = [
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="totalenergy",
|
key="totalenergy",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
name="Total Energy",
|
name="Total Energy",
|
||||||
),
|
),
|
||||||
|
|
|
@ -12,9 +12,9 @@ from homeassistant.components.sensor import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -321,7 +321,7 @@ class EnergySensor(SHCEntity, SensorEntity):
|
||||||
|
|
||||||
_attr_device_class = SensorDeviceClass.ENERGY
|
_attr_device_class = SensorDeviceClass.ENERGY
|
||||||
_attr_state_class = SensorStateClass.TOTAL_INCREASING
|
_attr_state_class = SensorStateClass.TOTAL_INCREASING
|
||||||
_attr_native_unit_of_measurement = ENERGY_KILO_WATT_HOUR
|
_attr_native_unit_of_measurement = UnitOfEnergy.KILO_WATT_HOUR
|
||||||
|
|
||||||
def __init__(self, device: SHCDevice, parent_id: str, entry_id: str) -> None:
|
def __init__(self, device: SHCDevice, parent_id: str, entry_id: str) -> None:
|
||||||
"""Initialize an SHC energy reporting sensor."""
|
"""Initialize an SHC energy reporting sensor."""
|
||||||
|
|
|
@ -9,11 +9,11 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -81,7 +81,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="totalconsum",
|
key="totalconsum",
|
||||||
name="Total consumption",
|
name="Total consumption",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
|
|
@ -38,12 +38,12 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_RESOURCES,
|
CONF_RESOURCES,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
REVOLUTIONS_PER_MINUTE,
|
REVOLUTIONS_PER_MINUTE,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TIME_DAYS,
|
TIME_DAYS,
|
||||||
VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR,
|
VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -249,7 +249,7 @@ SENSOR_TYPES = (
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
name="Energy total",
|
name="Energy total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
sensor_id=SENSOR_POWER_TOTAL,
|
sensor_id=SENSOR_POWER_TOTAL,
|
||||||
),
|
),
|
||||||
ComfoconnectSensorEntityDescription(
|
ComfoconnectSensorEntityDescription(
|
||||||
|
@ -265,7 +265,7 @@ SENSOR_TYPES = (
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
name="Preheater energy total",
|
name="Preheater energy total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
sensor_id=SENSOR_PREHEATER_POWER_TOTAL,
|
sensor_id=SENSOR_PREHEATER_POWER_TOTAL,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -14,9 +14,9 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
|
@ -98,7 +98,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = (
|
||||||
name="Cool energy consumption",
|
name="Cool energy consumption",
|
||||||
icon="mdi:snowflake",
|
icon="mdi:snowflake",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_func=lambda device: round(device.last_hour_cool_energy_consumption, 2),
|
value_func=lambda device: round(device.last_hour_cool_energy_consumption, 2),
|
||||||
),
|
),
|
||||||
|
@ -107,7 +107,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = (
|
||||||
name="Heat energy consumption",
|
name="Heat energy consumption",
|
||||||
icon="mdi:fire",
|
icon="mdi:fire",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_func=lambda device: round(device.last_hour_heat_energy_consumption, 2),
|
value_func=lambda device: round(device.last_hour_heat_energy_consumption, 2),
|
||||||
),
|
),
|
||||||
|
@ -116,7 +116,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = (
|
||||||
name="Energy consumption",
|
name="Energy consumption",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
value_func=lambda device: round(device.today_energy_consumption, 2),
|
value_func=lambda device: round(device.today_energy_consumption, 2),
|
||||||
),
|
),
|
||||||
DaikinSensorEntityDescription(
|
DaikinSensorEntityDescription(
|
||||||
|
@ -134,7 +134,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = (
|
||||||
name="Compressor energy consumption",
|
name="Compressor energy consumption",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_func=lambda device: round(device.today_total_energy_consumption, 2),
|
value_func=lambda device: round(device.today_total_energy_consumption, 2),
|
||||||
),
|
),
|
||||||
|
|
|
@ -34,11 +34,11 @@ from homeassistant.const import (
|
||||||
ATTR_TEMPERATURE,
|
ATTR_TEMPERATURE,
|
||||||
ATTR_VOLTAGE,
|
ATTR_VOLTAGE,
|
||||||
CONCENTRATION_PARTS_PER_BILLION,
|
CONCENTRATION_PARTS_PER_BILLION,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
PRESSURE_HPA,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
@ -134,7 +134,7 @@ ENTITY_DESCRIPTIONS: tuple[DeconzSensorDescription, ...] = (
|
||||||
instance_check=Consumption,
|
instance_check=Consumption,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DeconzSensorDescription[Daylight](
|
DeconzSensorDescription[Daylight](
|
||||||
key="daylight_status",
|
key="daylight_status",
|
||||||
|
|
|
@ -12,15 +12,15 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CURRENCY_EURO,
|
CURRENCY_EURO,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
VOLUME_CUBIC_METERS,
|
VOLUME_CUBIC_METERS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
PRICE_EUR_KWH: Final = f"EUR/{ENERGY_KILO_WATT_HOUR}"
|
PRICE_EUR_KWH: Final = f"EUR/{UnitOfEnergy.KILO_WATT_HOUR}"
|
||||||
PRICE_EUR_M3: Final = f"EUR/{VOLUME_CUBIC_METERS}"
|
PRICE_EUR_M3: Final = f"EUR/{VOLUME_CUBIC_METERS}"
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,28 +50,28 @@ SENSORS: tuple[DSMRReaderSensorEntityDescription, ...] = (
|
||||||
key="dsmr/reading/electricity_delivered_1",
|
key="dsmr/reading/electricity_delivered_1",
|
||||||
name="Low tariff usage",
|
name="Low tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/reading/electricity_returned_1",
|
key="dsmr/reading/electricity_returned_1",
|
||||||
name="Low tariff returned",
|
name="Low tariff returned",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/reading/electricity_delivered_2",
|
key="dsmr/reading/electricity_delivered_2",
|
||||||
name="High tariff usage",
|
name="High tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/reading/electricity_returned_2",
|
key="dsmr/reading/electricity_returned_2",
|
||||||
name="High tariff returned",
|
name="High tariff returned",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
|
@ -224,37 +224,37 @@ SENSORS: tuple[DSMRReaderSensorEntityDescription, ...] = (
|
||||||
key="dsmr/day-consumption/electricity1",
|
key="dsmr/day-consumption/electricity1",
|
||||||
name="Low tariff usage",
|
name="Low tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/day-consumption/electricity2",
|
key="dsmr/day-consumption/electricity2",
|
||||||
name="High tariff usage",
|
name="High tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/day-consumption/electricity1_returned",
|
key="dsmr/day-consumption/electricity1_returned",
|
||||||
name="Low tariff return",
|
name="Low tariff return",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/day-consumption/electricity2_returned",
|
key="dsmr/day-consumption/electricity2_returned",
|
||||||
name="High tariff return",
|
name="High tariff return",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/day-consumption/electricity_merged",
|
key="dsmr/day-consumption/electricity_merged",
|
||||||
name="Power usage total",
|
name="Power usage total",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/day-consumption/electricity_returned_merged",
|
key="dsmr/day-consumption/electricity_returned_merged",
|
||||||
name="Power return total",
|
name="Power return total",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/day-consumption/electricity1_cost",
|
key="dsmr/day-consumption/electricity1_cost",
|
||||||
|
@ -399,37 +399,37 @@ SENSORS: tuple[DSMRReaderSensorEntityDescription, ...] = (
|
||||||
key="dsmr/current-month/electricity1",
|
key="dsmr/current-month/electricity1",
|
||||||
name="Current month low tariff usage",
|
name="Current month low tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-month/electricity2",
|
key="dsmr/current-month/electricity2",
|
||||||
name="Current month high tariff usage",
|
name="Current month high tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-month/electricity1_returned",
|
key="dsmr/current-month/electricity1_returned",
|
||||||
name="Current month low tariff returned",
|
name="Current month low tariff returned",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-month/electricity2_returned",
|
key="dsmr/current-month/electricity2_returned",
|
||||||
name="Current month high tariff returned",
|
name="Current month high tariff returned",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-month/electricity_merged",
|
key="dsmr/current-month/electricity_merged",
|
||||||
name="Current month power usage total",
|
name="Current month power usage total",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-month/electricity_returned_merged",
|
key="dsmr/current-month/electricity_returned_merged",
|
||||||
name="Current month power return total",
|
name="Current month power return total",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-month/electricity1_cost",
|
key="dsmr/current-month/electricity1_cost",
|
||||||
|
@ -477,37 +477,37 @@ SENSORS: tuple[DSMRReaderSensorEntityDescription, ...] = (
|
||||||
key="dsmr/current-year/electricity1",
|
key="dsmr/current-year/electricity1",
|
||||||
name="Current year low tariff usage",
|
name="Current year low tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-year/electricity2",
|
key="dsmr/current-year/electricity2",
|
||||||
name="Current year high tariff usage",
|
name="Current year high tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-year/electricity1_returned",
|
key="dsmr/current-year/electricity1_returned",
|
||||||
name="Current year low tariff returned",
|
name="Current year low tariff returned",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-year/electricity2_returned",
|
key="dsmr/current-year/electricity2_returned",
|
||||||
name="Current year high tariff usage",
|
name="Current year high tariff usage",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-year/electricity_merged",
|
key="dsmr/current-year/electricity_merged",
|
||||||
name="Current year power usage total",
|
name="Current year power usage total",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-year/electricity_returned_merged",
|
key="dsmr/current-year/electricity_returned_merged",
|
||||||
name="Current year power returned total",
|
name="Current year power returned total",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
DSMRReaderSensorEntityDescription(
|
DSMRReaderSensorEntityDescription(
|
||||||
key="dsmr/current-year/electricity1_cost",
|
key="dsmr/current-year/electricity1_cost",
|
||||||
|
|
|
@ -18,10 +18,9 @@ from homeassistant.components.sensor import (
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
DEGREE,
|
DEGREE,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
ENERGY_WATT_HOUR,
|
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
|
@ -255,8 +254,8 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
SENSORS = {desc.key: desc for desc in SENSOR_TYPES}
|
SENSORS = {desc.key: desc for desc in SENSOR_TYPES}
|
||||||
|
|
||||||
SENSOR_UNIT_MAPPING = {
|
SENSOR_UNIT_MAPPING = {
|
||||||
"Wh": ENERGY_WATT_HOUR,
|
"Wh": UnitOfEnergy.WATT_HOUR,
|
||||||
"kWh": ENERGY_KILO_WATT_HOUR,
|
"kWh": UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
"W": UnitOfPower.WATT,
|
"W": UnitOfPower.WATT,
|
||||||
"A": UnitOfElectricCurrent.AMPERE,
|
"A": UnitOfElectricCurrent.AMPERE,
|
||||||
"V": UnitOfElectricPotential.VOLT,
|
"V": UnitOfElectricPotential.VOLT,
|
||||||
|
|
|
@ -14,7 +14,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ENERGY_KILO_WATT_HOUR, UnitOfPower
|
from homeassistant.const import UnitOfEnergy, UnitOfPower
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_platform
|
from homeassistant.helpers import entity_platform
|
||||||
from homeassistant.helpers.typing import StateType
|
from homeassistant.helpers.typing import StateType
|
||||||
|
@ -34,7 +34,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
key="energy_day",
|
key="energy_day",
|
||||||
name="Daily Consumption",
|
name="Daily Consumption",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
|
@ -42,7 +42,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
key="energy_week",
|
key="energy_week",
|
||||||
name="Weekly Consumption",
|
name="Weekly Consumption",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
|
@ -50,14 +50,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
key="energy_month",
|
key="energy_month",
|
||||||
name="Monthly Consumption",
|
name="Monthly Consumption",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="energy_year",
|
key="energy_year",
|
||||||
name="Yearly Consumption",
|
name="Yearly Consumption",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
|
|
|
@ -8,7 +8,7 @@ from pyflick import FlickAPI, FlickPrice
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity
|
from homeassistant.components.sensor import SensorEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_FRIENDLY_NAME, CURRENCY_CENT, ENERGY_KILO_WATT_HOUR
|
from homeassistant.const import ATTR_FRIENDLY_NAME, CURRENCY_CENT, UnitOfEnergy
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util.dt import utcnow
|
from homeassistant.util.dt import utcnow
|
||||||
|
@ -35,7 +35,7 @@ class FlickPricingSensor(SensorEntity):
|
||||||
"""Entity object for Flick Electric sensor."""
|
"""Entity object for Flick Electric sensor."""
|
||||||
|
|
||||||
_attr_attribution = "Data provided by Flick Electric"
|
_attr_attribution = "Data provided by Flick Electric"
|
||||||
_attr_native_unit_of_measurement = f"{CURRENCY_CENT}/{ENERGY_KILO_WATT_HOUR}"
|
_attr_native_unit_of_measurement = f"{CURRENCY_CENT}/{UnitOfEnergy.KILO_WATT_HOUR}"
|
||||||
|
|
||||||
def __init__(self, api: FlickAPI) -> None:
|
def __init__(self, api: FlickAPI) -> None:
|
||||||
"""Entity object for Flick Electric sensor."""
|
"""Entity object for Flick Electric sensor."""
|
||||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
||||||
from homeassistant.const import ENERGY_KILO_WATT_HOUR, UnitOfPower
|
from homeassistant.const import UnitOfEnergy, UnitOfPower
|
||||||
|
|
||||||
from .models import ForecastSolarSensorEntityDescription
|
from .models import ForecastSolarSensorEntityDescription
|
||||||
|
|
||||||
|
@ -22,14 +22,14 @@ SENSORS: tuple[ForecastSolarSensorEntityDescription, ...] = (
|
||||||
name="Estimated energy production - today",
|
name="Estimated energy production - today",
|
||||||
state=lambda estimate: estimate.energy_production_today / 1000,
|
state=lambda estimate: estimate.energy_production_today / 1000,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
ForecastSolarSensorEntityDescription(
|
ForecastSolarSensorEntityDescription(
|
||||||
key="energy_production_tomorrow",
|
key="energy_production_tomorrow",
|
||||||
name="Estimated energy production - tomorrow",
|
name="Estimated energy production - tomorrow",
|
||||||
state=lambda estimate: estimate.energy_production_tomorrow / 1000,
|
state=lambda estimate: estimate.energy_production_tomorrow / 1000,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
ForecastSolarSensorEntityDescription(
|
ForecastSolarSensorEntityDescription(
|
||||||
key="power_highest_peak_time_today",
|
key="power_highest_peak_time_today",
|
||||||
|
@ -84,13 +84,13 @@ SENSORS: tuple[ForecastSolarSensorEntityDescription, ...] = (
|
||||||
name="Estimated energy production - this hour",
|
name="Estimated energy production - this hour",
|
||||||
state=lambda estimate: estimate.energy_current_hour / 1000,
|
state=lambda estimate: estimate.energy_current_hour / 1000,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
ForecastSolarSensorEntityDescription(
|
ForecastSolarSensorEntityDescription(
|
||||||
key="energy_next_hour",
|
key="energy_next_hour",
|
||||||
state=lambda estimate: estimate.sum_energy_production(1) / 1000,
|
state=lambda estimate: estimate.sum_energy_production(1) / 1000,
|
||||||
name="Estimated energy production - next hour",
|
name="Estimated energy production - next hour",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,11 +17,11 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -158,7 +158,7 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
||||||
FritzSensorEntityDescription(
|
FritzSensorEntityDescription(
|
||||||
key="total_energy",
|
key="total_energy",
|
||||||
name="Total Energy",
|
name="Total Energy",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return]
|
suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return]
|
||||||
|
|
|
@ -11,7 +11,6 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
SIGNAL_STRENGTH_DECIBELS,
|
SIGNAL_STRENGTH_DECIBELS,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
@ -19,6 +18,7 @@ from homeassistant.const import (
|
||||||
TIME_SECONDS,
|
TIME_SECONDS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -64,7 +64,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
key="whOut",
|
key="whOut",
|
||||||
name="Wh out",
|
name="Wh out",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
|
@ -72,7 +72,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
key="whStored",
|
key="whStored",
|
||||||
name="Wh stored",
|
name="Wh stored",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
|
|
|
@ -3,10 +3,10 @@ from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
|
@ -18,7 +18,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="inverter_energy_today",
|
key="inverter_energy_today",
|
||||||
name="Energy today",
|
name="Energy today",
|
||||||
api_key="powerToday",
|
api_key="powerToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
|
@ -26,7 +26,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="inverter_energy_total",
|
key="inverter_energy_total",
|
||||||
name="Lifetime energy output",
|
name="Lifetime energy output",
|
||||||
api_key="powerTotal",
|
api_key="powerTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
precision=1,
|
precision=1,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
|
|
|
@ -3,9 +3,9 @@ from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -24,14 +24,14 @@ MIX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="mix_battery_charge_today",
|
key="mix_battery_charge_today",
|
||||||
name="Battery charged today",
|
name="Battery charged today",
|
||||||
api_key="eBatChargeToday",
|
api_key="eBatChargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_battery_charge_lifetime",
|
key="mix_battery_charge_lifetime",
|
||||||
name="Lifetime battery charged",
|
name="Lifetime battery charged",
|
||||||
api_key="eBatChargeTotal",
|
api_key="eBatChargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
@ -39,14 +39,14 @@ MIX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="mix_battery_discharge_today",
|
key="mix_battery_discharge_today",
|
||||||
name="Battery discharged today",
|
name="Battery discharged today",
|
||||||
api_key="eBatDisChargeToday",
|
api_key="eBatDisChargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_battery_discharge_lifetime",
|
key="mix_battery_discharge_lifetime",
|
||||||
name="Lifetime battery discharged",
|
name="Lifetime battery discharged",
|
||||||
api_key="eBatDisChargeTotal",
|
api_key="eBatDisChargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
@ -54,14 +54,14 @@ MIX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="mix_solar_generation_today",
|
key="mix_solar_generation_today",
|
||||||
name="Solar energy today",
|
name="Solar energy today",
|
||||||
api_key="epvToday",
|
api_key="epvToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_solar_generation_lifetime",
|
key="mix_solar_generation_lifetime",
|
||||||
name="Lifetime solar energy",
|
name="Lifetime solar energy",
|
||||||
api_key="epvTotal",
|
api_key="epvTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
@ -98,14 +98,14 @@ MIX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="mix_load_consumption_today",
|
key="mix_load_consumption_today",
|
||||||
name="Load consumption today",
|
name="Load consumption today",
|
||||||
api_key="elocalLoadToday",
|
api_key="elocalLoadToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_load_consumption_lifetime",
|
key="mix_load_consumption_lifetime",
|
||||||
name="Lifetime load consumption",
|
name="Lifetime load consumption",
|
||||||
api_key="elocalLoadTotal",
|
api_key="elocalLoadTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
@ -113,14 +113,14 @@ MIX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="mix_export_to_grid_today",
|
key="mix_export_to_grid_today",
|
||||||
name="Export to grid today",
|
name="Export to grid today",
|
||||||
api_key="etoGridToday",
|
api_key="etoGridToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_export_to_grid_lifetime",
|
key="mix_export_to_grid_lifetime",
|
||||||
name="Lifetime export to grid",
|
name="Lifetime export to grid",
|
||||||
api_key="etogridTotal",
|
api_key="etogridTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
@ -193,35 +193,35 @@ MIX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="mix_system_production_today",
|
key="mix_system_production_today",
|
||||||
name="System production today (self-consumption + export)",
|
name="System production today (self-consumption + export)",
|
||||||
api_key="eCharge",
|
api_key="eCharge",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_load_consumption_solar_today",
|
key="mix_load_consumption_solar_today",
|
||||||
name="Load consumption today (solar)",
|
name="Load consumption today (solar)",
|
||||||
api_key="eChargeToday",
|
api_key="eChargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_self_consumption_today",
|
key="mix_self_consumption_today",
|
||||||
name="Self consumption today (solar + battery)",
|
name="Self consumption today (solar + battery)",
|
||||||
api_key="eChargeToday1",
|
api_key="eChargeToday1",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_load_consumption_battery_today",
|
key="mix_load_consumption_battery_today",
|
||||||
name="Load consumption today (battery)",
|
name="Load consumption today (battery)",
|
||||||
api_key="echarge1",
|
api_key="echarge1",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="mix_import_from_grid_today",
|
key="mix_import_from_grid_today",
|
||||||
name="Import from grid today (load)",
|
name="Import from grid today (load)",
|
||||||
api_key="etouser",
|
api_key="etouser",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
# This sensor is manually created using the most recent X-Axis value from the chartData
|
# This sensor is manually created using the most recent X-Axis value from the chartData
|
||||||
|
@ -236,7 +236,7 @@ MIX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="mix_import_from_grid_today_combined",
|
key="mix_import_from_grid_today_combined",
|
||||||
name="Import from grid today (load + charging)",
|
name="Import from grid today (load + charging)",
|
||||||
api_key="etouser_combined", # This id is not present in the raw API data, it is added by the sensor
|
api_key="etouser_combined", # This id is not present in the raw API data, it is added by the sensor
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
previous_value_drop_threshold=0.2,
|
previous_value_drop_threshold=0.2,
|
||||||
|
|
|
@ -3,10 +3,10 @@ from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
|
@ -18,14 +18,14 @@ STORAGE_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="storage_storage_production_today",
|
key="storage_storage_production_today",
|
||||||
name="Storage production today",
|
name="Storage production today",
|
||||||
api_key="eBatDisChargeToday",
|
api_key="eBatDisChargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="storage_storage_production_lifetime",
|
key="storage_storage_production_lifetime",
|
||||||
name="Lifetime Storage production",
|
name="Lifetime Storage production",
|
||||||
api_key="eBatDisChargeTotal",
|
api_key="eBatDisChargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
@ -33,21 +33,21 @@ STORAGE_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="storage_grid_discharge_today",
|
key="storage_grid_discharge_today",
|
||||||
name="Grid discharged today",
|
name="Grid discharged today",
|
||||||
api_key="eacDisChargeToday",
|
api_key="eacDisChargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="storage_load_consumption_today",
|
key="storage_load_consumption_today",
|
||||||
name="Load consumption today",
|
name="Load consumption today",
|
||||||
api_key="eopDischrToday",
|
api_key="eopDischrToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="storage_load_consumption_lifetime",
|
key="storage_load_consumption_lifetime",
|
||||||
name="Lifetime load consumption",
|
name="Lifetime load consumption",
|
||||||
api_key="eopDischrTotal",
|
api_key="eopDischrTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
@ -55,14 +55,14 @@ STORAGE_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="storage_grid_charged_today",
|
key="storage_grid_charged_today",
|
||||||
name="Grid charged today",
|
name="Grid charged today",
|
||||||
api_key="eacChargeToday",
|
api_key="eacChargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="storage_charge_storage_lifetime",
|
key="storage_charge_storage_lifetime",
|
||||||
name="Lifetime storaged charged",
|
name="Lifetime storaged charged",
|
||||||
api_key="eChargeTotal",
|
api_key="eChargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
@ -97,7 +97,7 @@ STORAGE_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="storage_charge_today",
|
key="storage_charge_today",
|
||||||
name="Charge today",
|
name="Charge today",
|
||||||
api_key="eChargeToday",
|
api_key="eChargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
|
@ -111,14 +111,14 @@ STORAGE_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="storage_import_from_grid_today",
|
key="storage_import_from_grid_today",
|
||||||
name="Import from grid today",
|
name="Import from grid today",
|
||||||
api_key="eToUserToday",
|
api_key="eToUserToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
key="storage_import_from_grid_total",
|
key="storage_import_from_grid_total",
|
||||||
name="Import from grid total",
|
name="Import from grid total",
|
||||||
api_key="eToUserTotal",
|
api_key="eToUserTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
|
|
@ -7,11 +7,11 @@ from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
|
@ -23,7 +23,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_today",
|
key="tlx_energy_today",
|
||||||
name="Energy today",
|
name="Energy today",
|
||||||
api_key="eacToday",
|
api_key="eacToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -32,7 +32,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_total",
|
key="tlx_energy_total",
|
||||||
name="Lifetime energy output",
|
name="Lifetime energy output",
|
||||||
api_key="eacTotal",
|
api_key="eacTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -42,7 +42,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_total_input_1",
|
key="tlx_energy_total_input_1",
|
||||||
name="Lifetime total energy input 1",
|
name="Lifetime total energy input 1",
|
||||||
api_key="epv1Total",
|
api_key="epv1Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -52,7 +52,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_today_input_1",
|
key="tlx_energy_today_input_1",
|
||||||
name="Energy Today Input 1",
|
name="Energy Today Input 1",
|
||||||
api_key="epv1Today",
|
api_key="epv1Today",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -85,7 +85,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_total_input_2",
|
key="tlx_energy_total_input_2",
|
||||||
name="Lifetime total energy input 2",
|
name="Lifetime total energy input 2",
|
||||||
api_key="epv2Total",
|
api_key="epv2Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -95,7 +95,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_today_input_2",
|
key="tlx_energy_today_input_2",
|
||||||
name="Energy Today Input 2",
|
name="Energy Today Input 2",
|
||||||
api_key="epv2Today",
|
api_key="epv2Today",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -128,7 +128,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_total_input_3",
|
key="tlx_energy_total_input_3",
|
||||||
name="Lifetime total energy input 3",
|
name="Lifetime total energy input 3",
|
||||||
api_key="epv3Total",
|
api_key="epv3Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -138,7 +138,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_today_input_3",
|
key="tlx_energy_today_input_3",
|
||||||
name="Energy Today Input 3",
|
name="Energy Today Input 3",
|
||||||
api_key="epv3Today",
|
api_key="epv3Today",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -171,7 +171,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_total_input_4",
|
key="tlx_energy_total_input_4",
|
||||||
name="Lifetime total energy input 4",
|
name="Lifetime total energy input 4",
|
||||||
api_key="epv4Total",
|
api_key="epv4Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -181,7 +181,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_energy_today_input_4",
|
key="tlx_energy_today_input_4",
|
||||||
name="Energy Today Input 4",
|
name="Energy Today Input 4",
|
||||||
api_key="epv4Today",
|
api_key="epv4Today",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
|
@ -214,7 +214,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_solar_generation_total",
|
key="tlx_solar_generation_total",
|
||||||
name="Lifetime total solar energy",
|
name="Lifetime total solar energy",
|
||||||
api_key="epvTotal",
|
api_key="epvTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
@ -295,7 +295,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_all_batteries_discharge_today",
|
key="tlx_all_batteries_discharge_today",
|
||||||
name="All batteries discharged today",
|
name="All batteries discharged today",
|
||||||
api_key="edischargeToday",
|
api_key="edischargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
@ -303,7 +303,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_all_batteries_discharge_total",
|
key="tlx_all_batteries_discharge_total",
|
||||||
name="Lifetime total all batteries discharged",
|
name="Lifetime total all batteries discharged",
|
||||||
api_key="edischargeTotal",
|
api_key="edischargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
@ -319,7 +319,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_battery_1_discharge_total",
|
key="tlx_battery_1_discharge_total",
|
||||||
name="Lifetime total battery 1 discharged",
|
name="Lifetime total battery 1 discharged",
|
||||||
api_key="bdc1DischargeTotal",
|
api_key="bdc1DischargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
@ -335,7 +335,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_battery_2_discharge_total",
|
key="tlx_battery_2_discharge_total",
|
||||||
name="Lifetime total battery 2 discharged",
|
name="Lifetime total battery 2 discharged",
|
||||||
api_key="bdc1DischargeTotal",
|
api_key="bdc1DischargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
@ -344,7 +344,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_all_batteries_charge_today",
|
key="tlx_all_batteries_charge_today",
|
||||||
name="All batteries charged today",
|
name="All batteries charged today",
|
||||||
api_key="echargeToday",
|
api_key="echargeToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
@ -352,7 +352,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_all_batteries_charge_total",
|
key="tlx_all_batteries_charge_total",
|
||||||
name="Lifetime total all batteries charged",
|
name="Lifetime total all batteries charged",
|
||||||
api_key="echargeTotal",
|
api_key="echargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
@ -368,7 +368,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_battery_1_charge_total",
|
key="tlx_battery_1_charge_total",
|
||||||
name="Lifetime total battery 1 charged",
|
name="Lifetime total battery 1 charged",
|
||||||
api_key="bdc1ChargeTotal",
|
api_key="bdc1ChargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
@ -384,7 +384,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_battery_2_charge_total",
|
key="tlx_battery_2_charge_total",
|
||||||
name="Lifetime total battery 2 charged",
|
name="Lifetime total battery 2 charged",
|
||||||
api_key="bdc1ChargeTotal",
|
api_key="bdc1ChargeTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
@ -393,7 +393,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_export_to_grid_today",
|
key="tlx_export_to_grid_today",
|
||||||
name="Export to grid today",
|
name="Export to grid today",
|
||||||
api_key="etoGridToday",
|
api_key="etoGridToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
@ -401,7 +401,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_export_to_grid_total",
|
key="tlx_export_to_grid_total",
|
||||||
name="Lifetime total export to grid",
|
name="Lifetime total export to grid",
|
||||||
api_key="etoGridTotal",
|
api_key="etoGridTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
@ -410,7 +410,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="tlx_load_consumption_today",
|
key="tlx_load_consumption_today",
|
||||||
name="Load consumption today",
|
name="Load consumption today",
|
||||||
api_key="elocalLoadToday",
|
api_key="elocalLoadToday",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
@ -418,7 +418,7 @@ TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="mix_load_consumption_total",
|
key="mix_load_consumption_total",
|
||||||
name="Lifetime total load consumption",
|
name="Lifetime total load consumption",
|
||||||
api_key="elocalLoadTotal",
|
api_key="elocalLoadTotal",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
never_resets=True,
|
never_resets=True,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
||||||
from homeassistant.const import ENERGY_KILO_WATT_HOUR, UnitOfPower
|
from homeassistant.const import UnitOfEnergy, UnitOfPower
|
||||||
|
|
||||||
from .sensor_entity_description import GrowattSensorEntityDescription
|
from .sensor_entity_description import GrowattSensorEntityDescription
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ TOTAL_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="total_energy_today",
|
key="total_energy_today",
|
||||||
name="Energy Today",
|
name="Energy Today",
|
||||||
api_key="todayEnergy",
|
api_key="todayEnergy",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
|
@ -37,7 +37,7 @@ TOTAL_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
||||||
key="total_energy_output",
|
key="total_energy_output",
|
||||||
name="Lifetime energy output",
|
name="Lifetime energy output",
|
||||||
api_key="totalEnergy",
|
api_key="totalEnergy",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
),
|
),
|
||||||
|
|
|
@ -24,7 +24,6 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
ELECTRIC_CURRENT_AMPERE,
|
ELECTRIC_CURRENT_AMPERE,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
PRESSURE_HPA,
|
||||||
|
@ -32,6 +31,7 @@ from homeassistant.const import (
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
Platform,
|
Platform,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
UnitOfSoundPressure,
|
UnitOfSoundPressure,
|
||||||
)
|
)
|
||||||
|
@ -167,7 +167,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||||
name="Energy kWh",
|
name="Energy kWh",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT,
|
key=CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT,
|
||||||
|
@ -181,7 +181,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||||
name="Energy kWh",
|
name="Energy kWh",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.VENDOR_EVE_ENERGY_VOLTAGE: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.VENDOR_EVE_ENERGY_VOLTAGE: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.VENDOR_EVE_ENERGY_VOLTAGE,
|
key=CharacteristicsTypes.VENDOR_EVE_ENERGY_VOLTAGE,
|
||||||
|
|
|
@ -15,14 +15,13 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
DEGREE,
|
DEGREE,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
ENERGY_WATT_HOUR,
|
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
PRESSURE_HPA,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
UnitOfPrecipitationDepth,
|
UnitOfPrecipitationDepth,
|
||||||
|
@ -136,13 +135,13 @@ SENSOR_DESCRIPTIONS: dict[str, SensorEntityDescription] = {
|
||||||
),
|
),
|
||||||
"ENERGY_COUNTER": SensorEntityDescription(
|
"ENERGY_COUNTER": SensorEntityDescription(
|
||||||
key="ENERGY_COUNTER",
|
key="ENERGY_COUNTER",
|
||||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
"IEC_ENERGY_COUNTER": SensorEntityDescription(
|
"IEC_ENERGY_COUNTER": SensorEntityDescription(
|
||||||
key="IEC_ENERGY_COUNTER",
|
key="IEC_ENERGY_COUNTER",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
|
|
@ -10,12 +10,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import PERCENTAGE, UnitOfEnergy, UnitOfPower, UnitOfVolume
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
|
||||||
UnitOfPower,
|
|
||||||
UnitOfVolume,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -58,28 +53,28 @@ SENSORS: Final[tuple[SensorEntityDescription, ...]] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="total_power_import_t1_kwh",
|
key="total_power_import_t1_kwh",
|
||||||
name="Total power import T1",
|
name="Total power import T1",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="total_power_import_t2_kwh",
|
key="total_power_import_t2_kwh",
|
||||||
name="Total power import T2",
|
name="Total power import T2",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="total_power_export_t1_kwh",
|
key="total_power_export_t1_kwh",
|
||||||
name="Total power export T1",
|
name="Total power export T1",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="total_power_export_t2_kwh",
|
key="total_power_export_t2_kwh",
|
||||||
name="Total power export T2",
|
name="Total power export T2",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
|
|
@ -15,11 +15,11 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
UnitOfApparentPower,
|
UnitOfApparentPower,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
|
@ -82,7 +82,7 @@ ENTITY_DESCRIPTION_KEY_MAP: dict[str, IotaWattSensorEntityDescription] = {
|
||||||
),
|
),
|
||||||
"WattHours": IotaWattSensorEntityDescription(
|
"WattHours": IotaWattSensorEntityDescription(
|
||||||
"WattHours",
|
"WattHours",
|
||||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
|
|
|
@ -9,11 +9,11 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_WATT_HOUR,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TIME_SECONDS,
|
TIME_SECONDS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -63,7 +63,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="energy_added",
|
key="energy_added",
|
||||||
name="Energy added",
|
name="Energy added",
|
||||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
|
|
@ -7,11 +7,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import UnitOfElectricCurrent, UnitOfEnergy, UnitOfPower
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
UnitOfElectricCurrent,
|
|
||||||
UnitOfPower,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
@ -48,7 +44,7 @@ async def async_setup_platform(
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="Setenergy",
|
key="Setenergy",
|
||||||
name="Energy Target",
|
name="Energy Target",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -69,7 +65,7 @@ async def async_setup_platform(
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="E pres",
|
key="E pres",
|
||||||
name="Session Energy",
|
name="Session Energy",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -79,7 +75,7 @@ async def async_setup_platform(
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="E total",
|
key="E total",
|
||||||
name="Total Energy",
|
name="Total Energy",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
|
|
@ -15,10 +15,10 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -321,7 +321,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHome:Day",
|
key="Statistic:EnergyHome:Day",
|
||||||
name="Home Consumption Day",
|
name="Home Consumption Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -329,7 +329,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHome:Month",
|
key="Statistic:EnergyHome:Month",
|
||||||
name="Home Consumption Month",
|
name="Home Consumption Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -337,7 +337,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHome:Year",
|
key="Statistic:EnergyHome:Year",
|
||||||
name="Home Consumption Year",
|
name="Home Consumption Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -345,7 +345,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHome:Total",
|
key="Statistic:EnergyHome:Total",
|
||||||
name="Home Consumption Total",
|
name="Home Consumption Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -354,7 +354,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomeBat:Day",
|
key="Statistic:EnergyHomeBat:Day",
|
||||||
name="Home Consumption from Battery Day",
|
name="Home Consumption from Battery Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -362,7 +362,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomeBat:Month",
|
key="Statistic:EnergyHomeBat:Month",
|
||||||
name="Home Consumption from Battery Month",
|
name="Home Consumption from Battery Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -370,7 +370,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomeBat:Year",
|
key="Statistic:EnergyHomeBat:Year",
|
||||||
name="Home Consumption from Battery Year",
|
name="Home Consumption from Battery Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -378,7 +378,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomeBat:Total",
|
key="Statistic:EnergyHomeBat:Total",
|
||||||
name="Home Consumption from Battery Total",
|
name="Home Consumption from Battery Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -387,7 +387,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomeGrid:Day",
|
key="Statistic:EnergyHomeGrid:Day",
|
||||||
name="Home Consumption from Grid Day",
|
name="Home Consumption from Grid Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -395,7 +395,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomeGrid:Month",
|
key="Statistic:EnergyHomeGrid:Month",
|
||||||
name="Home Consumption from Grid Month",
|
name="Home Consumption from Grid Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -403,7 +403,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomeGrid:Year",
|
key="Statistic:EnergyHomeGrid:Year",
|
||||||
name="Home Consumption from Grid Year",
|
name="Home Consumption from Grid Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -411,7 +411,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomeGrid:Total",
|
key="Statistic:EnergyHomeGrid:Total",
|
||||||
name="Home Consumption from Grid Total",
|
name="Home Consumption from Grid Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -420,7 +420,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomePv:Day",
|
key="Statistic:EnergyHomePv:Day",
|
||||||
name="Home Consumption from PV Day",
|
name="Home Consumption from PV Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -428,7 +428,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomePv:Month",
|
key="Statistic:EnergyHomePv:Month",
|
||||||
name="Home Consumption from PV Month",
|
name="Home Consumption from PV Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -436,7 +436,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomePv:Year",
|
key="Statistic:EnergyHomePv:Year",
|
||||||
name="Home Consumption from PV Year",
|
name="Home Consumption from PV Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -444,7 +444,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyHomePv:Total",
|
key="Statistic:EnergyHomePv:Total",
|
||||||
name="Home Consumption from PV Total",
|
name="Home Consumption from PV Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -453,7 +453,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv1:Day",
|
key="Statistic:EnergyPv1:Day",
|
||||||
name="Energy PV1 Day",
|
name="Energy PV1 Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -461,7 +461,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv1:Month",
|
key="Statistic:EnergyPv1:Month",
|
||||||
name="Energy PV1 Month",
|
name="Energy PV1 Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -469,7 +469,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv1:Year",
|
key="Statistic:EnergyPv1:Year",
|
||||||
name="Energy PV1 Year",
|
name="Energy PV1 Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -477,7 +477,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv1:Total",
|
key="Statistic:EnergyPv1:Total",
|
||||||
name="Energy PV1 Total",
|
name="Energy PV1 Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -486,7 +486,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv2:Day",
|
key="Statistic:EnergyPv2:Day",
|
||||||
name="Energy PV2 Day",
|
name="Energy PV2 Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -494,7 +494,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv2:Month",
|
key="Statistic:EnergyPv2:Month",
|
||||||
name="Energy PV2 Month",
|
name="Energy PV2 Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -502,7 +502,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv2:Year",
|
key="Statistic:EnergyPv2:Year",
|
||||||
name="Energy PV2 Year",
|
name="Energy PV2 Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -510,7 +510,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv2:Total",
|
key="Statistic:EnergyPv2:Total",
|
||||||
name="Energy PV2 Total",
|
name="Energy PV2 Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -519,7 +519,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv3:Day",
|
key="Statistic:EnergyPv3:Day",
|
||||||
name="Energy PV3 Day",
|
name="Energy PV3 Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -527,7 +527,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv3:Month",
|
key="Statistic:EnergyPv3:Month",
|
||||||
name="Energy PV3 Month",
|
name="Energy PV3 Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -535,7 +535,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv3:Year",
|
key="Statistic:EnergyPv3:Year",
|
||||||
name="Energy PV3 Year",
|
name="Energy PV3 Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -543,7 +543,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyPv3:Total",
|
key="Statistic:EnergyPv3:Total",
|
||||||
name="Energy PV3 Total",
|
name="Energy PV3 Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -552,7 +552,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:Yield:Day",
|
key="Statistic:Yield:Day",
|
||||||
name="Energy Yield Day",
|
name="Energy Yield Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
entity_registry_enabled_default=True,
|
entity_registry_enabled_default=True,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -561,7 +561,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:Yield:Month",
|
key="Statistic:Yield:Month",
|
||||||
name="Energy Yield Month",
|
name="Energy Yield Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -569,7 +569,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:Yield:Year",
|
key="Statistic:Yield:Year",
|
||||||
name="Energy Yield Year",
|
name="Energy Yield Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -577,7 +577,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:Yield:Total",
|
key="Statistic:Yield:Total",
|
||||||
name="Energy Yield Total",
|
name="Energy Yield Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -586,7 +586,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyChargeGrid:Day",
|
key="Statistic:EnergyChargeGrid:Day",
|
||||||
name="Battery Charge from Grid Day",
|
name="Battery Charge from Grid Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -594,7 +594,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyChargeGrid:Month",
|
key="Statistic:EnergyChargeGrid:Month",
|
||||||
name="Battery Charge from Grid Month",
|
name="Battery Charge from Grid Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -602,7 +602,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyChargeGrid:Year",
|
key="Statistic:EnergyChargeGrid:Year",
|
||||||
name="Battery Charge from Grid Year",
|
name="Battery Charge from Grid Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -610,7 +610,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyChargeGrid:Total",
|
key="Statistic:EnergyChargeGrid:Total",
|
||||||
name="Battery Charge from Grid Total",
|
name="Battery Charge from Grid Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -619,7 +619,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyChargePv:Day",
|
key="Statistic:EnergyChargePv:Day",
|
||||||
name="Battery Charge from PV Day",
|
name="Battery Charge from PV Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -627,7 +627,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyChargePv:Month",
|
key="Statistic:EnergyChargePv:Month",
|
||||||
name="Battery Charge from PV Month",
|
name="Battery Charge from PV Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -635,7 +635,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyChargePv:Year",
|
key="Statistic:EnergyChargePv:Year",
|
||||||
name="Battery Charge from PV Year",
|
name="Battery Charge from PV Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -643,7 +643,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyChargePv:Total",
|
key="Statistic:EnergyChargePv:Total",
|
||||||
name="Battery Charge from PV Total",
|
name="Battery Charge from PV Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
@ -652,7 +652,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyDischargeGrid:Day",
|
key="Statistic:EnergyDischargeGrid:Day",
|
||||||
name="Energy Discharge to Grid Day",
|
name="Energy Discharge to Grid Day",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -660,7 +660,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyDischargeGrid:Month",
|
key="Statistic:EnergyDischargeGrid:Month",
|
||||||
name="Energy Discharge to Grid Month",
|
name="Energy Discharge to Grid Month",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -668,7 +668,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyDischargeGrid:Year",
|
key="Statistic:EnergyDischargeGrid:Year",
|
||||||
name="Energy Discharge to Grid Year",
|
name="Energy Discharge to Grid Year",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
),
|
),
|
||||||
|
@ -676,7 +676,7 @@ SENSOR_PROCESS_DATA = [
|
||||||
module_id="scb:statistic:EnergyFlow",
|
module_id="scb:statistic:EnergyFlow",
|
||||||
key="Statistic:EnergyDischargeGrid:Total",
|
key="Statistic:EnergyDischargeGrid:Total",
|
||||||
name="Energy Discharge to Grid Total",
|
name="Energy Discharge to Grid Total",
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
formatter="format_energy",
|
formatter="format_energy",
|
||||||
|
|
|
@ -15,9 +15,9 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
CONF_IP_ADDRESS,
|
CONF_IP_ADDRESS,
|
||||||
CONF_USERNAME,
|
CONF_USERNAME,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
@ -45,14 +45,14 @@ HEATER_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=CONSUMPTION_YEAR,
|
key=CONSUMPTION_YEAR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
name="Year consumption",
|
name="Year consumption",
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=CONSUMPTION_TODAY,
|
key=CONSUMPTION_TODAY,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
name="Day consumption",
|
name="Day consumption",
|
||||||
),
|
),
|
||||||
|
|
|
@ -14,7 +14,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_API_KEY, ENERGY_KILO_WATT_HOUR, UnitOfPower
|
from homeassistant.const import CONF_API_KEY, UnitOfEnergy, UnitOfPower
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -153,7 +153,7 @@ class NeurioEnergy(SensorEntity):
|
||||||
self._attr_device_class = SensorDeviceClass.POWER
|
self._attr_device_class = SensorDeviceClass.POWER
|
||||||
self._attr_state_class = SensorStateClass.MEASUREMENT
|
self._attr_state_class = SensorStateClass.MEASUREMENT
|
||||||
elif sensor_type == DAILY_TYPE:
|
elif sensor_type == DAILY_TYPE:
|
||||||
self._unit_of_measurement = ENERGY_KILO_WATT_HOUR
|
self._unit_of_measurement = UnitOfEnergy.KILO_WATT_HOUR
|
||||||
self._attr_device_class = SensorDeviceClass.ENERGY
|
self._attr_device_class = SensorDeviceClass.ENERGY
|
||||||
self._attr_state_class = SensorStateClass.TOTAL_INCREASING
|
self._attr_state_class = SensorStateClass.TOTAL_INCREASING
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue