Giter Site home page Giter Site logo

aiolos / inverter-data-logger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xtheone/inverter-data-logger

0.0 2.0 0.0 110 KB

Data logger for Omnik/Hosola and other Solarman Wi-Fi kit powered Solar Inverters

License: GNU General Public License v3.0

Python 100.00%

inverter-data-logger's Introduction

Inverter Data Logger

Inverter Data Logger is a small script for uploading data from a Omnik, Hosola, Goodwe, Solax, Ginlong, Samil, Sofar or Power-One Solar inverter, equipped with a wifi module or connected to a Wi-Fi data logger from iGEN tech, to a database, Domoticz and/or to PVoutput.org.

This script is designed to be run as a cronjob (or scheduled tasks on Windows) every minute. Every time this script is run the data from the inverter(s) will be send to the enabled plugin(s). And with a five minute interval the data will also be uploaded to PVoutput.org as a live status when enabled.

Origin

This is based on the original work of Wouter van der Zwan and includes some improvements made by others.

Supported inverters

  • Users reported that this script works for wifi kits with a s/n starting with 602xxxxxx to 606xxxxxx.
  • Also tested with a Wifi kit in a Hosola inverter in the 611xxxxx range.
  • Also works for newer 1601xxxxxx WiFi kit as used in the Omnik TL2 inverters.
  • Also works with iGEN Wi-Fi external loggers with s/n starting with 504xxxxxx

With wifi kits in the range 601xxxxxx it is not possible to get the data directly from the inverter. So sniffing the data send to the Omnik portal is required, see OmnikMQTT by wouterbaake .

Owners of a Wifi kit starting with s/n 402xxxxxxx should checkout Omnikol-PV-Logger by t3kpunk.

Installation and Setup

  • Install Python
  • Git clone the source with git clone https://github.com/XtheOne/Inverter-Data-Logger.git
  • Copy the config-org.cfg to config.cfg
  • Change the settings in config.cfg (See 'Configuration')
  • Test your settings with python LiveStats.py, when successful you should see data from your inverter.
  • Run the script with python InverterExport.py or better set a scheduled task or cronjob. (See 'Setting cronjob')

Configuration

To enable Domoticz support, enable the DomoticzOutput plugin in the config file. Then Create the following new hardware:

  • Name: Inverter Virtual
  • Type: Dummy (Does nothing, use for virtual switches only)
  • Data Timeout: Disabled

Now Create the following Virtual Sensors:

Identifier Sensor Type Name
Electric_meter_idx Electric (Instant + Counter) Actual Output Power (after creation, set 'Type:' to 'Return' and 'Energy read:' to 'From device')
PV1_voltage_idx Voltage DC Voltage PV1
PV2_voltage_idx Voltage DC Voltage PV2
PV1_current_idx Ampere (1 Phase) DC Current PV1
PV2_current_idx Ampere (1 Phase) DC Current PV2
AC1_voltage_idx Voltage AC Output Voltage
AC1_current_idx Ampere (1 Phase) AC Output Current
AC1_power_idx Usage (Electric) AC Output Power
AC1_frequency_idx Custom Sensor (Hertz) AC Frequency
--- Optional sensors ---
Temp_idx Temperature Temperature
H_total_idx Custom Sensor (Hours) Total run Hours
PV123_voltage_idx Ampere (3 Phase) DC Voltage PV1/2/3 (No 3 phase voltage device exists...)
PV123_current_idx Ampere (3 Phase) DC Current PV1/2/3
AC123_voltage_idx Ampere (3 Phase) AC 1/2/3 Output Voltage (No 3 phase voltage device exists...)
AC123_current_idx Ampere (3 Phase) AC 1/2/3 Output Current
AC123_power_idx Usage (Electric) AC Output Power (total for 3 phase inverter)
E_today_idx Custom Sensor (kWh) Energy today
E_total_idx Custom Sensor (kWh) Total Energy
E_total_c_idx Counter Energy production (after creation, set Type to 'Energy Generated')

Now go to Devices and fill the Idx of these virtual sensors into the config file. This is for a single phase inverter with 2 PV strings and basic values, more virtual sensors can be added for other identifiers.

Setting cronjob

For Linux/Unix

This crontab line with these options this will execute the script every minute.

  • crontab -e
  • Add row: * * * * * /usr/bin/python /home/username/Inverter-Data-Logger/InverterExport.py

For Windows

This scheduled task with these options this will execute the script every minute.

  • Start (or My Computer) -> Control Panel -> Scheduled Tasks -> Add Scheduled Task ->
    or
  • Start -> All Programs -> Administrative Tools -> Task Scheduler -> Action -> New Task ->
    • General (tab) ->
      • Name: InverterExport
      • Description: Attempt to fire up the solar inverter exporter.
      • Select 'Run whether user is logged on or not' and 'Do not store password.'
      • Select 'Run with highest privileges.'
    • Triggers (tab) -> New ->
      • Begin the task: 'On a schedule'
      • Settings: 'Daily' '00:00:00 AM'. Recur every: 1 days.
      • Repeat task every: '1 minutes' for a duration of: '1 day' (or 'Indefinitely')
      • 'Enabled'
      • -> OK.
    • Actions (tab) -> New ->
      • Action: 'Start a program'
      • Program/script: C:\Inverter-Data-Logger\InverterExport.py
      • -> OK.
    • Conditions (tab) ->
      • choose your own options.
    • Settings (tab) ->
      • 'Allow task to be run on demand'
      • 'Stop the task if it runs longer than: '2 days'
      • If the task is already running, then the following rule applies: 'Do not start a new instance'
      • -> OK

NOTE: If you need to kill the process manually: open Task Manager > Processes > Tick 'Show Processes from all users' > right click 'python.exe' > select 'End Process'.

Why copy config-org.cfg, can't I edit it directly?

Yes you can edit config-org.cfg directly. However, if you want to update the script your settings will be overwritten with the default values. By creating config.cfg, you can preserve your settings when upgrading.

Development

To help with development when no sun is present a small simulator script can be found in the folder Development. This script works by reading values from to database used by the MysqlOutput, but with the time shifted 6 hours back. To use the simulator, you should use the MysqlOutput to fill the database and configure database settings in de sim-config.cfg file.

inverter-data-logger's People

Contributors

aiolos avatar infern1 avatar novapax avatar phyxion avatar woutrrr avatar xtheone 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.