@@ -410,12 +410,13 @@ def _collect_energy_pulses(self, start_utc: datetime, end_utc: datetime):
410410 else :
411411 _mem_address = self ._energy_timestamp_memory_address (_log_timestamp )
412412 _LOGGER .warning (
413- "_collect_energy_pulses for %s at %s not found, request counter from memory %s (from mem=%s, slot=%s)" ,
413+ "_collect_energy_pulses for %s at %s not found, request counter from memory %s (from mem=%s, slot=%s, timestamp=%s )" ,
414414 self .mac ,
415415 str (_log_timestamp ),
416416 str (_mem_address ),
417417 str (self ._last_log_address ),
418418 str (self ._energy_last_populated_slot ),
419+ str (self ._energy_last_collected_timestamp ),
419420 )
420421 self .request_energy_counters (_mem_address )
421422 _energy_history_failed = True
@@ -427,7 +428,7 @@ def _collect_energy_pulses(self, start_utc: datetime, end_utc: datetime):
427428
428429 def _update_energy_current_hour (self , _pulses_cur_hour ):
429430 """Update energy consumption (pulses) of current hour"""
430- _LOGGER .debug (
431+ _LOGGER .info (
431432 "_update_energy_current_hour for %s | counter = %s, update= %s" ,
432433 self .mac ,
433434 str (self ._energy_pulses_current_hour ),
@@ -503,7 +504,7 @@ def _update_energy_today_now(
503504 )
504505
505506 if _pulses_today_now is None :
506- _LOGGER .warning (
507+ _LOGGER .info (
507508 "_update_energy_today_now for %s | skip update, hour: %s=%s=%s, history: %s=%s=%s, day: %s=%s=%s" ,
508509 self .mac ,
509510 str (hour_rollover ),
@@ -537,7 +538,7 @@ def _update_energy_today_now(
537538 def _update_energy_previous_hour (self , prev_hour : datetime ):
538539 """Update energy consumption (pulses) of previous hour"""
539540 _pulses_prev_hour = self ._collect_energy_pulses (prev_hour , prev_hour )
540- _LOGGER .debug (
541+ _LOGGER .info (
541542 "_update_energy_previous_hour for %s | counter = %s, update= %s, timestamp %s" ,
542543 self .mac ,
543544 str (self ._energy_pulses_yesterday ),
@@ -581,7 +582,7 @@ def _update_energy_today_hourly(self, start_today: datetime, end_today: datetime
581582 _pulses_today_hourly = 0
582583 else :
583584 _pulses_today_hourly = self ._collect_energy_pulses (start_today , end_today )
584- _LOGGER .debug (
585+ _LOGGER .info (
585586 "_update_energy_today_hourly for %s | counter = %s, update= %s, range %s to %s" ,
586587 self .mac ,
587588 str (self ._energy_pulses_today_hourly ),
@@ -663,6 +664,7 @@ def _response_energy_counters(self, message: CircleEnergyCountersResponse):
663664 _local_hour = datetime .now ().hour
664665 _utc_midnight_timestamp = _utc_hour_timestamp - timedelta (hours = _local_hour )
665666 _midnight_rollover = False
667+ _history_rollover = False
666668
667669 for _slot in range (1 , 5 ):
668670 _log_timestamp = getattr (message , "logdate%d" % (_slot ,)).value
@@ -698,7 +700,7 @@ def _response_energy_counters(self, message: CircleEnergyCountersResponse):
698700 _log_timestamp == _utc_midnight_timestamp
699701 and self ._energy_consumption_today_reset < _local_midnight_timestamp
700702 ):
701- _LOGGER .debug (
703+ _LOGGER .info (
702704 "_response_energy_counters for %s | midnight rollover, reset date to %s" ,
703705 self .mac ,
704706 str (_local_midnight_timestamp ),
@@ -737,6 +739,12 @@ def _response_energy_counters(self, message: CircleEnergyCountersResponse):
737739 _utc_midnight_timestamp ,
738740 )
739741 self ._update_energy_today_now (False , _history_rollover , _midnight_rollover )
742+ else :
743+ _LOGGER .info (
744+ "_response_energy_counters for %s | self._energy_history_collecting running" ,
745+ self .mac ,
746+ str (_local_midnight_timestamp ),
747+ )
740748
741749 # Cleanup energy history for more than 8 day's ago
742750 _8_days_ago = datetime .utcnow ().replace (
0 commit comments