CasCap.Api.Fronius 1.1.0

Prefix Reserved
dotnet add package CasCap.Api.Fronius --version 1.1.0
                    
NuGet\Install-Package CasCap.Api.Fronius -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CasCap.Api.Fronius" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CasCap.Api.Fronius" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="CasCap.Api.Fronius" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CasCap.Api.Fronius --version 1.1.0
                    
#r "nuget: CasCap.Api.Fronius, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CasCap.Api.Fronius@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CasCap.Api.Fronius&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=CasCap.Api.Fronius&version=1.1.0
                    
Install as a Cake Tool

CasCap.Api.Fronius

A .NET library that integrates with a Fronius solar inverter (Symo Gen24) via its local Solar API v1, samples power-flow data every second, and dispatches each reading to configurable sinks.

Installation

Targets .NET 8 and .NET 10.

dotnet add package CasCap.Api.Fronius

Usage

Load the JSON configuration below in a .NET host and read a live power-flow response:

using CasCap.Extensions;
using CasCap.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddFronius(builder.Configuration, lite: true);
using var host = builder.Build();
var response = await host.Services.GetRequiredService<FroniusClientService>()
    .GetPowerFlowRealtimeData();

Enable Solar API access on the inverter and substitute its LAN URL. lite: true supports direct queries without monitoring. For continuous collection, use full registration and start its IBgFeature workers with AddFeatureFlagService, as the SmartHaus host does.

Monitoring

The library is built around one background service that forms the core pipeline:

FroniusMonitorBgService waits for the device health check, then polls GetPowerFlowRealtimeData every second by default. Each response becomes a FroniusEvent containing SOC, P_Akku, P_Grid, P_Load, P_PV and a UTC timestamp. Events are dispatched to all registered sinks in parallel; the Metrics sink owns OpenTelemetry gauges.

A REST API (FroniusController) exposes endpoints for real-time power flow, inverter data, meter readings, storage state, and historical line items.

Sinks

Sink Description
Console Logs every event via the .NET logger (Debug level)
Memory Tracks the latest power-flow reading in memory for snapshot queries
Metrics Emits power and percentage gauges via OpenTelemetry metrics

Optional Redis and Azure Tables implementations are provided by CasCap.Api.Fronius.Sinks.

Event Flow

flowchart TD
    INVERTER["Fronius Inverter\n(LAN REST API v1)"]

    subgraph Monitor["FroniusMonitorBgService (every 1 s)"]
        HEALTH["Await connection\nhealth check"]
        FETCH["GetPowerFlowRealtimeData"]
        BUILD["Build FroniusEvent\n(SOC, P_Akku, P_Grid, P_Load, P_PV, UtcDateTime)"]
        DISPATCH["Fan-out to all sinks\nTask.WhenAll"]
    end

    SINK_CONSOLE["Console Sink\n(logger)"]
    SINK_MEMORY["Memory Sink\n(latest power-flow reading)"]
    SINK_METRICS["Metrics Sink\n(power gauges)"]

    CLIENT["FroniusClientService\n(powerflow, inverter, meter, storage, …)"]

    INVERTER -->|HTTP REST| CLIENT
    CLIENT --> FETCH
    HEALTH --> FETCH --> BUILD --> DISPATCH
    DISPATCH --> SINK_CONSOLE
    DISPATCH --> SINK_MEMORY
    DISPATCH --> SINK_METRICS

Configuration Examples

Minimal

{
  "CasCap": {
    "FroniusConfig": {
      "BaseAddress": "http://inverter.example.com",
      "AzureTableStorageConnectionString": "https://example.table.core.windows.net",
      "Sinks": {
        "AvailableSinks": {
          "Console": { "Enabled": true },
          "Metrics": { "Enabled": true }
        }
      }
    }
  }
}

Fully configured

{
  "CasCap": {
    "FroniusConfig": {
      "BaseAddress": "http://inverter.example.com",
      "AzureTableStorageConnectionString": "https://example.table.core.windows.net",
      "HealthCheckUri": "solar_api/v1/GetPowerFlowRealtimeData.fcgi",
      "HealthCheck": "Readiness",
      "PollingIntervalMs": 1000,
      "ConnectionPollingDelayMs": 1000,
      "ConnectionLogEscalationInterval": 10,
      "SocAlertThreshold": 0.95,
      "SocAlertHysteresis": 0.05,
      "SocAlertCooldownMs": 300000,
      "Sinks": {
        "AvailableSinks": {
          "Console": { "Enabled": true },
          "Memory": { "Enabled": true },
          "Metrics": { "Enabled": true }
        }
      }
    }
  }
}

The storage endpoint is required by the options model even when only local sinks are selected.

License

This project is released under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CasCap.Api.Fronius:

Package Downloads
CasCap.Api.Fronius.Sinks

Pluggable event sink implementations (Redis, Azure Tables) for the CasCap.Api.Fronius solar inverter integration library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 98 10/25/2026
0.11.2 145 9/20/2026
0.11.1 118 9/20/2026
0.10.31 129 9/11/2026
0.10.28 145 8/18/2026
0.10.25 163 7/15/2026
0.10.24 178 6/26/2026
0.10.22 153 6/14/2026
0.10.21 153 6/12/2026
0.10.20 156 6/10/2026
0.10.19 155 5/26/2026
0.10.18 151 5/15/2026
0.10.14 162 5/8/2026
0.10.11 156 4/24/2026
0.10.10 142 4/24/2026