Giter Club home page Giter Club logo

solar-sungrow's Introduction

Sungrow Monitor

A python 2.7 script to allow direct monitoring of sungrow inverters over LAN TCP modbus connections and upload the averaged observations for a specified interval to pvoutput.org

Based on a cut down version of Meltaxa's solarIoT script please check out their work if you are interested in a full on prememsis solution.

The modbus map was generated from the official sungrow modbus specification and contains many commented out registers. These are present simply as a register index to make it easier for anyone else that is looking for the information to get ahold of it as it was not openly avialble when I began this project. Only active power is required for the upload to pvoutput.

A docker container is available at thomasfa18/solar-sungrow for a click and run solution.

Getting Started - DIY

  • Clone the repository to a directory eg ./app
  • Install python 2.7 and pip
    • apt-get update && apt-get -y install curl python python-pip
  • Install the required python modules
    • pip install --trusted-host pypi.python.org -r requirements.txt
  • Create a config.py that matches your environment in the same directory as the sungrow_monitor.py script
  • Run the script, it will spit out messages to stdout every scan interval
    • python sungrow_monitor.py

Getting Started - Docker

  • Configure a directory for the config file [config.py] and modbus map if you have a custom one [modbus-.py]
  • Create a config.py based off the example that matches your environment and place it in the config directory
    • docker pull thomasfa18/solar-sungrow
  • Download the docker image
  • Run the docker image with the volume switch to mount your config directory as /config in the image
    • docker run -v <localpath>:/config thomasfa18/solar-sungrow

Standard Disclaimer

All Content on this site is provided "as is" without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose, or the warranty of non-infringement. Without limiting the foregoing, the developer makes no warranty that (i) the services and Content will meet your requirements, (ii) the services and Content will be uninterrupted, timely, secure, or error-free, (iii) the results that may be obtained from the use of the service or Content will be effective, accurate or reliable, (iv) the quality of any products, services, or information purchased or obtained by you from the site will meet your expectations, and (v) any errors in the software obtained from the site will be corrected.

This site could include technical or other errors, inaccuracies or typographical errors. "The Developer" may make changes to the Content and Services at this site, including the prices and descriptions of any products or Services listed herein, at any time without notice. The Content or Services at this site may be out of date, and "The Developer" makes no commitment to update such Content or Services. "The Developer" assumes no responsibility for errors or omissions in the information, documents, software, Content and/or services which are referenced by or linked to this site. References to other corporations, their services and products, are provided "as is" without warranty of any kind, either express or implied.

In no event shall "The Developer" be liable to you or any third party for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, including, without limitation, those resulting from loss of use, data or profits, whether or not "The Developer" has been advised of the possibility of such damages, and on any theory of liability, arising out of or in connection with the use of this site or of any web site referenced or linked to from this site. Some jurisdictions prohibit the exclusion or limitation of liability for consequential or incidental damages, so the above limitations may not apply to you.

The downloading or other acquisition of any Content through the site is done at your own discretion and risk and with your agreement that you will be solely responsible for any damage to your computer system or loss of data that results from the downloading or acquisition of any such Content. No advice or information, whether oral or written, obtained by you from "The Developer" or through or from the site shall create any warranty not expressly stated in the terms of use.

  • This has been tested on a a sungrow SG5K-D inverter only
  • A list of "valid devices" is included at the top of the modbus map, this came from the sungrow modbus specification document directly. It may work with other devices, I do not know.
  • The script only performs reads of the input registers (function code 04), if you do not know anything about modbus I would highly dicourage you from making changes.
  • In short, you are welcome to use this, but if you do you are agreeing that if something bad happens then it was not my fault and you can't sue me.

solar-sungrow's People

Contributors

thomasfa18 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

solar-sungrow's Issues

Modbus Map?

Hi thomasfa18,

I'm wanting to write my own application in C#. I note that you mentioned that you had the official modbus map and was wanting to know if I could get a copy? In particular, I'm after values up around the 13,000's to be able to monitor my hybrid inverter.

I've seen Meltaxa's list over at SolarIoT, but was hoping to try to get a more inclusive list of the registers up around where the battery details are stored.

Thanks,
Chris.

Updates for current pymodbus api

I really should upload the various improvements to this I've made for my sh5K_30, but for now, I've just had to rebuild my pi, and discovered this code doesn't work with the latest pymodbus library. SO to make life eay for others - 'unit=' should be replaced with 'slave=' and "from pymodbus.client.sync import ModbusTcpClient" should be replaced with "from pymodbus.client import ModbusTcpClient"

Then it seems to work well again (though as I said my script is heavily changed to force battery charging to fill the battry from main by just before peak pricing if solar isn't going to achieve such) - Absolute fan of this thank you!.

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.