GithubHelp home page GithubHelp logo

seanonet / froniussolarapi-toolkit Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 51 KB

Tools and libraries to help you retrieve/consume and store data from the Fronius solar API.

License: MIT License

C# 100.00%
fronius-datalogger-web fronius-solar-api fronius-inverter fronius-datamanager fronius poller

froniussolarapi-toolkit's Introduction

FroniusSolarApi-Toolkit

Tools and libraries to help you retrieve/consume and store data from the Fronius solar API.

Getting Started

These instructions will get your clone of FroniusSolarApi-Toolkit up and running on your local machine for development.

  • Download and install .NET 6.0
  • cd /FroniusSolarApi-Toolkit/
  • dotnet restore
  • dotnet build && dotnet run --project FroniusSolarApi.Poller/FroniusSolarApi.Poller.csproj help

Components Overview

FroniusSolarApi.Poller

Usage

poller.exe fetchRealtime -c CumulationInverterData -s Console

Configuration

The FroniusSolarClient and FroniusSolarApi.Repository configuration values are stored in appsettings.json

Description
SolarAPI_URL The url of your Solar inverter

Example:

{
  "SolarAPI_URL": "192.168.1.102",
  "CsvConfiguration": {
    "FileLocation": "C:\\Temp",
    "FileName": "poller"
  }
}

Each data store repository has it's own configuration section see FroniusSolarApi.Repository for more details

Options

Options are case insensitive

Flag Description Example
-c, --collections Required. Data collections to retrieve. CumulationInverterData
-s, --store Required. Where to save the data Console
-p, --scope (Default: Device) Query specific device(s) or whole system. Device
-d, --device (Default: 1) The device id to query. 1
-v, --verbose Set output to verbose messages. --verbose
--help Display this help screen. --help
--version Display version information. --version

You can view the poller options by running poller.exe fetchRealtime help

FroniusSolarApi.Poller 0.0.1
Copyright (C) 2019 FroniusSolarApi.Poller
USAGE:
Fetch CumulationInverterData collection and output to the console:
  poller fetchRealtime

  c, collections    Required. Data collections to retrieve. Valid values:
                    CumulationInverterData, CommonInverterData,
                    MinMaxInverterData

  s, store          Required. Where to save the data. Valid values: Console,
                    Csv, Mssql

  p, scope          (Default: Device) Query specific device(s) or whole system.
                    Valid values: Device, System

  d, device         (Default: 1) The device id to query.

  help              Display more information on a specific command.

  version           Display version information.

Scheduling

You can setup a cron schedule to automate the retrieval and storage of inverter data on Linux. For Microsoft Windows you can use Task Scheduler

CIFS/Samba file share on linux

If you would like to save the Csv file onto a CIFS/Samba share run:

  • sudo apt update
  • sudo apt install samba samba-common-bin smbclient cifs-utils
  • sudo mount.cifs //<ip>/<share>/ /home/pi/<local> --verbose -o user=<user>,uid=1000,gid=1000

Replace uid and gid with your user id, you can find this info by running cat /etc/passwd

For more info see the Raspberry Pi documentation

Logging

By default poller logs will be saved to logs/pollerlog_{date}.txt

FroniusSolarApi.Repository

Handles storing of the inverter data returned from the FroniusSolarClient fetched using the FroniusSolarApi.Poller

Current supported data sources are listed below.

  • Console - outputs the response to the console
  • Csv - saves the response to a csv file
  • Mssql - saves the response to a Microsoft SQL database
  • Custom - you can implement your own custom data store or create an issue and i can look at adding support for the given data store in FroniusSolarApi.Repository.

Console

Prints the response to the console output. poller.exe fetchRealtime -c CommonInverterData -s Console

{
  "DAY_ENERGY": {
    "Unit": "Wh",
    "Value": 10349.0
  },
  "YEAR_ENERGY": {
    "Unit": "Wh",
    "Value": 195414.41
  },
  "TOTAL_ENERGY": {
    "Unit": "Wh",
    "Value": 195414.01999999999
  },
  "DeviceStatus": {
    "StatusCode": 2,
    "MgmtTimerRemainingTime": -1,
    "ErrorCode": 522,
    "LEDColor": 3,
    "LEDState": 0,
    "StateToReset": true
  }
}

Csv

Saves the response to a csv file. You can configure the csv settings under the CsvConfiguration section in appsettings.json

Description
FileLocation The location to save the csv file
FileName This will trail the name of the csv file after the collection name for example CumulationInverterData_poller.csv
  "CsvConfiguration": {
    "FileLocation": "C:\\Temp",
    "FileName": "poller"
  }

For more information see Configuration

Mssql

Saves the response to a csv file. You can configure the mssql settings under the MssqlConfiguration section in appsettings.json

For more information see Configuration

Custom

FroniusSolarClient

The FroniusSolarClient is a .NET Client wrapper for the Fronius Solar API. Used to connect and invoke REST calls on the inverter.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

froniussolarapi-toolkit's People

Contributors

dependabot[bot] avatar seanonet avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.