Thanks, Philip! Very cool!
I had a bit of trouble getting up and running (mainly because of Enphase' terse instructions), so here are some tips for other trying to get this to work:
You wrote:
Philip said:
Sign up for an enlighten API key
To do this, go to the
Enphase Developer website and click the "Register" hotlink at the upper right. On the page that appears, I used an alias as the "Organization Name" and forewent all fields which were not required. Once you click "Register" on this page, you will receive an email entitled "Account Activation for developer.enphase.com" which contains a link you must click to activate the account.
So far, so good...
Philip said:
Edit the file fill in the var’s at the top of the script with your API key, User Id, System Id,...
This is where things start to get tricky. You need these three values, but where do they come from? Actually, they come from various places:
API key:
To find this, go
the Applications tab of your Enphase developer webpage and click on the name of your default application. (If you do not have a default application, you need to select a plan. I used the "Watt" plan.) You will find the API key right on that page.
User Id
To find this value, you need to log into
Enlighten. Once logged in, click "My Account" at the very top right of the page and open "Enlighten Settings". Scroll to the bottom of that page and you will find your User Id there.
System Id
To find this value, go back to the Enlighten webpage and click the "System" tab at the top of the page. Then read the URL and the System Id is the numbers immediately following "https://enlighten.enphaseenergy.com/systems/".
Great! Now you have all the values to put into the script so that you can save it as an html and run it. Unfortunately, it still does not work! There are a couple more steps you need to complete to have success:
- First, enable API access to your system. To do this, go to your system's Enlighten webpage which you just logged into and click the tab with a picture of a gear on it. Scroll down to the "Privacy Settings" block and and put a checkmark in the box next to "Enable API access to my system data" and click "Save". Verify this step by going back to the top of the page and clicking "My Account" at the very top right of the page and open "Enlighten Settings". Scroll to the bottom of that page and click the link which says "Show systems that allow API access > >."
- Second, you will need to give your default application in the developer console API access to your account. If you click the "Show applications which have API access > >" link which is just above the one you clicked in the previous step it should read "You haven't granted access to any applications." To resolve that, go back to the webpage for your default application, which is found under
the Applications tab of your Enphase developer webpage. Click the name of your default application to get to your application page. At the bottom of this page you will find the following text:
developer.enphase.com said:
Authorization URL
https://enlighten.enphaseenergy.com/app_user_auth/new?app_id=XXXXXXXXXXXXX Include this in your application so that Enlighten users can authorize your application to make API requests on their behalf.
This confused me, since there was no such statement included in the script provided by Philip. Further, the link provided is NOT clickable. Ultimately, you need to open a new tab in your browser and then paste that link into that page and hit the "Enter" key. You will get a webpage which says: "Allow the application 'Organization's App' to access your system data?" Click "Yes, allow access" to enable access. FWIW, it shows you your User Id when you do this. Finally, to verify you have access, go back to Enlighten and if you are still in the "Enlighten Settings" page, click the "System" tab and then get back into "Enlighten Settings" (under "My Account") and click the ""Show applications which have API access > >" link and it should now list "Organization's App".
Once you have done all of the above, you should then be able to open the *.html file which you created and successfully run the script Philip has provided.
Since I do not have TOU metering here, this application is not particularly useful to me. I have always wanted to be able to look at the production of the different subarrays separately since they do not point in the same directions. Unfortunately, I do not see an API access function which will allow me to accomplish that. Does anyone see a way to get production information from less than the full system?