virgilm / solarthing

Parses data from an Outback MATE, communicates with a Renogy Rover - MPPT Charge Controller, and uses CouchDB or InfluxDB as a database. Great with Grafana!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SolarThing

Parses data from an Outback MATE, communicates with a renogy rover, and uses CouchDB as a database!

Supported Products

  • Communicates with Outback MATEs 1/2 via the DB9 serial port. This supports receiving and parsing data from FX's, MX's and FM's
  • Communicates with Renogy Rover (And other Renogy products) over modbus serial.

Uses

  • Upload data to a database
  • Display data in Android Application
  • Display data in Web Application
  • Use as an API for your own uses!

Quickstart

Ready to install? Use the Quickstart!

Why should you use this?

This program supports communication with more solar products than any other open source program. The program was built to reliably store data in a database while running 24-7. You can customize this program to fit your needs without programming. But, if you are a programmer, this API will make your life a lot easier.

Out of the box, this supports lots of configuration options. These options include configuring CouchDB, InfluxDB and local json file exporting. There is currently three different ways to view the data that is stored in your database of choice.

Supported Databases

What This is currently used for

This program is run on a raspberry pi at Wild Mountain Farms. That program uploads packets to a CouchDB database on a separate computer which hosts the web portion found here: solarthing-web CouchDB is also used for solarthing-android. We also use InfluxDB to make using Grafana easy.

Displaying the Data!

SolarThing Android: Github | Google Play

alt text


SolarThing Web

alt text


If you decide to use InfluxDB, you can easily create your own Dashboard with Grafana. This is the most customizable!

alt text


Individual documentation

Solar readme

Using the program

You can see the Outback/Renogy Rover README for using the program with outback or renogy products.

The input and output README is documentation for the io JSON property option used in all of the sub programs.

Developer Use

You can import the most current release by using www.jitpack.io.

  • Useful for parsing JSON packets stored in CouchDB. solarthing-android uses this
  • You can parse Outback Mate packets directly
  • You can read and write to a Renogy Rover easily

Import it like this:

allprojects {
    repositories {
        maven { url 'https://www.jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.wildmountainfarms.solarthing:core:<CURRENT VERSION HERE>'
}

Compiling

Run ./compile_and_move.sh.

Database Setup

CouchDB setup
Used for the android and web application

InfluxDB setup
Used for Grafana

Configuration

This uses all JSON for configuring everything. The files you edit are all in one place unless you decide to move them.

See Quickstart to see how to set them up

TODO

  • Create Arduino or Java program to simulate MATE or Rover
  • Log CPU temperature, ram, etc into a database and logs.
    • Use the vcgencmd measure_temp available on Raspberry Pis
  • Add readable string alongside identifier tag for InfluxDB
  • Create a calendar program to be able to view daily kWH on a calendar interface
  • Have unique identifier for each jar file
  • AC Use->AC Drop, turn on AUX until NO AC. (GEN OFF) command using MATE's built in AC Use/Drop.

Completed TODO:

  • Provide option/configuration for multiple MATEs (maybe using multiple databases with an id at the end? i.e.: solarthing-1, solarthing-2 or commands-1, commands-2)
    • Done by using fragmented packets. Will be stored in the same database but uses InstancePackets to indicate source and fragment ids
  • Add field to MX Status Packet to indicate whether it supports dailyAH and field to indicate the version of the MX or if it is a FM
  • Create a PacketHandler that saves json data to a file location that can be easily accessed using a Apache web server
  • Add better logging with timestamps
  • Make Grafana easy to use by supporting InfluxDB as a database
  • Add a basic file for a systemd service
  • Stop requiring command line parameters and have option to use all JSON configs
  • Integrate power usage
  • Detect when Mate packets go from address 4->1 or 1->1 to detect a new collection of packets
    • This was done by just removing duplicate packets. Not ideal, but it works.
  • Save DailyFX data to a file so if the program restarts mid-day, accumulated data is not reset
  • Change command_feedback to something generic and use that database for "event"-like data
    • Also upload this to InfluxDB
  • Have packets for inverters going on/off, AC Drop/AC Use, Daily kWH->0, etc
    • We still need to do some of these

TODO Look into

TODO - Additions I'm not going to work on

These might be useful to some people. I will not implement these in the future, but pull requests are welcome!

  • Implement Outback FlexNet DC Packets
  • Create 'exporter' module which will have a Prometheus exporter that runs and gets data from CouchDB
    • This is not useful to me, but anyone else is welcome to do this

About

Parses data from an Outback MATE, communicates with a Renogy Rover - MPPT Charge Controller, and uses CouchDB or InfluxDB as a database. Great with Grafana!

License:MIT License


Languages

Language:Java 97.3%Language:Python 1.4%Language:Perl 0.7%Language:Shell 0.6%