2021-04-05 08:11:06 +00:00
|
|
|
"""The enphase_envoy component."""
|
2021-07-29 00:31:10 +00:00
|
|
|
from homeassistant.components.sensor import (
|
2021-12-10 08:12:38 +00:00
|
|
|
SensorDeviceClass,
|
2021-07-29 00:31:10 +00:00
|
|
|
SensorEntityDescription,
|
2021-12-10 08:12:38 +00:00
|
|
|
SensorStateClass,
|
2021-07-29 00:31:10 +00:00
|
|
|
)
|
2022-12-12 10:49:02 +00:00
|
|
|
from homeassistant.const import Platform, UnitOfEnergy, UnitOfPower
|
2021-04-05 08:11:06 +00:00
|
|
|
|
|
|
|
DOMAIN = "enphase_envoy"
|
|
|
|
|
2021-12-04 12:26:40 +00:00
|
|
|
PLATFORMS = [Platform.SENSOR]
|
2021-04-05 08:11:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
COORDINATOR = "coordinator"
|
|
|
|
NAME = "name"
|
|
|
|
|
2021-07-29 00:31:10 +00:00
|
|
|
SENSORS = (
|
|
|
|
SensorEntityDescription(
|
|
|
|
key="production",
|
|
|
|
name="Current Power Production",
|
2022-12-12 10:49:02 +00:00
|
|
|
native_unit_of_measurement=UnitOfPower.WATT,
|
2021-12-10 08:12:38 +00:00
|
|
|
state_class=SensorStateClass.MEASUREMENT,
|
2022-12-12 10:49:02 +00:00
|
|
|
device_class=SensorDeviceClass.POWER,
|
2021-07-29 00:31:10 +00:00
|
|
|
),
|
|
|
|
SensorEntityDescription(
|
|
|
|
key="daily_production",
|
|
|
|
name="Today's Energy Production",
|
2022-12-12 10:49:02 +00:00
|
|
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
2021-12-10 08:12:38 +00:00
|
|
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
|
|
|
device_class=SensorDeviceClass.ENERGY,
|
2021-07-29 00:31:10 +00:00
|
|
|
),
|
|
|
|
SensorEntityDescription(
|
|
|
|
key="seven_days_production",
|
|
|
|
name="Last Seven Days Energy Production",
|
2022-12-12 10:49:02 +00:00
|
|
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
2023-02-05 01:06:42 +00:00
|
|
|
state_class=SensorStateClass.TOTAL,
|
2021-12-10 08:12:38 +00:00
|
|
|
device_class=SensorDeviceClass.ENERGY,
|
2021-07-29 00:31:10 +00:00
|
|
|
),
|
|
|
|
SensorEntityDescription(
|
|
|
|
key="lifetime_production",
|
|
|
|
name="Lifetime Energy Production",
|
2022-12-12 10:49:02 +00:00
|
|
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
2021-12-10 08:12:38 +00:00
|
|
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
|
|
|
device_class=SensorDeviceClass.ENERGY,
|
2021-07-29 00:31:10 +00:00
|
|
|
),
|
|
|
|
SensorEntityDescription(
|
|
|
|
key="consumption",
|
|
|
|
name="Current Power Consumption",
|
2022-12-12 10:49:02 +00:00
|
|
|
native_unit_of_measurement=UnitOfPower.WATT,
|
2021-12-10 08:12:38 +00:00
|
|
|
state_class=SensorStateClass.MEASUREMENT,
|
2022-12-12 10:49:02 +00:00
|
|
|
device_class=SensorDeviceClass.POWER,
|
2021-07-29 00:31:10 +00:00
|
|
|
),
|
|
|
|
SensorEntityDescription(
|
|
|
|
key="daily_consumption",
|
|
|
|
name="Today's Energy Consumption",
|
2022-12-12 10:49:02 +00:00
|
|
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
2022-10-29 18:25:46 +00:00
|
|
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
2021-12-10 08:12:38 +00:00
|
|
|
device_class=SensorDeviceClass.ENERGY,
|
2021-07-29 00:31:10 +00:00
|
|
|
),
|
|
|
|
SensorEntityDescription(
|
|
|
|
key="seven_days_consumption",
|
|
|
|
name="Last Seven Days Energy Consumption",
|
2022-12-12 10:49:02 +00:00
|
|
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
2023-02-05 01:06:42 +00:00
|
|
|
state_class=SensorStateClass.TOTAL,
|
2021-12-10 08:12:38 +00:00
|
|
|
device_class=SensorDeviceClass.ENERGY,
|
2021-07-29 00:31:10 +00:00
|
|
|
),
|
|
|
|
SensorEntityDescription(
|
|
|
|
key="lifetime_consumption",
|
|
|
|
name="Lifetime Energy Consumption",
|
2022-12-12 10:49:02 +00:00
|
|
|
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
2021-12-10 08:12:38 +00:00
|
|
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
|
|
|
device_class=SensorDeviceClass.ENERGY,
|
2021-07-29 00:31:10 +00:00
|
|
|
),
|
|
|
|
)
|