Giter Site home page Giter Site logo

szymi- / fronius-to-influx Goto Github PK

View Code? Open in Web Editor NEW
54.0 15.0 14.0 536 KB

Collect Fronius inverter data and save in Influxdb for Grafana

Python 100.00%
fronius fronius-grafana grafana grafana-influxdb grafana-dashboard photovoltaics photovoltaic inverter-graphs

fronius-to-influx's Introduction

fronius-to-influx

Collect Fronius inverter data and save in Influxdb for Grafana. This tool collects the most basic Fronius inverter data for a most basic fotovoltaic setup. If your installation is more sophisticated, then probably some extra work will be reqired.

fronius endpoints

This tool collects data from one or many of the three endpoints below. Endpoints that can be used (adjust DeviceId accordingly):

http://<fronius_ip>/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DataCollection=3PInverterData&DeviceId=1
http://<fronius_ip>/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DataCollection=CommonInverterData&DeviceId=1
http://<fronius_ip>/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DataCollection=MinMaxInverterData&DeviceId=1

install reqirements

To install requirements:

pip install -r requirements.txt

run "production" environment

To run this tool with real inverter data, first copy the src/dev.py file to src/prod.py and adjust configuration (IP addresses, port numbers, user names and passwords, list of endpoints):

vim src/prod.py 

Then run:

python src/prod.py

install dev environment

To install dev environment:

pip install -r requirements/dev.txt

mock fronius server

To run mock fronius server:

export FLASK_APP=json_server
flask run

run "development" environment

For development, I used this Grafana + Influx Docker image: https://hub.docker.com/r/philhawthorne/docker-influxdb-grafana/

Edit the dev.py file and adjust accordingly. Then run:

python src/dev.py

grafana dashboards

I put my dashboards in grafana_dashboards directory. Feel free to use them.

Screenshot Screenshot2 Screenshot3 Screenshot4

fronius-to-influx's People

Contributors

dependabot[bot] avatar louisguitton avatar szymi- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fronius-to-influx's Issues

Skrypt sie wysypuje po jakimś czasie

Od razu zacznę że nie jestem zaawansowanym userem i poprawne uruchomienie skryptu zajęło mi kilka godzin z jakiegoś powodu.
Ale jak już go odpaliłem i działał, no to po jakiejś pół godzinie zauważyłem że nie działa.
Uruchamiam go na rPi3B w screenie podczas startupu.

Ale do szczegółów, w końcu miałem trochę cierpliwości żeby złapać co się dzieje i jest to jak następuje:

Data written
Data written
Traceback (most recent call last):
  File "/home/pi/skrypty/fronius-to-influx/src/fronius_to_influx.py", line 130, in run
    collected_data.extend(self.translate_response())
  File "/home/pi/skrypty/fronius-to-influx/src/fronius_to_influx.py", line 54, in translate_response
    'ErrorCode': self.data['Body']['Data']['DeviceStatus']['ErrorCode'],
KeyError: 'DeviceStatus'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "src/prod.py", line 20, in <module>
    z.run()
  File "/home/pi/skrypty/fronius-to-influx/src/fronius_to_influx.py", line 144, in run
    raise WrongFroniusData('Response structure is not healthy')
fronius_to_influx.WrongFroniusData: Response structure is not healthy

Niestety moja wiedza jest zbyt mała żeby w ogóle nie bać się próbować szukać co może być przyczyną, ale wystarczająca żeby dodać skrypt do crona, który uruchomi skrypt z powrotem jeśli spadnie z rowerka. Niestety prowadzi to do lekkich dziur w wykresach.
firefox_2020-12-03_14-01-15

I sold my Fronius inverter!

I now use a Huawei inverter. My installation got twice as big as it used to be and I had to replace my inverter, unfortunately I had to go for something cheaper than Fronius for the operation to have economic sense. So I will keep my old Fronius data in Grafana, but will have to change how the data is pushed to Grafana (possibly using this tool: https://gitlab.com/Emilv2/huawei-solar/). I will publish the result in a separate repo. I will keep this repo available as it seems quite popular for my standards.

Unclear installation guide. (for me at least)

Hi,
First of all thanks for you work, and for publishing. The repo looks very promising, but unfortunately am unable to get it work in any circumstances. I'm not a great coder, I've minimal python knowledge, so I've tried to reverse engineered the code but it exeeds my skills.
I've followed the installation guide, and all looked fine but after I've run the prod.py, i get the following infinitively:

Waiting for connection...
Waited 10 seconds for connection
Waiting for connection...

The following are not clear:

  • in the prod.py, at the endpoinst section, should I only change the fronius ip (i do not think so, since my fronius is not listening on port 5000) or sholud i change it to the endpoint from the enpoint section in the readme (those links are working from browser, and I get the proper json, but the script isn't working with that either)
  • I do not have influx configured. it is installed with "pip install req...." but no database created, no schema, nothing. I thought, that the script will do it, but am not see any code snippet related to the DB creation. Nevertheless the server not lisntening on 8087, and the influx is not running at all. Where should i know the credentials for the influx if it is not configured. If It wolud have been preconfigured, what db schema should i use?
  • the flask should have to run in the background?

I hope my questions are not noob and am not only overlook something very obvious :D

Problem - syntaxError

Hi,
after "python src/prod.py' command I have an error:

Traceback (most recent call last):
File "src/prod.py", line 1, in
from fronius_to_influx import FroniusToInflux
File "/home/pi/fronius-to-influx-master/src/fronius_to_influx.py", line 30
def init(self, client: InfluxDBClient, location: Location, endpoints: List[str], tz: Any) -> None:
^
SyntaxError: invalid syntax

Astral location syntax

Hi,

Can you please explain the 87 in this line?

I think I have worked out the rest.

image

Thanks in advance!

Ben.

Problem z Pytz?

Cześć,
używam od dłuższego czasu Twojego narzędzia. Jest super! Polecałem kilku osobom również. Dzięki!
Od kilku dni coś nie działa, przy uruchomieniu skryptu prod.py mam komunikat:
Traceback (most recent call last):
File "/home/pi/fronius-to-influx-master/src/prod.py", line 1, in
from fronius_to_influx import FroniusToInflux
File "/home/pi/fronius-to-influx-master/src/fronius_to_influx.py", line 7, in
import pytz
ModuleNotFoundError: No module named 'pytz'

Jak próbowałem doinstalować jeszcze raz pytz pojawił się komunikat, że jest już (zgodnie z prawdą) zainstalowany.
W czym może być problem?
Pozdrawiam Michał

SyntaxError: invalid syntax

Hej,

zrobilem krok po kroku instalacje, i w moencie jak uruchmiam skrypt dostaje blad:
Traceback (most recent call last): File "src/prd.py", line 1, in <module> from fronius_to_influx import FroniusToInflux File "/home/fronius/fronius-to-influx/src/fronius_to_influx.py", line 30 def __init__(self, client: InfluxDBClient, location: Location, endpoints: List[str], tz: Any) -> None: ^

z gory dzieki za pomoc

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.