Skip to content

Commit

Permalink
Improved PVOutput midnight reporting
Browse files Browse the repository at this point in the history
Accumulator values for PV and consumption were previously reset at midnight; PVOutput expects monotonic increases throughout the day.  However, system latency can still occasionally cause the previous day's accumulator values to be reported by the GivEnergy server for a few minutes after midnight. Blanking now extended to 00h05.
  • Loading branch information
salewis38 authored Dec 29, 2023
1 parent 27bc86c commit ee4f357
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions palm.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,9 @@ def update(self):

# Publish data to PVOutput.org
if events.post_pvoutput is True:
if stgs.pg.t_now_mins < 6:
inverter.pv_energy = 0 # Reset totals to prevent carry-over issue with PVOutput
inverter.grid_energy = 0
stgs.pg.pvo_tstamp = stgs.pg.loop_counter
do_put_pv_output = threading.Thread(target=put_pv_output)
do_put_pv_output.daemon = True
Expand All @@ -810,8 +813,6 @@ def update(self):
stgs.pg.loop_counter += 1

if stgs.pg.t_now_mins == 0: # Reset frame counter every 24 hours
inverter.pv_energy = 0 # Reset daily to prevent carry-over issue with PVOutput
inverter.grid_energy = 0
stgs.pg.loop_counter = 1

if stgs.pg.test_mode or stgs.pg.once_mode: # Wait 5 seconds
Expand Down

0 comments on commit ee4f357

Please sign in to comment.