solariot

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

https://github.com/meltaxa/solariot

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.6%) to scientific vocabulary

Keywords

dashboard dweet freeboard influxdb iot modbus-sungrow pvoutput solar-energy sungrow-inverter telemetry
Last synced: 6 months ago · JSON representation

Repository

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

Basic Info
  • Host: GitHub
  • Owner: meltaxa
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage: https://solariot.live
  • Size: 5.16 MB
Statistics
  • Stars: 221
  • Watchers: 17
  • Forks: 75
  • Open Issues: 17
  • Releases: 0
Topics
dashboard dweet freeboard influxdb iot modbus-sungrow pvoutput solar-energy sungrow-inverter telemetry
Created over 8 years ago · Last pushed 6 months ago
Metadata Files
Readme Funding License

README.md

Solariot

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 dweet.io, MQTT, InfluxDB or PVOutput. To visualise the telemetry, use a dashboard such as Grafana. For example, this is Meltaxa's Grafana dashboard on solariot.live:

<!--- Github will by default use it's Camo CDN to cache images (https://github.blog/2014-01-28-proxying-user-images/). To override this, on the origin web server add the header Cache-Control no-cache. Also if you are using Cloudflare set the Browser Cache TTL to respect existing headers. The solarspy-live.png image is a Puppeteer screenshot and updated every 5 minutes displaying the energy usage at Meltaxa's home. --->

Pre-requisites

  • 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+.

Installation

  1. Download or clone this repository to your local workstation. git clone https://github.com/meltaxa/solariot.git cd solariot

  2. Install the required libraries. pip install --upgrade -r requirements.txt

  3. Update the config.py 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 solariot.py script. ./solariot.py

    • Command line options: -c Python module to load as our config. Default is config.py. -v Level of verbosity 0=ERROR 1=INFO 2=DEBUG. --one-shot Run Solariot just once then exit. ## Docker
  5. Create a directory for the config file [config.py].

  6. Create a config.py (see config-example.py) and place it in the config directory.

  7. 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.

bash 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.

Dweet.io and Freeboard

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

Metrics are streamed to dweet.io 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 config.py file.

Data can then be visualised using a ~~free~~ low-cost dashboard service from Freeboard. You'll need to create your own dashboard, using dweet.io 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 config.py 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 solarspy.live 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 config.py 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 scrape_configs: - job_name: 'solariot' scrape_interval: 30s static_configs: - targets: ['localhost:8000']

alternatively if your using Kubernetes you can use this helm chart

PVOutput.org

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 config.py file and you'll be publishing in no time!

Integration with PVOutput.org 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: http://docs.grafana.org/reference/sharing/#direct-link-rendered-image.

  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 https://goo.gl). 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.

:bulb: Tip: You can add any URL image, such as the latest weather radar image :wink:

Contributions

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

Acknowledgements

  • 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.

Owner

  • Name: Dennis Mellican
  • Login: meltaxa
  • Kind: user
  • Location: Brisbane, Australia

DevOps Consultant

GitHub Events

Total
  • Issues event: 2
  • Watch event: 15
  • Issue comment event: 2
  • Push event: 1
  • Pull request review event: 1
  • Pull request event: 3
  • Fork event: 7
Last Year
  • Issues event: 2
  • Watch event: 15
  • Issue comment event: 2
  • Push event: 1
  • Pull request review event: 1
  • Pull request event: 3
  • Fork event: 7

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 125
  • Total Committers: 15
  • Avg Commits per committer: 8.333
  • Development Distribution Score (DDS): 0.632
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Dennis Mellican m****a@g****m 46
Michael Robbins m****s@x****m 25
vagrant v****t@v****m 14
Ubuntu u****u@i****l 12
slackerlinux85 8****5 7
Dean Pemberton d****n@c****z 4
Nathan Pickworth n****n@m****e 3
Ben Reedy b****8@b****m 3
rark-ha 6****a 2
bohdan-s b****s 2
ShaneH s****y@g****m 2
Abilio Henrique a****n@z****m 2
Antony Puckey a****y@r****m 1
scottah s****h@g****m 1
chainsawbike c****e@g****m 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 47
  • Total pull requests: 40
  • Average time to close issues: 2 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 37
  • Total pull request authors: 16
  • Average comments per issue: 4.72
  • Average comments per pull request: 1.23
  • Merged pull requests: 24
  • Bot issues: 0
  • Bot pull requests: 11
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • meltaxa (4)
  • shannondpasto (4)
  • michael-robbins (3)
  • bdog720 (2)
  • rark-ha (2)
  • crazycusti (1)
  • satyr-software (1)
  • eimann (1)
  • flare04 (1)
  • shannonpasto (1)
  • kaba72 (1)
  • Flynsarmy (1)
  • knights1 (1)
  • MeldrumIO (1)
  • brettbeeson (1)
Pull Request Authors
  • dependabot[bot] (11)
  • michael-robbins (10)
  • breed808 (3)
  • slackerlinux85 (3)
  • xrobau (2)
  • nmors (2)
  • bohdan-s (2)
  • andycapx (1)
  • bartha-adam (1)
  • ShogunQld (1)
  • zyrorl (1)
  • chainsawbike (1)
  • scottah (1)
  • apuckey (1)
  • rark-ha (1)
Top Labels
Issue Labels
enhancement (5) help wanted (1) bug (1)
Pull Request Labels
dependencies (11) enhancement (1)

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v1 composite
  • crazy-max/ghaction-docker-buildx v1 composite
Dockerfile docker
  • python 3.9-alpine build
requirements.txt pypi
  • SungrowModbusTcpClient >=0.1.5
  • SungrowModbusWebClient >=0.2.4
  • dweepy >=0.3.0
  • influxdb >=5.3.1
  • paho-mqtt >=1.5.1
  • prometheus-client >=0.9
  • pymodbus ==2.5.3