@@ -196,29 +196,32 @@ def create_entry(log_type: LogType, sh_log_data: LegacySmartHomeLogData, previou
196196 date = timecheck .create_timestamp_YYYYMMDD ()
197197 current_timestamp = int (timecheck .create_timestamp ())
198198
199- prices = data .data .general_data .data .prices
200- if data .data .optional_data .et_module is not None :
201- grid_price = data .data .optional_data .et_get_current_price ()
202- else :
203- grid_price = prices .grid
204- prices_dict = {"grid" : grid_price ,
205- "pv" : prices .pv ,
206- "bat" : prices .bat }
199+ try :
200+ prices = data .data .general_data .data .prices
201+ try :
202+ grid_price = data .data .optional_data .et_get_current_price ()
203+ except Exception :
204+ grid_price = prices .grid
205+ prices_dict = {"grid" : grid_price ,
206+ "pv" : prices .pv ,
207+ "bat" : prices .bat }
208+ except Exception :
209+ log .exception ("Fehler im Werte-Logging-Modul für Preise" )
210+ prices_dict = {}
207211
208- cp_dict = {}
212+ try :
213+ cp_dict = {"all" : {"imported" : data .data .cp_all_data .data .get .imported ,
214+ "exported" : data .data .cp_all_data .data .get .exported }}
215+ except Exception :
216+ log .exception ("Fehler im Werte-Logging-Modul" )
217+ cp_dict = {}
209218 for cp in data .data .cp_data :
210219 try :
211220 if "cp" in cp :
212221 cp_dict .update ({cp : {"imported" : data .data .cp_data [cp ].data .get .imported ,
213222 "exported" : data .data .cp_data [cp ].data .get .exported }})
214223 except Exception :
215224 log .exception ("Fehler im Werte-Logging-Modul für Ladepunkt " + str (cp ))
216- try :
217- cp_dict .update (
218- {"all" : {"imported" : data .data .cp_all_data .data .get .imported ,
219- "exported" : data .data .cp_all_data .data .get .exported }})
220- except Exception :
221- log .exception ("Fehler im Werte-Logging-Modul" )
222225
223226 ev_dict = {}
224227 for ev in data .data .ev_data :
@@ -242,7 +245,11 @@ def create_entry(log_type: LogType, sh_log_data: LegacySmartHomeLogData, previou
242245 except Exception :
243246 log .exception ("Fehler im Werte-Logging-Modul für Zähler " + str (counter ))
244247
245- pv_dict = {"all" : {"exported" : data .data .pv_all_data .data .get .exported }}
248+ try :
249+ pv_dict = {"all" : {"exported" : data .data .pv_all_data .data .get .exported }}
250+ except Exception :
251+ log .exception ("Fehler im Werte-Logging-Modul für PV-Daten" )
252+ pv_dict = {}
246253 if data .data .pv_all_data .data .config .configured :
247254 for pv in data .data .pv_data :
248255 try :
@@ -251,9 +258,13 @@ def create_entry(log_type: LogType, sh_log_data: LegacySmartHomeLogData, previou
251258 except Exception :
252259 log .exception ("Fehler im Werte-Logging-Modul für Wechselrichter " + str (pv ))
253260
254- bat_dict = {"all" : {"imported" : data .data .bat_all_data .data .get .imported ,
255- "exported" : data .data .bat_all_data .data .get .exported ,
256- "soc" : data .data .bat_all_data .data .get .soc }}
261+ try :
262+ bat_dict = {"all" : {"imported" : data .data .bat_all_data .data .get .imported ,
263+ "exported" : data .data .bat_all_data .data .get .exported ,
264+ "soc" : data .data .bat_all_data .data .get .soc }}
265+ except Exception :
266+ log .exception ("Fehler im Werte-Logging-Modul für Batteriespeicher-Daten" )
267+ bat_dict = {}
257268 if data .data .bat_all_data .data .config .configured :
258269 for bat in data .data .bat_data :
259270 try :
@@ -263,7 +274,11 @@ def create_entry(log_type: LogType, sh_log_data: LegacySmartHomeLogData, previou
263274 except Exception :
264275 log .exception ("Fehler im Werte-Logging-Modul für Speicher " + str (bat ))
265276
266- hc_dict = {"all" : {"imported" : data .data .counter_all_data .data .set .imported_home_consumption }}
277+ try :
278+ hc_dict = {"all" : {"imported" : data .data .counter_all_data .data .set .imported_home_consumption }}
279+ except Exception :
280+ log .exception ("Fehler im Werte-Logging-Modul für Hausverbrauch" )
281+ hc_dict = {}
267282 new_entry = {
268283 "timestamp" : current_timestamp ,
269284 "date" : date ,
0 commit comments