Git Product home page Git Product logo

pvbridge's People

Contributors

codecasternl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pvbridge's Issues

Create EventLog Source during installation

EventLog.CreateEventSource("CodeCaster.PVBridge.Service", "Application");

Probably rename?

services.Configure<EventLogSettings>(settings =>
{
    settings.SourceName = "PVBridge Service";
});

How to handle multiple inverters per plant on GoodWe

When a user has multiple inverters in their plant, we only send the data of the first.

Ideas:

  • Send aggregated data to PVOutput, so use multiple inverters as input, and add the power and generation together, take highest temperature and voltage.
  • Allow many-to-many configuration: inverter X corresponds to PVOutput system X, Y to Y, and so on. PVOutput supports this through "parent-child" system, where they do the aggregation. PVBridge configuration file supports this, UI not yet.

Send 0-status outputs

  • At the start of the day, the first > 0 is sent and then the 0 before it.
  • At the end of the day, the last 0 isn't sent.
  • Intermediate downtime (solar eclipse, maintenance, snow, power outage, ...) isn't properly padded with 0s either.

Service still running on uninstall

Uninstall complains that the service is still running before we get the chance to stop and uninstall it through the command-line invocation of the service. If we commit before that step, there's no rolling back.

Stop and uninstall in two steps, restart on uninstall cancel?

Sync further back than 14 days and allow greater resolution

Sync backlog since installation date of system.

For that we need to write a little JSON in AppData\PVBridge\PVBridge.Status.json with where we are, or we'll poll more and more months the longer a system is installed (Schlemiel the Painter algorithm).

Also, the interval is currently hardcoded at 5, we can do a Math.Max(input.Resolution, output.Resolution). Could be 1 minute in PVOutput donation mode.

Sync hangs when missing GoodWe data for a certain day

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.

No input snapshot data from GoodWe

This happend after the PC running the service was off for a full day. Data is available on semsportal just fine. Restarting service wont fix it. According to the UI everything the plant/inverter can be found and accessed. Same as the PVoutput system. Log file:

2022-08-04 08:09:11,766 [1] INFO HostApplicationStartupLifetime+d__7 - Windows Service start requested
2022-08-04 08:09:11,808 [.NET ThreadPool Worker] INFO HostApplicationStartupLifetime - Windows Service OnStart() was called
2022-08-04 08:09:11,813 [.NET ThreadPool Worker] INFO WindowsServiceBackgroundService+d__6 - CodeCaster.PVBridge.Service.PvBridgeService.ExecuteAsync() called, calling TryExecuteAsync()
2022-08-04 08:09:11,820 [.NET ThreadPool Worker] INFO WindowsServiceLifetime - Application started. Hosting environment: Production; Content root path: C:\Program Files\PVBridge
2022-08-04 08:09:11,871 [.NET ThreadPool Worker] INFO ExtendedWindowsServiceLifetime - Windows Service session change event: 1, SessionLogon
2022-08-04 08:09:12,819 [.NET ThreadPool Worker] INFO PvBridgeService+d__15 - Loading configuration
2022-08-04 08:09:12,851 [.NET ThreadPool Worker] INFO PvBridgeService - Configuring GoodWe to PVOutput
2022-08-04 08:09:12,853 [.NET ThreadPool Worker] INFO PvBridgeService+d__12 - Entering main loop with 1 task
2022-08-04 08:09:16,278 [6] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:11:20,883 [4] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:13:25,354 [18] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:15:29,939 [18] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:17:34,738 [18] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:19:39,151 [31] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:21:43,934 [41] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:23:48,487 [41] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:25:53,101 [27] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?
2022-08-04 08:27:57,792 [27] WARN InputToOutputWriter+d__8 - No input snapshot data from GoodWe on 2022-08-02 (Tue). Inverter offline, snowy day, maintenance?

Need gRPC over named pipes with global pipe.

To let the UI query service status or receive events, we need two-way gRPC over named pipes. That works now, but only in dev, because the named pipe server started by the service isn't global, hence inaccessible to the UI running in current user's session and not in that of the network service.

Then this can be implemented in the configuration/status UI:

  • Up-to-date status (for example grey/red/yellow/green light bulbs for the past 14 days?)
  • When running UI in the background (minimized to tray after startup), show notifications:
    • "X hours/days synced" after resume/start, but only if ... > 2 hours since last sync
    • Prolonged outages
    • Auth errors (API key revoked, password changed?)

Documentation

  • GitHub Pages, create docs folder and project.
  • Contents:
    • Home
      • What's the purpose?
      • Prerequirements
    • Obtaining credentials
    • Downloading (SmartScreen)
    • Installation
    • Configuration
    • Output
    • Logs
    • Command line

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.