7. June 2016
Monitor SMA Sunny Boy Inverter via Modbus

Our Photovoltaik installation is powered by a SMA solar inverter, which provides the Modbus protocol for monitoring installation parameters.

SMA provides for this device (and other devices with Modbus) tables with information at which address which information resides.

For Python there is the Modbus library ‘pymodbus’.

With some tinkering I made a Python application, which can be used with a graphical interface or via command line (without graphical interface).

The application can display multiple current values in the graphical interface or via the command line a single value directly.

Also you can specify a log file where values can be stored in configurable intervals and configurable save interval to disk.

For long time monitoring I configured a Raspberry-Pi 3 with Raspbian to run in my network. The Raspberry collects then regularly data from the inverter. The Raspberry is only supplied by a 5 V power supply and is administred via WLAN.

For Raspbian I needed just a few preparations:

  • configure WLAN connection as default connection and automatic connection
  • install the Raspbian package python-dev (sudo aptitude install python-dev)
  • install the Python package pymodbus (sudo pip install pymodbus)
  • install the Python package docopt (sudo pip install docopt)

After this the script can be run with “python pymodmon.py -i Configfile.ini”.

The config file can be easily generated by running the skript in the graphical mode via “python pymodmon.py” in a xterm and then adding the desired addresses and settings. In the graphical mode can then be tested if the addresses are available. When all settings are set as desired the config file can be saved and is then usable in the command line mode.

The config file also allows for setting the log file. If this does not exist it will be generated. If it exists new data will be appended to it.

You can find the python script on github.com: https://github.com/transistorgrab/PyModMon

pymodmon_screenshot



1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
© 2006 — 2016 Transistorgrab.de


Keine Kommentare »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

This blog is kept spam free by WP-SpamFree.