1 """Growatt Sensor definitions for the Mix type."""
3 from __future__
import annotations
8 UnitOfElectricPotential,
13 from .sensor_entity_description
import GrowattSensorEntityDescription
15 MIX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
18 key=
"mix_statement_of_charge",
19 translation_key=
"mix_statement_of_charge",
21 native_unit_of_measurement=PERCENTAGE,
22 device_class=SensorDeviceClass.BATTERY,
25 key=
"mix_battery_charge_today",
26 translation_key=
"mix_battery_charge_today",
27 api_key=
"eBatChargeToday",
28 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
29 device_class=SensorDeviceClass.ENERGY,
32 key=
"mix_battery_charge_lifetime",
33 translation_key=
"mix_battery_charge_lifetime",
34 api_key=
"eBatChargeTotal",
35 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
36 device_class=SensorDeviceClass.ENERGY,
37 state_class=SensorStateClass.TOTAL,
40 key=
"mix_battery_discharge_today",
41 translation_key=
"mix_battery_discharge_today",
42 api_key=
"eBatDisChargeToday",
43 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
44 device_class=SensorDeviceClass.ENERGY,
47 key=
"mix_battery_discharge_lifetime",
48 translation_key=
"mix_battery_discharge_lifetime",
49 api_key=
"eBatDisChargeTotal",
50 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
51 device_class=SensorDeviceClass.ENERGY,
52 state_class=SensorStateClass.TOTAL,
55 key=
"mix_solar_generation_today",
56 translation_key=
"mix_solar_generation_today",
58 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
59 device_class=SensorDeviceClass.ENERGY,
62 key=
"mix_solar_generation_lifetime",
63 translation_key=
"mix_solar_generation_lifetime",
65 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
66 device_class=SensorDeviceClass.ENERGY,
67 state_class=SensorStateClass.TOTAL,
70 key=
"mix_battery_discharge_w",
71 translation_key=
"mix_battery_discharge_w",
72 api_key=
"pDischarge1",
73 native_unit_of_measurement=UnitOfPower.WATT,
74 device_class=SensorDeviceClass.POWER,
77 key=
"mix_battery_voltage",
78 translation_key=
"mix_battery_voltage",
80 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
81 device_class=SensorDeviceClass.VOLTAGE,
84 key=
"mix_pv1_voltage",
85 translation_key=
"mix_pv1_voltage",
87 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
88 device_class=SensorDeviceClass.VOLTAGE,
91 key=
"mix_pv2_voltage",
92 translation_key=
"mix_pv2_voltage",
94 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
95 device_class=SensorDeviceClass.VOLTAGE,
99 key=
"mix_load_consumption_today",
100 translation_key=
"mix_load_consumption_today",
101 api_key=
"elocalLoadToday",
102 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
103 device_class=SensorDeviceClass.ENERGY,
106 key=
"mix_load_consumption_lifetime",
107 translation_key=
"mix_load_consumption_lifetime",
108 api_key=
"elocalLoadTotal",
109 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
110 device_class=SensorDeviceClass.ENERGY,
111 state_class=SensorStateClass.TOTAL,
114 key=
"mix_export_to_grid_today",
115 translation_key=
"mix_export_to_grid_today",
116 api_key=
"etoGridToday",
117 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
118 device_class=SensorDeviceClass.ENERGY,
121 key=
"mix_export_to_grid_lifetime",
122 translation_key=
"mix_export_to_grid_lifetime",
123 api_key=
"etogridTotal",
124 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
125 device_class=SensorDeviceClass.ENERGY,
126 state_class=SensorStateClass.TOTAL,
130 key=
"mix_battery_charge",
131 translation_key=
"mix_battery_charge",
132 api_key=
"chargePower",
133 native_unit_of_measurement=UnitOfPower.KILO_WATT,
134 device_class=SensorDeviceClass.POWER,
137 key=
"mix_load_consumption",
138 translation_key=
"mix_load_consumption",
139 api_key=
"pLocalLoad",
140 native_unit_of_measurement=UnitOfPower.KILO_WATT,
141 device_class=SensorDeviceClass.POWER,
144 key=
"mix_wattage_pv_1",
145 translation_key=
"mix_wattage_pv_1",
147 native_unit_of_measurement=UnitOfPower.KILO_WATT,
148 device_class=SensorDeviceClass.POWER,
151 key=
"mix_wattage_pv_2",
152 translation_key=
"mix_wattage_pv_2",
154 native_unit_of_measurement=UnitOfPower.KILO_WATT,
155 device_class=SensorDeviceClass.POWER,
158 key=
"mix_wattage_pv_all",
159 translation_key=
"mix_wattage_pv_all",
161 native_unit_of_measurement=UnitOfPower.KILO_WATT,
162 device_class=SensorDeviceClass.POWER,
165 key=
"mix_export_to_grid",
166 translation_key=
"mix_export_to_grid",
168 native_unit_of_measurement=UnitOfPower.KILO_WATT,
169 device_class=SensorDeviceClass.POWER,
172 key=
"mix_import_from_grid",
173 translation_key=
"mix_import_from_grid",
175 native_unit_of_measurement=UnitOfPower.KILO_WATT,
176 device_class=SensorDeviceClass.POWER,
179 key=
"mix_battery_discharge_kw",
180 translation_key=
"mix_battery_discharge_kw",
181 api_key=
"pdisCharge1",
182 native_unit_of_measurement=UnitOfPower.KILO_WATT,
183 device_class=SensorDeviceClass.POWER,
186 key=
"mix_grid_voltage",
187 translation_key=
"mix_grid_voltage",
189 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
190 device_class=SensorDeviceClass.VOLTAGE,
194 key=
"mix_system_production_today",
195 translation_key=
"mix_system_production_today",
197 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
198 device_class=SensorDeviceClass.ENERGY,
201 key=
"mix_load_consumption_solar_today",
202 translation_key=
"mix_load_consumption_solar_today",
203 api_key=
"eChargeToday",
204 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
205 device_class=SensorDeviceClass.ENERGY,
208 key=
"mix_self_consumption_today",
209 translation_key=
"mix_self_consumption_today",
210 api_key=
"eChargeToday1",
211 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
212 device_class=SensorDeviceClass.ENERGY,
215 key=
"mix_load_consumption_battery_today",
216 translation_key=
"mix_load_consumption_battery_today",
218 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
219 device_class=SensorDeviceClass.ENERGY,
222 key=
"mix_import_from_grid_today",
223 translation_key=
"mix_import_from_grid_today",
225 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
226 device_class=SensorDeviceClass.ENERGY,
230 key=
"mix_last_update",
231 translation_key=
"mix_last_update",
232 api_key=
"lastdataupdate",
233 device_class=SensorDeviceClass.TIMESTAMP,
237 key=
"mix_import_from_grid_today_combined",
238 translation_key=
"mix_import_from_grid_today_combined",
239 api_key=
"etouser_combined",
240 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
241 device_class=SensorDeviceClass.ENERGY,
242 state_class=SensorStateClass.TOTAL_INCREASING,
243 previous_value_drop_threshold=0.2,