diff --git a/.all-contributorsrc b/.all-contributorsrc
new file mode 100644
index 0000000..db24c25
--- /dev/null
+++ b/.all-contributorsrc
@@ -0,0 +1,98 @@
+{
+ "_comment": "This JSON file controls the behaviour of the all contributors bot. A description of the keys can be found here: https://allcontributors.org/docs/en/bot/configuration",
+ "projectName": "ginlong_solis_api_connector",
+ "projectOwner": "Gentleman1983",
+ "repoType": "github",
+ "repoHost": "https://github.com",
+ "files": [
+ "README.md"
+ ],
+ "imageSize": 100,
+ "commit": false,
+ "contributorsPerLine": 7,
+ "contributorsSortAlphabetically": false,
+ "linkToUsage": true,
+ "skipCi": true,
+ "contributors": [
+ {
+ "login": "TobiO79",
+ "name": "Tobias Otto",
+ "avatar_url": "https://avatars.githubusercontent.com/u/30373938?v=4",
+ "profile": "https://github.com/TobiO79",
+ "contributions": [
+ "test",
+ "code",
+ "maintenance",
+ "review"
+ ]
+ },
+ {
+ "login": "Gentleman1983",
+ "name": "Christian Otto",
+ "avatar_url": "https://avatars.githubusercontent.com/u/1020222?v=4",
+ "profile": "https://github.com/Gentleman1983",
+ "contributions": [
+ "test",
+ "code",
+ "maintenance",
+ "review"
+ ]
+ },
+ {
+ "login": "petermdevries",
+ "name": "Peter de Vries",
+ "avatar_url": "https://avatars.githubusercontent.com/u/15040708?v=4",
+ "profile": "https://github.com/petermdevries",
+ "contributions": [
+ "bug"
+ ]
+ },
+ {
+ "login": "Flecky13",
+ "name": "Pedro",
+ "avatar_url": "https://avatars.githubusercontent.com/u/57505680?v=4",
+ "profile": "https://github.com/Flecky13",
+ "contributions": [
+ "bug"
+ ]
+ },
+ {
+ "login": "philicibine",
+ "name": "philicibine",
+ "avatar_url": "https://avatars.githubusercontent.com/u/16887758?v=4",
+ "profile": "https://github.com/philicibine",
+ "contributions": [
+ "bug"
+ ]
+ },
+ {
+ "login": "MetPhoto",
+ "name": "Mark",
+ "avatar_url": "https://avatars.githubusercontent.com/u/2766363?v=4",
+ "profile": "https://github.com/MetPhoto",
+ "contributions": [
+ "bug"
+ ]
+ },
+ {
+ "login": "Stephen2615",
+ "name": "Stephen2615",
+ "avatar_url": "https://avatars.githubusercontent.com/u/43490186?v=4",
+ "profile": "https://github.com/Stephen2615",
+ "contributions": [
+ "bug"
+ ]
+ },
+ {
+ "login": "izakhearn",
+ "name": "Izak Hearn",
+ "avatar_url": "https://avatars.githubusercontent.com/u/25284121?v=4",
+ "profile": "https://izakwebdesigns.co.za",
+ "contributions": [
+ "bug"
+ ]
+ }
+ ],
+ "commitType": "docs",
+ "commitConvention": "angular"
+}
diff --git a/.github/workflows/buildDockerImage.yml b/.github/workflows/buildDockerImage.yml
new file mode 100644
index 0000000..3f9059c
--- /dev/null
+++ b/.github/workflows/buildDockerImage.yml
@@ -0,0 +1,11 @@
+name: Build Docker Container Image
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Build the Docker image
+ run: docker build . --file Dockerfile --tag ginlong-solis-api-connector:$(date +%s)
diff --git a/.github/workflows/publishToDockerhub.yml b/.github/workflows/publishToDockerhub.yml
new file mode 100644
index 0000000..cce4e47
--- /dev/null
+++ b/.github/workflows/publishToDockerhub.yml
@@ -0,0 +1,41 @@
+name: Build and publish a Docker image
+
+on: [ release ]
+
+env:
+ IMAGE_NAME: gentleman1983/ginlong-solis-api-connector
+
+jobs:
+ docker:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
+
+ - name: Extract metadata
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ images: ${{ env.IMAGE_NAME }}
+
+ - name: Build and push
+ uses: docker/build-push-action@v6
+ with:
+ sbom: true
+ push: true
+ provenance: mode=max
+ tags: |
+ gentleman1983/ginlong-solis-api-connector:${{ github.event.release.name }}
+ gentleman1983/ginlong-solis-api-connector:latest
diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml
new file mode 100644
index 0000000..dd0f06e
--- /dev/null
+++ b/.github/workflows/pylint.yml
@@ -0,0 +1,24 @@
+name: Pylint
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.12"]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v5
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install pylint
+ pip install -r requirements.txt
+ - name: Analysing the code with pylint
+ run: |
+ pylint $(git ls-files '*.py')
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2d0653a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,162 @@
+### Python template
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# poetry
+# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+# This is especially recommended for binary packages to ensure reproducibility, and is more
+# commonly ignored for libraries.
+# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+# in version control.
+# https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# PyCharm
+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+# and can be added to the global gitignore or merged into this file. For a more nuclear
+# option (not recommended) you can uncomment the following to ignore the entire idea folder.
+.idea/
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..f5b1cfb
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,46 @@
+# Version change log
+This document provides an overview to the changes on the different releases...
+
+## NEXT
+* t.b.d.
+
+## 3.0.0
+> [!WARNING]
+> In this update we refactored all actual and upcoming number fields to provide data in float values. There may be the
+> need to update your existing InfluxDB instance to handle the new data types.
+* Updated the Dockerhub repository on `README.md`, to not point to the [old dkruyt API scraper images](https://hub.docker.com/repository/docker/dkruyt/ginlong-scraper) ([#51](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/51))
+* Added publishing to Dockerhub repository [gentleman1983/ginlong-solis-api-connector](https://hub.docker.com/repository/docker/gentleman1983/ginlong-solis-api-connector) on release ([#55](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/55))
+* Publishing task to Dockerhub should publish [SBOM](https://www.cisa.gov/sbom), too ([#57](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/57))
+* Add Mend renovate bot to repository ([#56](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/56))
+* Fixed parsing issues regarding api update from March 4th, 2024. ([#68](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/68))
+* Pinned the data units regarding the dynamic units on Ginlong API. ([#13](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/13))
+
+## 2.4.0
+* Added `CHANGELOG.md` document to have central document for changes. ([#38](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/38))
+* Fixed issue regarding bad gateways. ([#46](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/46))
+ * Added option to configure number and timeout between retries.
+* Added the fields `pA`, `pB` and `PC` to change list to update according to API changes on end of November 2023.
+
+## 2.3.1
+* Fixed issue on error handling on the `SOLIS_CLOUD_API_INVERTER_ID` parameter. ([#24](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/24))
+* Fixed possible index out of bounds exception. ([#24](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/24))
+* Added support for all contributors bot. ([#2](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/2), [#26](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/26), [#31](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/31))
+
+## 2.3.0
+* Added option to override detection for single phase inverters. ([#14](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/14))
+* Fixed calculation on some data fields to fix issues on monitoring. ([#16](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/16), [#22](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/22))
+* Fixed mixing up of some PVoutput values (`v3` & `v4`). ([#17](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/17))
+* Fixed issue on influx db where some values where interpreted as integers instead of floats when value is `0`. This lead to problems in data import, e.g. during the nighttime. ([#18](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/18))
+
+## 2.2.0
+* Added configurability for optional PVoutput fields `pv7` to `pv12` for subscribers of PVoutput. ([#4](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/4))
+* Fixed missing usage of inverter ID ENV value. ([#8](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/8))
+* Fixed some conversion issues on integer ENV values like inverter ID, ports, etc. ([#6](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/6))
+* Fixed some PyLint issues or marked them as false positives or as better readable containing them on source code.
+
+## 2.1.0
+* Added functionality to handle single phase inverters ([#3](https://github.com/Gentleman1983/ginlong_solis_api_connector/issues/3))
+* Added option to support multiple inverters
+
+## 2.0.0
+* Added functionality to connect to Solis Cloud API.
diff --git a/Dockerfile b/Dockerfile
index 0c34f42..461193b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,24 +4,27 @@ ARG VERSION
ARG BUILD_DATE
ARG VCS_REF
-LABEL maintainer="dkruyt" \
+LABEL maintainer="Gentleman1983, TobiO79" \
org.opencontainers.image.created=$BUILD_DATE \
- org.opencontainers.image.url="https://github.com/dkruyt/ginlong-solis-scraper" \
- org.opencontainers.image.source="https://github.com/dkruyt/ginlong-solis-scraper" \
+ org.opencontainers.image.url="https://hub.docker.com/repository/docker/gentleman1983/ginlong-solis-api-connector" \
+ org.opencontainers.image.source="https://github.com/Gentleman1983/ginlong_solis_api_connector" \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.revision=$VCS_REF \
- org.opencontainers.image.vendor="dkruyt" \
- org.opencontainers.image.title="ginlong-solis-scraper" \
- org.opencontainers.image.description="Scrapes PV statistics from the Ginlong monitor pages and outputs it to influxdb, pvoutput or mqtt" \
+ org.opencontainers.image.vendor="Gentleman1983" \
+ org.opencontainers.image.title="ginlong-solis-api-connector" \
+ org.opencontainers.image.description="Fetches API data from Solis Cloud API and outputs it to influxdb, pvoutput or mqtt." \
org.opencontainers.image.licenses="GPL-3.0"
ENV LOG_LEVEL="INFO"
-ENV GINLONG_USERNAME=""
-ENV GINLONG_PASSWORD=""
-ENV GINLONG_DOMAIN="m.ginlong.com"
-ENV GINLONG_LANG="2"
-ENV GINLONG_DEVICE_ID=""
+ENV SOLIS_CLOUD_API_KEY_ID=""
+ENV SOLIS_CLOUD_API_KEY_SECRET=""
+ENV SOLIS_CLOUD_API_URL="https://www.soliscloud.com"
+ENV SOLIS_CLOUD_API_PORT="13333"
+ENV SOLIS_CLOUD_API_INVERTER_ID="0"
+ENV SOLIS_CLOUD_API_OVERRIDE_SINGLE_PHASE_INVERTER=""
+ENV SOLIS_CLOUD_API_NUMBER_RETRIES="3"
+ENV SOLIS_CLOUD_API_RETRIES_WAIT_S="1"
ENV USE_INFLUX="false"
ENV INFLUX_DATABASE="influxdb"
@@ -34,12 +37,20 @@ ENV INFLUX_MEASUREMENT="PV"
ENV USE_PVOUTPUT="false"
ENV PVOUTPUT_API_KEY=""
ENV PVOUTPUT_SYSTEM_ID=""
+ENV PVOUTPUT_EXTENDED_V7=""
+ENV PVOUTPUT_EXTENDED_V8=""
+ENV PVOUTPUT_EXTENDED_V9=""
+ENV PVOUTPUT_EXTENDED_V10=""
+ENV PVOUTPUT_EXTENDED_V11=""
+ENV PVOUTPUT_EXTENDED_V12=""
ENV USE_MQTT="false"
ENV MQTT_CLIENT_ID="pv"
ENV MQTT_SERVER="localhost"
ENV MQTT_USERNAME=""
ENV MQTT_PASSWORD=""
+ENV MQTT_TOPIC="topic"
+ENV MQTT_PORT="1883"
ENV TZ=""
@@ -50,6 +61,6 @@ WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
-COPY ginlong-scraper.py ./
+COPY ginlong_solis_api_connector.py ./
-CMD [ "python", "./ginlong-scraper.py" ]
+CMD [ "python", "./ginlong_solis_api_connector.py" ]
diff --git a/Mapping.md b/Mapping.md
new file mode 100644
index 0000000..1d157a0
--- /dev/null
+++ b/Mapping.md
@@ -0,0 +1,37 @@
+# Mapping internal data / REST endpoints
+This table helps to define which Solis REST API endpoints provide which information used for monitoring.
+
+| fieldKey | fieldType | Unit | REST endpoint | API |
+|--------------------------|-----------|------|------------------|------------------------------|
+| AC_Current | float | A | inverterDetail | (iAc1+iAc2+iAc3)/3 |
+| AC_Frequency | float | Hz | inverterDetail | fac |
+| AC_Power | float | W | inverterDetail | pac |
+| AC_Voltage | float | V | inverterDetail | (uAc1+uAc2+uAc3)/3 |
+| Annual_Energy_Used | float | kWh | inverterDetail | eYear - gridSellYearEnergy |
+| Annual_Generation | float | kWh | inverterDetail | eYear |
+| Battery_Charge_Percent | float | | | |
+| Consumption_Energy | float | kWh | inverterDetail | homeLoadTotalEnergy |
+| Consumption_Power | float | W | inverterDetail | familyLoadPower |
+| DC_Current1 | float | A | inverterDetail | iPv1 |
+| DC_Current2 | float | A | inverterDetail | iPv2 |
+| DC_Current3 | float | A | inverterDetail | iPv3 |
+| DC_Current4 | float | A | inverterDetail | iPv4 |
+| DC_Power_PV1 | float | W | inverterDetail | pow1 |
+| DC_Power_PV2 | float | W | inverterDetail | pow2 |
+| DC_Power_PV3 | float | W | inverterDetail | pow3 |
+| DC_Power_PV4 | float | W | inverterDetail | pow4 |
+| DC_Voltage_PV1 | float | V | inverterDetail | uPv1 |
+| DC_Voltage_PV2 | float | V | inverterDetail | uPv2 |
+| DC_Voltage_PV3 | float | V | inverterDetail | uPv3 |
+| DC_Voltage_PV4 | float | V | inverterDetail | uPv4 |
+| Daily_Energy_Used | float | kWh | inverterDetail | eToday - gridSellTodayEnergy |
+| Daily_Generation | float | kWh | inverterDetail | eToday |
+| Generation_Last_Month | float | kWh | inverterYear[-2] | energy |
+| Inverter_Temperature | float | °C | inverterDetail | inverterTemperature |
+| Monthly_Energy_Used | float | kWh | inverterDetail | eMonth - gridSellMonthEnergy |
+| Monthly_Generation | float | kWh | inverterDetail | eMonth |
+| Power_Grid_Total_Power | float | W | inverterDetail | pSum |
+| Total_Energy_Purchased | float | kWh | inverterDetail | gridPurchasedTotalEnergy |
+| Total_Generation | float | kWh | inverterDetail | eTotal |
+| Total_On_grid_Generation | float | kWh | inverterDetail | gridSellTotalEnergy |
+| updateDate | integer | | inverterDetail | dataTimestamp |
diff --git a/README.md b/README.md
index 7bc6668..c636ef1 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,14 @@
-# ginlong-scraper
+![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Gentleman1983/ginlong_solis_api_connector?sort=semver&style=plastic)
+![GitHub workflow (pylint)](https://img.shields.io/github/actions/workflow/status/Gentleman1983/ginlong_solis_api_connector/pylint.yml?label=pylint&style=plastic)
+![GitHub license](https://img.shields.io/github/license/Gentleman1983/ginlong_solis_api_connector?style=plastic)
+![All Contributors](https://img.shields.io/github/all-contributors/Gentleman1983/ginlong_solis_api_connector?style=plastic)
+![GitHub stars](https://img.shields.io/github/stars/Gentleman1983/ginlong_solis_api_connector?style=plastic)
-Scrapes PV statistics from the Ginlong monitor pages and outputs it to influxdb, pvoutput or mqtt.
+# ginlong-solis-api-connector
-https://hub.docker.com/repository/docker/dkruyt/ginlong-scraper
+Fetches API data from Solis Cloud API and outputs it to influxdb, pvoutput or mqtt. Based on [ginlong-scraper by dkruyt](https://github.com/dkruyt/ginlong-scraper).
+
+https://hub.docker.com/repository/docker/gentleman1983/ginlong-solis-api-connector
There is a possibility it also works with the following inverters: Omnik Solar, Solarman and Trannergy Inverters
@@ -12,37 +18,52 @@ invoking the docker image.
In the case of two inverters (see note below) once you have the deviceid you can set up two seperate docker containers
and just vary the deviceId in the environment variables.
+## Requirements
+* You have to order the Solis Cloud API access like described [here](https://solis-service.solisinverters.com/support/solutions/articles/44002212561-api-access-soliscloud).
+* You have to know the Solis Cloud API `KeyID` and `KeySecret`.
+
## Configuration
### Environment variables
-| Environment variable | Required | Description | Default value |
-|---------------------------|----------|------------------------------------------------------------------------------------------------------|-----------------|
-| LOG_LEVEL | No | Logging level (ERROR, INFO, DEBUG) | `INFO` |
-| GINLONG_USERNAME | Yes | Ginlong Solis username | *empty* |
-| GINLONG_PASSWORD | Yes | Ginlong Solis password | *empty* |
-| GINLONG_DOMAIN | No | Ginlong Solis domain | `m.ginlong.com` |
-| GINLONG_LANG | No | Ginlong Solis language | `2` *(English)* |
-| GINLONG_DEVICE_ID | No | Ginlong Solis device ID
(only required if auto-detect fails or if you have more than one device) | *empty* |
-| USE_INFLUX | No | Set to true if you want to use InfluxDB as output | `false` |
-| INFLUX_DATABASE | No | InfluxDB DB name | `influxdb` |
-| INFLUX_SERVER | No | InfluxDB server | `localhost` |
-| INFLUX_PORT | No | InfluxDB server port | `8086` |
-| INFLUX_USER | No | InfluxDB User | *empty* |
-| INFLUX_PASSWORD | No | InfluxDB Password | *empty* |
-| INFLUX_MEASUREMENT | No | InfluxDB measurement type | `PV` |
-| USE_PVOUTPUT | No | Set to true if you want to use PvOutput as output | `false` |
-| PVOUTPUT_API_KEY | No | PvOutput API key | *empty* |
-| PVOUTPUT_SYSTEM_ID | No | PvOutput system ID | *empty* |
-| USE_MQTT | No | Set to true if you want to use MQTT as output | `false` |
-| MQTT_CLIENT_ID | No | MQTT client ID | `pv` |
-| MQTT_SERVER | No | MQTT server | `localhost` |
-| MQTT_USERNAME | No | MQTT username | *empty* |
-| MQTT_PASSWORD | No | MQTT password | *empty* |
-| TZ | No | TimeZone e.g Australia/Sydney | *empty* |
+| Environment variable | Required | Description | Default value |
+|-------------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------|--------------------------------|
+| LOG_LEVEL | No | Logging level (ERROR, INFO, DEBUG) | `INFO` |
+| SOLIS_CLOUD_API_KEY_ID | Yes | API Key ID | *empty* |
+| SOLIS_CLOUD_API_KEY_SECRET | Yes | API Key Secret | *empty* |
+| SOLIS_CLOUD_API_URL | No | API URL | `https://www.soliscloud.com` |
+| SOLIS_CLOUD_API_PORT | No | API Port | `13333` |
+| SOLIS_CLOUD_API_INVERTER_ID | No | Ginlong Solis device ID
(only required if auto-detect fails or if you have more than one device) | `0` or *empty* |
+| SOLIS_CLOUD_API_OVERRIDE_SINGLE_PHASE_INVERTER | No | Override to provide correct calculations for single phase inverters if Solis Cloud API provides wrong data. Simply switch to `true` | *empty* |
+| SOLIS_CLOUD_API_NUMBER_RETRIES | No | Number of retries to fetch an API endpoint | `3` |
+| SOLIS_CLOUD_API_RETRIES_WAIT_S | No | Timeout between retries | `1` |
+| USE_INFLUX | No | Set to true if you want to use InfluxDB as output | `false` |
+| INFLUX_DATABASE | No | InfluxDB DB name | `influxdb` |
+| INFLUX_SERVER | No | InfluxDB server | `localhost` |
+| INFLUX_PORT | No | InfluxDB server port | `8086` |
+| INFLUX_USER | No | InfluxDB User | *empty* |
+| INFLUX_PASSWORD | No | InfluxDB Password | *empty* |
+| INFLUX_MEASUREMENT | No | InfluxDB measurement type | `PV` |
+| USE_PVOUTPUT | No | Set to true if you want to use PvOutput as output | `false` |
+| PVOUTPUT_API_KEY | No | PvOutput API key | *empty* |
+| PVOUTPUT_SYSTEM_ID | No | PvOutput system ID | *empty* |
+| PVOUTPUT_EXTENDED_V7 | No | Set Extendet Output v7 to this API Key from inverterDetail (leave blank if not donated) | *empty* |
+| PVOUTPUT_EXTENDED_V8 | No | Set Extendet Output v8 to this API Key from inverterDetail (leave blank if not donated) | *empty* |
+| PVOUTPUT_EXTENDED_V9 | No | Set Extendet Output v9 to this API Key from inverterDetail (leave blank if not donated) | *empty* |
+| PVOUTPUT_EXTENDED_V10 | No | Set Extendet Output v10 to this API Key from inverterDetail (leave blank if not donated) | *empty* |
+| PVOUTPUT_EXTENDED_V11 | No | Set Extendet Output v11 to this API Key from inverterDetail (leave blank if not donated) | *empty* |
+| PVOUTPUT_EXTENDED_V12 | No | Set Extendet Output v12 to this API Key from inverterDetail (leave blank if not donated) | *empty* |
+| USE_MQTT | No | Set to true if you want to use MQTT as output | `false` |
+| MQTT_CLIENT_ID | No | MQTT client ID | `pv` |
+| MQTT_SERVER | No | MQTT server | `localhost` |
+| MQTT_USERNAME | No | MQTT username | *empty* |
+| MQTT_PASSWORD | No | MQTT password | *empty* |
+| MQTT_PORT | No | MQTT port default 1883 | `1883` |
+| MQTT_TOPIC | No | MQTT topic root, fulltopic will by MQTT_Topic / MQTT_Client_ID | `topic` |
+| TZ | No | TimeZone e.g Australia/Sydney | *empty* |
Note that if you have more than 1 device - then it is not readily apparent where to get the Device ID
-In that case - setup the script, and set LOG_LEVEL to DEBUG, then view the logs and search for deviceId -
+In that case - setup the script, and set `LOG_LEVEL` to `DEBUG`, then view the logs and search for deviceId -
this will list the IDs of each inverter.
## Bonus
@@ -50,3 +71,39 @@ this will list the IDs of each inverter.
The grafana-dashboard-example.json file you could import in to Grafana if you use the influx database. Then you can make a dashboard similar to this.
![grafana](https://github.com/dkruyt/resources/raw/master/grafana-dashboard-ginlong-small.png)
+
+# Contributors
+
+
+
+
+
Tobias Otto ⚠️ 💻 🚧 👀 |
+ Christian Otto ⚠️ 💻 🚧 👀 |
+ Peter de Vries 🐛 |
+ Pedro 🐛 |
+ philicibine 🐛 |
+ Mark 🐛 |
+ Stephen2615 🐛 |
+
Izak Hearn 🐛 |
+ ||||||
+ + Add your contributions + + | +