meltaxa / solariot

Leverage your IoT enabled Solar PV Inverter to stream your solar energy usage data to a real time dashboard.

Home Page:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Leverage your IoT enabled Solar PV Inverter to stream your solar energy usage data to a real time dashboard.

Solariot will connect directly to your Inverter using Modbus TCP.

Currently, Solariot is able to talk to a SMA Sunny Boy and Sungrow SH5K & SG5KD inverters. Solariot is designed to allow any Modbus TCP enabled inverter to be queried using a Modbus register map.

Data is collected and can be streamed to destinations like, MQTT, InfluxDB or PVOutput. To visualise the telemetry, use a dashboard such as Grafana. For example, this is Meltaxa's Grafana dashboard on


  • The Inverter must be accessible on the network using TCP.

  • This Python script should work on most Inverters that talk Modbus TCP. You can customise your own modbus register file.

  • Run on Python 3.5+.


  1. Download or clone this repository to your local workstation.

    git clone
    cd solariot
  2. Install the required libraries.

    pip install --upgrade -r requirements.txt
  3. Update the with your values, such as the Inverter's IP address, port, inverter model (which corresponds to the modbus register file) and the register addresses Solariot should scan from. Enable optional support for MQTT, PVOutput, InfluxDB and more.

  4. Run the script.

    • Command line options:
    -c             Python module to load as our config. Default is
    -v             Level of verbosity 0=ERROR 1=INFO 2=DEBUG.
    --one-shot     Run Solariot just once then exit.


  1. Create a directory for the config file [].

  2. Create a (see and place it in the config directory.

  3. Run the Docker image with the volume switch to mount your config directory as /config in the image

    • docker run -v <localpath>:/config meltaxa/solariot

Note that the container runs as UID/GID 2000, so mounted config files will need to be readable. E.G.

chgrp 2000 $FILE # Set group of file to 2000
chown g+r $FILE # Allow group 2000 to read file

Next Steps

Now that you are collecting the inverter's data, you'll want to ultimately display it in a dashboard as seen above.

There are many methods to stream the data. Here are a few options, which can be enabled in Solariot. and Freeboard

This is the quickest method and is a good place to start.

Metrics are streamed to a free IoT messaging service. No sign up is required. All you need to do is create a unique identifier by updating the dweepy_uuid value in the file.

Data can then be visualised using a free low-cost dashboard service from Freeboard. You'll need to create your own dashboard, using as your data source.

MQTT Support

This is a good way to push data to MQTT topics that you might subscribe various tools such as Node-Red or Home Assistant to. Running your own MQTT server will mean you can also retrieve these values when your internet is offline.

All you need to do is to set the mqtt_server, mqtt_port, mqtt_username, mqtt_password and mqtt_topic values in file and you'll be up and running.

InfluxDB and Grafana

Use a time series database such as InfluxDB to store the inverter data as it streams in. You'll need to install this on your own server.

To display the data in real time dashboard, you can use Grafana to pull the metrics from InfluxDB. You can either install your own Grafana server or use their free Grafana hosted solution.

A json export of Grafana dashboard is available under the grafana folder. The file will require editing to match your InfluxDb settings.

Prometheus and Grafana

Prometheus can be enabled in by setting prometheus to true. the data will then be exported on the port specified by prometheus_port (defaults to 8000).

you can configure Prometheus to scrape this by adding a rule like this to your prometheus.yml

  - job_name: 'solariot'
    scrape_interval: 30s
      - targets: ['localhost:8000']

alternatively if your using Kubernetes you can use this helm chart

We offer direct integration to publishing metrics to the 'Add Status' API endpoint of PVOutput.

Supported values are v1 through to v6 and an assumption that v1 and v3 are values are incremental and reset every day.

All you need to do is set the pvoutput_api, pvoutput_sid and pvoutput_rate_limit values in file and you'll be publishing in no time!

Integration with and Grafana

If you are using Grafana as your dashboard, a neat little trick is to then incorporate your Grafana panels with your PVOutput as system photos. From your PV Ladder page, click on your photos to view the real time Grafana images:

alt tag

  1. Obtain your Grafana panel direct link, see their documentation:

  2. In your PVOutput "Edit System" page, add your Grafana panel link in the "Image Link" field. Append "&png" to the link. Note, if the URL is longer than 100 characters, use a URL shortener service instead (such as Don't forget to append the "&png" string to your URL.

  3. Now go to your system in the PV Ladder page and click on the photos.

💡 Tip: You can add any URL image, such as the latest weather radar image 😉


If you have created a modbus register map for an inverter, please submit your file as a pull request for Solariot inclusion.


  • michael-robbins for Docker support, modbus contrib and other improvements.
  • rpvelloso for the SungrowModbusTcpClient class that enables decryption of comms.
  • shannonpasto for the Sungrow SG3KD modbus map.
  • ShogunQld for the SMA Sunnuyboy modbus map.
  • zyrorl for MQTT support contrib.


Leverage your IoT enabled Solar PV Inverter to stream your solar energy usage data to a real time dashboard.

License:MIT License


Language:Python 94.3%Language:JavaScript 5.2%Language:Dockerfile 0.5%