1 """Growatt Sensor definitions for the TLX type.
3 TLX Type is also shown on the UI as: "MIN/MIC/MOD/NEO"
6 from __future__
import annotations
11 UnitOfElectricCurrent,
12 UnitOfElectricPotential,
19 from .sensor_entity_description
import GrowattSensorEntityDescription
21 TLX_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
23 key=
"tlx_energy_today",
24 translation_key=
"tlx_energy_today",
26 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
27 device_class=SensorDeviceClass.ENERGY,
28 state_class=SensorStateClass.TOTAL_INCREASING,
32 key=
"tlx_energy_total",
33 translation_key=
"tlx_energy_total",
35 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
36 device_class=SensorDeviceClass.ENERGY,
37 state_class=SensorStateClass.TOTAL_INCREASING,
42 key=
"tlx_energy_total_input_1",
43 translation_key=
"tlx_energy_total_input_1",
45 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
46 device_class=SensorDeviceClass.ENERGY,
47 state_class=SensorStateClass.TOTAL_INCREASING,
52 key=
"tlx_energy_today_input_1",
53 translation_key=
"tlx_energy_today_input_1",
55 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
56 device_class=SensorDeviceClass.ENERGY,
57 state_class=SensorStateClass.TOTAL_INCREASING,
61 key=
"tlx_voltage_input_1",
62 translation_key=
"tlx_voltage_input_1",
64 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
65 device_class=SensorDeviceClass.VOLTAGE,
69 key=
"tlx_amperage_input_1",
70 translation_key=
"tlx_amperage_input_1",
72 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
73 device_class=SensorDeviceClass.CURRENT,
77 key=
"tlx_wattage_input_1",
78 translation_key=
"tlx_wattage_input_1",
80 native_unit_of_measurement=UnitOfPower.WATT,
81 device_class=SensorDeviceClass.POWER,
85 key=
"tlx_energy_total_input_2",
86 translation_key=
"tlx_energy_total_input_2",
88 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
89 device_class=SensorDeviceClass.ENERGY,
90 state_class=SensorStateClass.TOTAL_INCREASING,
95 key=
"tlx_energy_today_input_2",
96 translation_key=
"tlx_energy_today_input_2",
98 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
99 device_class=SensorDeviceClass.ENERGY,
100 state_class=SensorStateClass.TOTAL_INCREASING,
104 key=
"tlx_voltage_input_2",
105 translation_key=
"tlx_voltage_input_2",
107 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
108 device_class=SensorDeviceClass.VOLTAGE,
112 key=
"tlx_amperage_input_2",
113 translation_key=
"tlx_amperage_input_2",
115 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
116 device_class=SensorDeviceClass.CURRENT,
120 key=
"tlx_wattage_input_2",
121 translation_key=
"tlx_wattage_input_2",
123 native_unit_of_measurement=UnitOfPower.WATT,
124 device_class=SensorDeviceClass.POWER,
128 key=
"tlx_energy_total_input_3",
129 translation_key=
"tlx_energy_total_input_3",
131 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
132 device_class=SensorDeviceClass.ENERGY,
133 state_class=SensorStateClass.TOTAL_INCREASING,
138 key=
"tlx_energy_today_input_3",
139 translation_key=
"tlx_energy_today_input_3",
141 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
142 device_class=SensorDeviceClass.ENERGY,
143 state_class=SensorStateClass.TOTAL_INCREASING,
147 key=
"tlx_voltage_input_3",
148 translation_key=
"tlx_voltage_input_3",
150 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
151 device_class=SensorDeviceClass.VOLTAGE,
155 key=
"tlx_amperage_input_3",
156 translation_key=
"tlx_amperage_input_3",
158 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
159 device_class=SensorDeviceClass.CURRENT,
163 key=
"tlx_wattage_input_3",
164 translation_key=
"tlx_wattage_input_3",
166 native_unit_of_measurement=UnitOfPower.WATT,
167 device_class=SensorDeviceClass.POWER,
171 key=
"tlx_energy_total_input_4",
172 translation_key=
"tlx_energy_total_input_4",
174 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
175 device_class=SensorDeviceClass.ENERGY,
176 state_class=SensorStateClass.TOTAL_INCREASING,
181 key=
"tlx_energy_today_input_4",
182 translation_key=
"tlx_energy_today_input_4",
184 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
185 device_class=SensorDeviceClass.ENERGY,
186 state_class=SensorStateClass.TOTAL_INCREASING,
190 key=
"tlx_voltage_input_4",
191 translation_key=
"tlx_voltage_input_4",
193 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
194 device_class=SensorDeviceClass.VOLTAGE,
198 key=
"tlx_amperage_input_4",
199 translation_key=
"tlx_amperage_input_4",
201 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
202 device_class=SensorDeviceClass.CURRENT,
206 key=
"tlx_wattage_input_4",
207 translation_key=
"tlx_wattage_input_4",
209 native_unit_of_measurement=UnitOfPower.WATT,
210 device_class=SensorDeviceClass.POWER,
214 key=
"tlx_solar_generation_total",
215 translation_key=
"tlx_solar_generation_total",
217 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
218 device_class=SensorDeviceClass.ENERGY,
219 state_class=SensorStateClass.TOTAL_INCREASING,
223 key=
"tlx_internal_wattage",
224 translation_key=
"tlx_internal_wattage",
226 native_unit_of_measurement=UnitOfPower.WATT,
227 device_class=SensorDeviceClass.POWER,
231 key=
"tlx_reactive_voltage",
232 translation_key=
"tlx_reactive_voltage",
234 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
235 device_class=SensorDeviceClass.VOLTAGE,
240 translation_key=
"tlx_frequency",
242 native_unit_of_measurement=UnitOfFrequency.HERTZ,
243 device_class=SensorDeviceClass.FREQUENCY,
247 key=
"tlx_current_wattage",
248 translation_key=
"tlx_current_wattage",
250 native_unit_of_measurement=UnitOfPower.WATT,
251 device_class=SensorDeviceClass.POWER,
255 key=
"tlx_temperature_1",
256 translation_key=
"tlx_temperature_1",
258 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
259 device_class=SensorDeviceClass.TEMPERATURE,
263 key=
"tlx_temperature_2",
264 translation_key=
"tlx_temperature_2",
266 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
267 device_class=SensorDeviceClass.TEMPERATURE,
271 key=
"tlx_temperature_3",
272 translation_key=
"tlx_temperature_3",
274 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
275 device_class=SensorDeviceClass.TEMPERATURE,
279 key=
"tlx_temperature_4",
280 translation_key=
"tlx_temperature_4",
282 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
283 device_class=SensorDeviceClass.TEMPERATURE,
287 key=
"tlx_temperature_5",
288 translation_key=
"tlx_temperature_5",
290 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
291 device_class=SensorDeviceClass.TEMPERATURE,
295 key=
"tlx_all_batteries_discharge_today",
296 translation_key=
"tlx_all_batteries_discharge_today",
297 api_key=
"edischargeToday",
298 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
299 device_class=SensorDeviceClass.ENERGY,
300 state_class=SensorStateClass.TOTAL_INCREASING,
303 key=
"tlx_all_batteries_discharge_total",
304 translation_key=
"tlx_all_batteries_discharge_total",
305 api_key=
"edischargeTotal",
306 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
307 device_class=SensorDeviceClass.ENERGY,
308 state_class=SensorStateClass.TOTAL_INCREASING,
312 key=
"tlx_battery_1_discharge_w",
313 translation_key=
"tlx_battery_1_discharge_w",
314 api_key=
"bdc1DischargePower",
315 native_unit_of_measurement=UnitOfPower.WATT,
316 device_class=SensorDeviceClass.POWER,
319 key=
"tlx_battery_1_discharge_total",
320 translation_key=
"tlx_battery_1_discharge_total",
321 api_key=
"bdc1DischargeTotal",
322 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
323 device_class=SensorDeviceClass.ENERGY,
324 state_class=SensorStateClass.TOTAL_INCREASING,
328 key=
"tlx_battery_2_discharge_w",
329 translation_key=
"tlx_battery_2_discharge_w",
330 api_key=
"bdc2DischargePower",
331 native_unit_of_measurement=UnitOfPower.WATT,
332 device_class=SensorDeviceClass.POWER,
335 key=
"tlx_battery_2_discharge_total",
336 translation_key=
"tlx_battery_2_discharge_total",
337 api_key=
"bdc2DischargeTotal",
338 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
339 device_class=SensorDeviceClass.ENERGY,
340 state_class=SensorStateClass.TOTAL_INCREASING,
344 key=
"tlx_all_batteries_charge_today",
345 translation_key=
"tlx_all_batteries_charge_today",
346 api_key=
"echargeToday",
347 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
348 device_class=SensorDeviceClass.ENERGY,
349 state_class=SensorStateClass.TOTAL_INCREASING,
352 key=
"tlx_all_batteries_charge_total",
353 translation_key=
"tlx_all_batteries_charge_total",
354 api_key=
"echargeTotal",
355 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
356 device_class=SensorDeviceClass.ENERGY,
357 state_class=SensorStateClass.TOTAL_INCREASING,
361 key=
"tlx_battery_1_charge_w",
362 translation_key=
"tlx_battery_1_charge_w",
363 api_key=
"bdc1ChargePower",
364 native_unit_of_measurement=UnitOfPower.WATT,
365 device_class=SensorDeviceClass.POWER,
368 key=
"tlx_battery_1_charge_total",
369 translation_key=
"tlx_battery_1_charge_total",
370 api_key=
"bdc1ChargeTotal",
371 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
372 device_class=SensorDeviceClass.ENERGY,
373 state_class=SensorStateClass.TOTAL_INCREASING,
377 key=
"tlx_battery_2_charge_w",
378 translation_key=
"tlx_battery_2_charge_w",
379 api_key=
"bdc2ChargePower",
380 native_unit_of_measurement=UnitOfPower.WATT,
381 device_class=SensorDeviceClass.POWER,
384 key=
"tlx_battery_2_charge_total",
385 translation_key=
"tlx_battery_2_charge_total",
386 api_key=
"bdc2ChargeTotal",
387 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
388 device_class=SensorDeviceClass.ENERGY,
389 state_class=SensorStateClass.TOTAL_INCREASING,
393 key=
"tlx_export_to_grid_today",
394 translation_key=
"tlx_export_to_grid_today",
395 api_key=
"etoGridToday",
396 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
397 device_class=SensorDeviceClass.ENERGY,
398 state_class=SensorStateClass.TOTAL_INCREASING,
401 key=
"tlx_export_to_grid_total",
402 translation_key=
"tlx_export_to_grid_total",
403 api_key=
"etoGridTotal",
404 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
405 device_class=SensorDeviceClass.ENERGY,
406 state_class=SensorStateClass.TOTAL_INCREASING,
410 key=
"tlx_load_consumption_today",
411 translation_key=
"tlx_load_consumption_today",
412 api_key=
"elocalLoadToday",
413 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
414 device_class=SensorDeviceClass.ENERGY,
415 state_class=SensorStateClass.TOTAL_INCREASING,
418 key=
"mix_load_consumption_total",
419 translation_key=
"mix_load_consumption_total",
420 api_key=
"elocalLoadTotal",
421 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
422 device_class=SensorDeviceClass.ENERGY,
423 state_class=SensorStateClass.TOTAL_INCREASING,
427 key=
"tlx_statement_of_charge",
428 translation_key=
"tlx_statement_of_charge",
430 native_unit_of_measurement=PERCENTAGE,
431 device_class=SensorDeviceClass.BATTERY,