SCHibbard / enphase-dashboard

Powerwall-Dashboard add-on for enphase microinverter support
GNU General Public License v3.0
0 stars 0 forks source link

enphase-dashboard

Powerwall-Dashboard add-on for Enphase microinverter support

This project will supplement The Powerwall-Dashboard project by @jasoncox with support to gather production data from Enphase microinverters. With it, graphic details of a solar installation show individual output from each solar panel.

Screenshot from 2024-05-20 11-40-29

Requirements

Installation

Upgrading

To check what the newest version available is, and optionally upgrade to it, run ./upgrade-enphase.sh. This script was added in V0.6.0. If your version is earlier than V0.6.0, this file will need to be manually downloaded. E.g.:

cd ~/Powerwall-Dashboard
curl -sL --output upgrade-enphase.sh https://raw.githubusercontent.com/schibbard/enphase-dashboard/main/upgrade-enphase.sh
chmod 775 upgrade-enphase.sh
./upgrade-enphase.sh

Setup

Two programs are included, a setup script 'setup-enphase.sh' and a Python program 'enphase-canvas.py' The shell script will call the Python program, so you should only have to execute the shell script.

If you create canvas panels, the dashboard generated will include a time-series panel of all inverters' production in addition to the two canvas panels (as image above). If you do NOT create canvas panels, 'current-state-canvas-panel.json' is included in the repo. It can be installed as a dashboard in Grafana to display a time-series panel of microinverter production.

Grafana Versions

Powerwall-dashboard currently uses Grafana version 9. With version 10, Grafana introduced a new 'Canvas' panel, which is used to display the graphics of your solar array. If Powerwall is not running Grafana 10 or later, these graphic depictions will not work. The shell script will offer to upgrade to version 10 if you are not running it currently. Caveats:

During setup, if you are not running version 10, you be asked if you want to update to it. You will also be given the opportunity to upgrade to Version 11 to enable canvas panel infinite panning. If you are running, or upgrade to either 10 or 11, you will have the opportunity later to create Canvas panels for your solar array.

Creating Canvas Panels with enphase-canvas.py

enphase-canvas.py is a terminal-based program that will generate a Grafana dashboard of your array containing 3 panels as shown above:

The program is entirely text driven, showing crude representations of the solar array you build. It is suggested to run it in terminal full-screen mode, especially for larger solar arrays. The below instructions are based on the following panel array. This assumes 2 panel arrays, one on a house & one on a garage. The house array is 5 panels across and 3 panels down, the garage array is 1 across & 3 down. The house array (columns 1-5) has two areas where no solar panels are mounted, the top two areas in column 4 (R01C04 and R02C04). Column 7 is the garage array. Column 6 is used to display a gap between the house and the garage.

----R01C01------R01C02------R01C03------R01C04------R01C05------R01C06------R01C07---
|  Panel001 |  Panel002 |  Panel003 |           |  Panel004 |           |  Panel005 |
|           |           |           |           |           |           |           |
----R02C01------R02C02------R02C03------R02C04------R02C05------R02C06------R02C07---
|  Panel006 |  Panel007 |  Panel008 |           |  Panel009 |           |  Panel010 |
|           |           |           |           |           |           |           |
----R03C01------R03C02------R03C03------R03C04------R03C05------R03C06------R03C07---
|  Panel011 |  Panel012 |  Panel013 |  Panel014 |  Panel015 |           |  Panel016 |
|           |           |           |           |           |           |           |
-------------------------------------------------------------------------------------
  1. When the program starts, it will query your Enphase gateway to get an inventory of all solar panels and their serial numbers.
  2. Enter the height (number of rows, 3 in above example), and width (number of columns, 7 in example, to get the gap between house & garage).
  3. a graphical depiction of your choice will be displayed to confirm.
  4. Each panel is numbered. These numbers will be displayed on all dashboard panels (see images). Default behavior in Grafana would display the serial numbers, but a) they are not intuitive, and b) they are 12 digits long. Therefore, this program aliases each inverter with a reference number, as well as a color code. Default is to number them from left to right, top to bottom. If you would rather have for example the house & garage grouped, you can select custom panel numbering.
  5. The program will then request the serial number of each microinverter in their appropriate position on the array. This is where you need the microinverter mapping information mentioned in the requirements. If a location is not used, enter 0. If you have also selected custom panel numbering, this will also be entered at this time.
  6. After all serial numbers are entered, the above depiction will be re-drawn, but with the serial numbers and panel numbers selected filled in. If the array is too large to show the complete serial numbers, they will be shortened to show only the last few digits.
  7. You can choose now to edit the diagram if mistakes were made, save the array for future work, or approve it and generate a dashboard JSON. Note when editing panels, the program will not allow a serial number to be used in two places, so either swap, or edit to a blank location first.
  8. Once the JSON is created you can import it into Grafana.

Notes:

  1. In the unlikely event you choose to not show all of your inverters in the canvas panels, the time-series panel will still show all connected inverters.
  2. Canvas visualization support in Grafana is evolving. Currently it does a poor job of scaling. I notice this on mobile devices. A few revs into Grafana 10 support for "pan and Zoom" for Canvas was added, which is activated by the install script, however it still needs work at Grafana!
  3. I added titles to my Canvas Panels for 'House' & Garage', as well as a separator between them. They can be seen at https://github.com/jasonacox/Powerwall-Dashboard/discussions/467. Such customization is not included in the auto-generation yet, but you can manually add them!
  4. When the generated JSON is loaded, it creates Grafana library panels for each of the three panels generated. The good news is this enables easily loading them into other dashboards you have. The bad news is if you make changes in the panel configuration and generate a new JSON, you will have to delete the old panels in Grafana's library, or the changes will not be taken. You can only delete a library panel if it is not used in any dashboard, so you must delete them from the dashboards first. This can be improved by generating unique UUIDs for the library panels, that's on the to-do list.
  5. Note when the script installs Grafana 10, it does not delete Grafana 9 from Docker. The image will be there, just not running. Doesn't hurt anything, but you can delete it via the Docker CLI if you wish.

Final Notes

I am a newbie with Python. I programmed in assembler, C, Pascal, and other ancient languages between the late '70s and mid '80s before a hiatus of about 35 years. I know the Python here is very far from Pythonic! While I plan to improve that, constructive criticism or edits are welcome!