1 """Growatt Sensor definitions for the Storage type."""
3 from __future__
import annotations
9 UnitOfElectricPotential,
15 from .sensor_entity_description
import GrowattSensorEntityDescription
17 STORAGE_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
19 key=
"storage_storage_production_today",
20 translation_key=
"storage_storage_production_today",
21 api_key=
"eBatDisChargeToday",
22 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
23 device_class=SensorDeviceClass.ENERGY,
24 state_class=SensorStateClass.TOTAL_INCREASING,
27 key=
"storage_storage_production_lifetime",
28 translation_key=
"storage_storage_production_lifetime",
29 api_key=
"eBatDisChargeTotal",
30 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
31 device_class=SensorDeviceClass.ENERGY,
32 state_class=SensorStateClass.TOTAL,
35 key=
"storage_grid_discharge_today",
36 translation_key=
"storage_grid_discharge_today",
37 api_key=
"eacDisChargeToday",
38 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
39 device_class=SensorDeviceClass.ENERGY,
40 state_class=SensorStateClass.TOTAL_INCREASING,
43 key=
"storage_grid_discharge_lifetime",
44 translation_key=
"storage_grid_discharge_lifetime",
45 api_key=
"eacDisChargeTotal",
46 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
47 device_class=SensorDeviceClass.ENERGY,
48 state_class=SensorStateClass.TOTAL,
51 key=
"storage_load_consumption_today",
52 translation_key=
"storage_load_consumption_today",
53 api_key=
"eopDischrToday",
54 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
55 device_class=SensorDeviceClass.ENERGY,
56 state_class=SensorStateClass.TOTAL_INCREASING,
59 key=
"storage_load_consumption_lifetime",
60 translation_key=
"storage_load_consumption_lifetime",
61 api_key=
"eopDischrTotal",
62 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
63 device_class=SensorDeviceClass.ENERGY,
64 state_class=SensorStateClass.TOTAL,
67 key=
"storage_grid_charged_today",
68 translation_key=
"storage_grid_charged_today",
69 api_key=
"eacChargeToday",
70 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
71 device_class=SensorDeviceClass.ENERGY,
72 state_class=SensorStateClass.TOTAL_INCREASING,
75 key=
"storage_grid_charged_lifetime",
76 translation_key=
"storage_grid_charged_lifetime",
77 api_key=
"eacChargeTotal",
78 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
79 device_class=SensorDeviceClass.ENERGY,
80 state_class=SensorStateClass.TOTAL,
83 key=
"storage_charge_storage_lifetime",
84 translation_key=
"storage_charge_storage_lifetime",
85 api_key=
"eChargeTotal",
86 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
87 device_class=SensorDeviceClass.ENERGY,
88 state_class=SensorStateClass.TOTAL,
91 key=
"storage_solar_output_today",
92 translation_key=
"storage_solar_output_today",
94 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
95 device_class=SensorDeviceClass.ENERGY,
96 state_class=SensorStateClass.TOTAL_INCREASING,
99 key=
"storage_solar_output_lifetime",
100 translation_key=
"storage_solar_output_lifetime",
102 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
103 device_class=SensorDeviceClass.ENERGY,
104 state_class=SensorStateClass.TOTAL,
107 key=
"storage_solar_production",
108 translation_key=
"storage_solar_production",
110 native_unit_of_measurement=UnitOfPower.WATT,
111 device_class=SensorDeviceClass.POWER,
112 state_class=SensorStateClass.MEASUREMENT,
115 key=
"storage_solar_production_2",
116 translation_key=
"storage_solar_production_2",
118 native_unit_of_measurement=UnitOfPower.WATT,
119 device_class=SensorDeviceClass.POWER,
120 state_class=SensorStateClass.MEASUREMENT,
123 key=
"storage_battery_percentage",
124 translation_key=
"storage_battery_percentage",
126 native_unit_of_measurement=PERCENTAGE,
127 device_class=SensorDeviceClass.BATTERY,
128 state_class=SensorStateClass.MEASUREMENT,
131 key=
"storage_power_flow",
132 translation_key=
"storage_power_flow",
134 native_unit_of_measurement=UnitOfPower.WATT,
135 device_class=SensorDeviceClass.POWER,
136 state_class=SensorStateClass.MEASUREMENT,
139 key=
"storage_load_consumption_solar_storage",
140 translation_key=
"storage_load_consumption_solar_storage",
142 native_unit_of_measurement=
"VA",
143 state_class=SensorStateClass.MEASUREMENT,
146 key=
"storage_charge_today",
147 translation_key=
"storage_charge_today",
148 api_key=
"eChargeToday",
149 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
150 device_class=SensorDeviceClass.ENERGY,
151 state_class=SensorStateClass.TOTAL_INCREASING,
154 key=
"storage_import_from_grid",
155 translation_key=
"storage_import_from_grid",
157 native_unit_of_measurement=UnitOfPower.WATT,
158 device_class=SensorDeviceClass.POWER,
159 state_class=SensorStateClass.MEASUREMENT,
162 key=
"storage_import_from_grid_today",
163 translation_key=
"storage_import_from_grid_today",
164 api_key=
"eToUserToday",
165 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
166 device_class=SensorDeviceClass.ENERGY,
167 state_class=SensorStateClass.TOTAL_INCREASING,
170 key=
"storage_import_from_grid_total",
171 translation_key=
"storage_import_from_grid_total",
172 api_key=
"eToUserTotal",
173 native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
174 device_class=SensorDeviceClass.ENERGY,
175 state_class=SensorStateClass.TOTAL,
178 key=
"storage_load_consumption",
179 translation_key=
"storage_load_consumption",
180 api_key=
"outPutPower",
181 native_unit_of_measurement=UnitOfPower.WATT,
182 device_class=SensorDeviceClass.POWER,
183 state_class=SensorStateClass.MEASUREMENT,
186 key=
"storage_grid_voltage",
187 translation_key=
"storage_grid_voltage",
189 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
190 device_class=SensorDeviceClass.VOLTAGE,
191 state_class=SensorStateClass.MEASUREMENT,
195 key=
"storage_pv_charging_voltage",
196 translation_key=
"storage_pv_charging_voltage",
198 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
199 device_class=SensorDeviceClass.VOLTAGE,
200 state_class=SensorStateClass.MEASUREMENT,
204 key=
"storage_pv_charging_voltage_2",
205 translation_key=
"storage_pv_charging_voltage_2",
207 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
208 device_class=SensorDeviceClass.VOLTAGE,
209 state_class=SensorStateClass.MEASUREMENT,
213 key=
"storage_ac_input_frequency_out",
214 translation_key=
"storage_ac_input_frequency_out",
215 api_key=
"freqOutPut",
216 native_unit_of_measurement=UnitOfFrequency.HERTZ,
217 device_class=SensorDeviceClass.FREQUENCY,
218 state_class=SensorStateClass.MEASUREMENT,
222 key=
"storage_output_voltage",
223 translation_key=
"storage_output_voltage",
224 api_key=
"outPutVolt",
225 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
226 device_class=SensorDeviceClass.VOLTAGE,
227 state_class=SensorStateClass.MEASUREMENT,
231 key=
"storage_ac_output_frequency",
232 translation_key=
"storage_ac_output_frequency",
234 native_unit_of_measurement=UnitOfFrequency.HERTZ,
235 device_class=SensorDeviceClass.FREQUENCY,
236 state_class=SensorStateClass.MEASUREMENT,
240 key=
"storage_current_PV",
241 translation_key=
"storage_current_pv",
243 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
244 device_class=SensorDeviceClass.CURRENT,
245 state_class=SensorStateClass.MEASUREMENT,
249 key=
"storage_current_1",
250 translation_key=
"storage_current_1",
251 api_key=
"iChargePV1",
252 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
253 device_class=SensorDeviceClass.CURRENT,
254 state_class=SensorStateClass.MEASUREMENT,
258 key=
"storage_current_2",
259 translation_key=
"storage_current_2",
260 api_key=
"iChargePV2",
261 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
262 device_class=SensorDeviceClass.CURRENT,
263 state_class=SensorStateClass.MEASUREMENT,
267 key=
"storage_grid_amperage_input",
268 translation_key=
"storage_grid_amperage_input",
270 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
271 device_class=SensorDeviceClass.CURRENT,
272 state_class=SensorStateClass.MEASUREMENT,
276 key=
"storage_grid_out_current",
277 translation_key=
"storage_grid_out_current",
278 api_key=
"outPutCurrent",
279 native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
280 device_class=SensorDeviceClass.CURRENT,
281 state_class=SensorStateClass.MEASUREMENT,
285 key=
"storage_battery_voltage",
286 translation_key=
"storage_battery_voltage",
288 native_unit_of_measurement=UnitOfElectricPotential.VOLT,
289 device_class=SensorDeviceClass.VOLTAGE,
290 state_class=SensorStateClass.MEASUREMENT,
294 key=
"storage_load_percentage",
295 translation_key=
"storage_load_percentage",
296 api_key=
"loadPercent",
297 native_unit_of_measurement=PERCENTAGE,
298 device_class=SensorDeviceClass.BATTERY,
299 state_class=SensorStateClass.MEASUREMENT,