JJanssen123 / sunmaster2mqtt

Python script for reading Mastervolt Sunmaster solar inverter data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sunmaster2mqtt

Python script for reading Mastervolt Sunmaster solar inverter data and publish data as mqtt messages.

To use this script you need a RS485 to TCP converter like this (ethernet) or this (wifi). Put the ip-address of this converter in settings.py.

Connect the RS485 output of the inverter to the TCP converter using a RJ45 connector, for instance a cut in half network cable. Connect wire 4 (568B-blue) to A and wire 3 (568B-green/white) to B. Do NOT use the Masterbus connection of the inverter. You can connect more than one inverter by looping them through. The script is confirmed to work for three inverters with thanks to Nico Viersen.

You will need the Eclipse Paho MQTT Python client library, use pip for installation: pip3 install paho-mqtt

The script returns the current running values of each connected inverter. Once per day it collects the last 30 daily production amounts. All values are sent as mqtt messages to your mqtt broker. In settings.py you can set the brokers address, the topic and some other mqtt stuff.

The script is meant to run every minute (or 5) as a cronjob e.g.

* * * * * /usr/bin/python3 /home/pi/sunmaster2mqtt/sunmaster2mqtt.py > /home/pi/sunmaster2mqtt/cronlog.txt

Be careful running it every minute when you have more than one inverter; getting the 30 day production numbers takes about 40 seconds per inverter.

If you don't want to use mqtt, there's a Home Assistant integration by Robin Kolk based on this script.

About

Python script for reading Mastervolt Sunmaster solar inverter data

License:GNU General Public License v3.0


Languages

Language:Python 100.0%