Giter Site home page Giter Site logo

zeroerrors / solarmon Goto Github PK

View Code? Open in Web Editor NEW
39.0 10.0 14.0 2.07 MB

A simple Python Script for reading Growatt PV Inverter Modbus RS485 RTU Protocol and storing into InfluxDB

License: MIT License

Python 100.00%
growatt inverter influxdb python grafana

solarmon's Introduction

Solarmon

A simple Python Script for reading Growatt PV Inverter Modbus RS485 RTU Protocol and storing into InfluxDB

Protocol Documentation

How to use

  • Some hardware running a Linux based OS with Python 3 (eg. Raspberry Pi)
  • Connect your Linux based OS to the RS485 port on the inverter via a RS485 to USB cable
  • Install InfluxDB
  • Copy solarmon.cfg.example to solarmon.cfg and modify the config values to your setup as needed
  • Run pip install -r requirements.txt
  • Run python solarmon.py in a screen (or you could setup a service if that is your preference)
  • Install Grafana
  • Go to http://localhost:3000/dashboard/import or equivalent for where you installed Grafana and import grafana/dashboard.json

Inverter Grafana Dashboard

Reading from Multiple Units

To read from multiple units add a new section to the solarmon.cfg config with the unit's id and the measurement name to store the units data in influxdb

[inverters.<name>]
unit = <id>
measurement = <mesurement>

Example:

[inverters.unit2]
unit = 2
measurement = inverter2

To view the data using a Grafana dashboard simply import the template like described above in "How to use" and then change the measurement variable at the top of the page to match what you put in the config, in the example that is 'inverter2'.

Systemd Service

  • Copy solarmon.service to /etc/systemd/system
  • Modify the WorkingDirectory and User to suit your setup.
  • Run systemctl start solarmon to start the service.
  • Run systemctl status solarmon and ensure that the service is running correctly.
  • Run systemctl enable solarmon to make the service automatically start when the system does.

solarmon's People

Contributors

dependabot-preview[bot] avatar zeroerrors 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solarmon's Issues

SPF-5000TL -SyntaxError: invalid syntax and ModbusIOException: Modbus Error

Hi

I have got a growatt SPF-5000TL, I run the script on the Raspberry,

I receive a syntax error
File "solarmon.py", line 23
print('Setup InfluxDB Client... ', end='')
^
SyntaxError: invalid syntax

and when commenting out " print('Setup InfluxDB Client... ', end='')" and print('Setup Serial Connection... ', end='') I I can get past the error, but receive the following error, I have double check that the RS485A and RS485B pins are correct as per Growatt inverter as well that I can see /ttyUSB0 as the device to use.

Loading inverters...
Traceback (most recent call last):
File "solarmon.py", line 47, in
growatt = Growatt(client, name, unit)
File "/home/pi/solarmon/growatt.py", line 58, in init
self.read_info()
File "/home/pi/solarmon/growatt.py", line 63, in read_info
raise row
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)

Any assistance will be greatly appreciated.
Thanks Dawie

Add support for protocol v3.15 and multiple units

Hi,
Thank you for this software. I use it for some weeks now and works fine.

  1. The growatt protocol has been updated to v3.15 and now supports string voltage & current (registers 70-88) for newer inverters. This should be rather easy to implement in growatt.py but it also needs grafana dashbord update.
  2. Could you add support for multiple inverters (i.e. unit 1, unit 2 etc)?

Allow Write to register

It might be useful/dangerous to have a write to register option. I'm thinking here where you might want to change the operation mode based on Time-of-Use settings - i.e. set to battery when peak cost and then switch to grid priority when low cost

Typo

In growatt.py typo in errors
30: 'AV V Outrange',
should be
30: 'AC V Outrange',

Growatt SPF3000TL HVM 24v - can't get "solarmon" to work with

Hi!

I'm having issues getting "solarmon" to connect to my inverter. Have tried some other projects from github - https://github.com/Heleen/growatt-reader, and that one works. It seams to me that both projects uses same Python3 module - ModbusSerialClient.

As "solarmon" has the InfluxDB and Grafana integration, I'd like to further debug what's the issue here.

PVKeeper says that the CPU version is 503.08 - I guess that's the firmware.

What steps should I take to further debug the error?

(I think there's so output given saying error 5...)

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.