Aug
5
2017

On line Python Courses for the 2017 Fall Semester

Python Programming Language
Interested in learning the latest version of the Python programming language?

While my face-to-face classes are full, there are seats open in the fully on line version of the class: CIS-115-221N at Rowan-Cabarrus Community College. I spent a year redesigning the class to use a free textbook.

This fun and very useful course introduces students to the very powerful Python version 3 programming language that can be used to accomplish almost anything from creating games, robotics, and even rocket control! In addition to the basics, we cover encryption, digital photo processing and much more.

Check out some of my Python programs at: https://github.com/ken-clifton

Jun
11
2017

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:

Jun
11
2017

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 192.168.1.100 for the Envoy is used.

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

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

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.

Jun
7
2017

Envoy-S Local Solar Inverter Inventory and Status

I added a GitHub repository this morning for this Python script.

The purpose of this script is to retrieve inventory and inverter status information locally without traversing the Internet, or the need for the Enphase installer toolkit.

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-inventory.html , then opens that html in the local Web browser.  Feedback is appreciated!

The easiest way to use this on the iPad and iPhone is with Pythonista version 3 and the Pythonista Web server that allows easy uploads of scripts to the iOS.  The FileTransfer Web server is only used to get the script on to the iPad, so it is really only needed one time.  That Web server can also be found on GitHub, it is named FileTransfer.

Here is a sample screenshot (with inverter serial numbers redacted):
Script Output: Envoy-S Local Inventory and Status

May
19
2017

Welcome!

Welcome to Ken Clifton’s blog.

If you are a student you will be most interested in the “teaching” category content. Please feel free to explore the “About” and “Resume/CV” links at top of this page.  If you are interested in RECs please see the renewable energy credits link.  The Salisbury Post did a front page story on our solar PV facilities that ran on February 8, 2011.

We are excited about renewable energy! This site is run on solar generated electricity.  We have solar PV and solar thermal renewable energy facilities approved by the State of North Carolina at our home.    See the renewable energy link for more information. If you are interested in biomass or CO2 neutral home heating, please read the Salisbury Post newspaper article published on February 11, 2007 for more information.  My presentation made to several groups on biomass is also available.

If you are a student, I look forward to working with you during the Summer 2017 semester at RCCC!  I am teaching one class on line during the summer. In the fall I expect to be teaching three Python programming classes, two at the RCCC CBTC Campus and one on line.

Please consider becoming an organ donor.  I have vision to maintain this site and work thanks to two corneal transplants.  Without those transplants I would be blind.

Jan
1
2017

Saving / Archiving the Enphase Envoy Event Log

Enphase Envoy EMU

The Enphase Envoy (EMU) uploads data from their solar micro-inverters to the Enphase Enlighten cloud service.  Only a few major events are available to users through the Enlighten cloud service.  A complete history of the last 500 events are available locally on the Envoy.   Five hundred events can be overwritten by pretty quickly!  This means that information over a day or two old cannot be retrieved by mere mortals, except possibly by Enphase technical support staff.

I created this Python script to archive events as comma-delimited (.csv) files to the folder where the script is stored.  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).

Archived Event Logs in a folder

I chose this naming convention to allow sorting of the event log files.  The .csv files open into nicely formatted columns with named headings in Libre Office Calc or Microsoft Excel.

Running the Script

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

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

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

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.

I suggest scheduling the script to run at least once or twice per day to archive events from the Envoy.  On Linux a cron table entry, or a scheduled task on Windows can easily be used automate the process.

Download

latest version of the script here (zip archive)

Requirements to Run this Script

I have tested this script on Linux and Windows 7, 8 and 10 with Python version 3.43
The script should also work on a Mac as long as Python 3.1 or greater is installed — remember that both Linux and Macs mostly come with the older version of Python, something like Python version 2.7, so you will not have the other version of Python unless you install it.   Remember this script requires Python version 3.1 or higher  to work!  No additional libraries are required.

I do not have an Envoy-S.  My two solar sites have the older version of the Envoy running software R3.12.34 (2e8bfe).  It would be interesting for someone with a later Envoy-S to comment here to let me know if the script works with those units.

Challenges Getting this to Work

Several helpful Internet postings have mentioned that the events are available as JSON data at http://[envoy ip address]//datatab/event_dt.rb

Well, the true answer is yes and no…  On my Envoy, using Firefox or Python’s urllib, I can retrieve this file, but it never updates.  The information is only refreshed when the actual eventlog page on Envoy is retrieved.  This is in spite of reviewing the actual requests made when the eventlog page is visited in a browser and implementing every single request parameter.

After many hours of testing, and changing parameters, I finally just decided to fake an actual request for the eventlog page prior to retrieving the JSON data table.  This solved the refreshing of the data, although it is not as clean as I would prefer.

Free to Use or Modify with Attribution of the Author

Use the script as you see fit.  Any recognition for my time spent developing this is appreciated. Please let me know if you modify the script so that I can implement fixes.   Please consider becoming an organ donor.   I am able to create this script thanks to eyes donated by the kindness of two families that I may never know.

Aug
8
2015

Video with Dr. Parker at UAB


So fortunate to be helped by Dr. John Parker. I give thanks every day for the gift of vision and for the skill and kindness of Dr. Parker. I think of my eye donors every day. Please remember to become an organ / eye donor to help so many others.

Jun
30
2015

Energy United & Advanced Energy – EV Workshop Presentation

On June 5, 2015 I spoke at the Energy United / Advanced Energy Electric Vehicle Workshop about my family’s experience of driving electric for the past 3 years.  The workshop was great, there was a BMW i3, a Tesla Model S, my Volt, an electric dune buggy, and an electric bicycle.

June 5, 2015 Presentation

Download a copy of the presentation to view the slides. In short it has been a very rewarding three years. We had the first Nissan LEAF in Western North Carolina, delivered in November of 2011. Our first charging station was provided by Duke Energy as part of their Charge Carolina’s EV Charging Station pilot. The charging station is still being used every day.

My wife and I both traded our LEAFs in on Chevrolet Volts in 2013. I very much wish we had started out with the Volts. Having said that, we appreciate them much more coming from the LEAF experience.

Since the last upgrade to our solar PV, we are able to charge both cars and run the house pretty much offset by solar energy. In fact, during the month of May 2015 we produced 48 kWh more than we used to run the house and two cars.

Mar
22
2015

March is National Eye Donor Month!

March 2015: National Eye Donor Month

 

 

 

 

 

 

As a recipient of two corneal transplants I think of my donors every day. Please consider becoming a donor to give the gift of sight to someone.
I would be blind and unable to maintain this site without such an unconditional act of love by two people and their families.
You can read my story of two corneal transplants on this site at: http://www.kenclifton.com/wordpress/my-vision/through-the-eyes-of-others/

Jan
26
2015

NC Renewable Energy Credits Available for Solar Set-Aside

NC Renewable Energy Credits Available for the Solar Set-Aside

We have two Renewable Energy Facilities registered in the NC-RETS Renewable Energy Portfolio Tracking System.  Both facilities are located inside North Carolina and produce power from certified and calibrated metered systems.  I will consider selling solar PV and metered solar thermal RECs to North Carolina Power Companies, Co-Ops or municipalities who are also registered in the NC-RETS system.

Follow this link ( https://portal2.ncrets.org/myModule/rpt/myrpt.asp?r=204 ) to see a current listing of the NC-RETS Bulletin board, currently about 25 RECs are available for transfer / sale.  Look for facilities GEN259 and GEN266 .