Enphase Envoy-S Per Panel Python Script Walkthrough

For the last seven years I have wanted to be able to see local near-realtime per inverter / solar panel production, but this was not possible without making trips across the Internet to the Enphase Enlighten service, or by making API requests to Enphase servers, or in a list format from the installer toolkit — that is until now!

This Information is All – Local!
Solar Production Screenshot

A few months back I upgraded my Enphase monitoring equipment to the Envoy-S. The new version of the Envoy provides a lot more JSON data. It also works with the very cool Enphase AC batteries.

Lots of folks have gone to extremes to try to capture per-panel information.  Some attempts even setup proxy servers and captured the network traffic.  Thankfully, at least for now, the new Envoy-S makes this data available locally.

I added a GitHub repository today for this Python script.  Of course the solar array layout is unique for each site, so the main purpose of this is to provide walk-through of how this can be accomplished in Python version 3, without making API calls to servers on the Internet and without the need for the excellent Enphase toolkit app.

This Python script was created to run on Python 3.5 on most operating systems.
It has been tested on Pythonista version 3 on the iPad as well.

The script writes out a plain HTML file named: envoy-production.html , then opens that html in the local Web browser.  Feedback is appreciated!

Once I had the script working on the desktop computer, it is very easy to get the script into the excellent Pythonista v3 app on the iPad and iPhone! The Pythonista Web server script makes it ridiculously easy to upload to the app.  That Web server can also be found on GitHub, it is named FileTransfer3.

You may be interested in some of the other Python scripts for the Envoy-S.  Here are links to those posts:

Enphase Envoy-S Eventlog Archiver

Back in January of 2017 I made a Python script available to archive the older (pill-style) Enphase Envoy event logs.

The newer Envoy-S has a different data structure that requires different JSON mechanics.   Events are saved with the name:  envoy-eventlog-yyyymmdd-hhmmss.csv (where yyyy is the four-digit year, mm is the two-digit month, and dd is the two-digit day, followed by the hhmmss timestamp).

Eventlog CSV File Loaded into LibreOffice Calc

I added a GitHub repository for this Envoy-S Python version 3 script today.

Running the Script
The very top line in the Python script will need to be changed to reflect the password to the target Envoy-S.

The script requires one argument when run, the IP address of the Envoy. In the following examples an address of for the Envoy is used.

Here is a sample command on Linux to run the script (notice Python3 and quotes):
Python3 save-events.py ‘’

On Windows the command to run this script is:
python save-events.py

The script enumerates any existing envoy-eventlog files that are in the same location as the script, then reads the last row in the last event log to find the last saved ‘Event ID.” The script will only save events that occur after that event id to prevent duplication of data.