CodeCasterNL / PVBridge

Sync live and historic solar panel data from GoodWe to PVOutput.org and CSV, on Windows.
https://codecasternl.github.io/PVBridge/
MIT License
3 stars 0 forks source link

Sync hangs when missing GoodWe data for a certain day #23

Open CodeCasterNL opened 2 years ago

CodeCasterNL commented 2 years ago
2022-06-21 21:28:35,648 [.NET ThreadPool Worker] WARN  InputToOutputLoop+<SyncBacklogAsync>d__14 - No input summary data for GoodWe on 2022-06-15 (Wed), skipping
2022-06-21 21:30:39,257 [62] WARN  PVOutputApiClient+<TryHandleAndLogRequest>d__15`1 - Bad Request
PVOutput.Net.Responses.PVOutputException: No system or data found
   at PVOutput.Net.Requests.Handler.RequestHandler.ProcessHttpErrorResults(HttpResponseMessage response, Stream responseStream)
   at PVOutput.Net.Requests.Handler.RequestHandler.ResponseIsErrorResponse(HttpResponseMessage responseMessage, Stream responseStream, PVOutputBaseResponse result)
   at PVOutput.Net.Requests.Handler.RequestHandler.ExecuteArrayRequestAsync[TResponseContentType](IRequest request, Dictionary`2 loggingScope, CancellationToken cancellationToken)
   at CodeCaster.PVBridge.PVOutput.PVOutputApiClient.TryHandleAndLogRequest[TResponse](Func`1 request, String jsonName)
2022-06-21 21:30:39,260 [62] WARN  InputToOutputLoop+<SyncBacklogAsync>d__14 - No input summary data for GoodWe on 2022-06-15 (Wed), skipping

No summaries from GoodWe, nor on PVOutput for that day. Force-sync, then skip?

GoodWe API is down often. Sometimes it won't return summaries for some days, or reports for weeks, while at a later moment it will. The other scenario is that it's a new system for which no data is present yet, then it'll keep trying to sync that dataless day until it's outside our backlog sync period (> 14 days ago).

Solution: don't go into backlog sync mode when a day sync fails, go to live sync anyway, then retry the backlog sync after 1-2-4-8-... hours.