The Vera Community forums have moved!

General => Power Management => Topic started by: rearden on July 05, 2012, 02:20:13 pm

Title: Enphase power monitoring
Post by: rearden on July 05, 2012, 02:20:13 pm
Has anyone looked at using the vera to read output from the Enphase Envoy Communications gateway grid tie solar monitoring system or the information directly from the enphase m215 inverter?

rearden
Title: Re: Enphase power monitoring
Post by: elordude on July 20, 2012, 07:04:48 pm
I created a plugin that reads the data from Enlighten website as well and Envoy unit (local network) I can monitor production using datamine plug in -

regards
harry
Title: Re: Enphase power monitoring
Post by: kkl on July 20, 2012, 08:26:10 pm
That's great.  Are you willing to share the details?
Title: Re: Enphase power monitoring
Post by: Jacob on August 19, 2012, 06:06:14 am
Harry,
Ordered a set of solarpanels with the enphase micro inverters
I would like to follow it's performance via the datamine plug-in
Would you like to share or publish your plug-in?
Regards,
Jacob
Title: Re: Enphase power monitoring
Post by: Peter on October 09, 2012, 11:45:09 am
I get a Enphase system as well, I will monitor 8 Solar panels .
Is the plugin anywhere available?
Title: Re: Enphase power monitoring
Post by: strangely on October 25, 2012, 12:22:10 am
+1 for this, since I just ordered a system based on Enphase micro-inverters.
Title: Re: Enphase power monitoring
Post by: Fitzy on October 26, 2012, 12:05:47 am
I'd be keen to jump on board also :-)

I have an Aurora Inverter with an Aurora Easy Control (connected via the local network) to monitor the performance / generation totals etc. It is all web based and I have been looking for a way to integrate this with Vera to allow me to view the performance when I'm not connected to my home network and have everything through once system.

Unfortunately I'm already using port forwarding on my router for a weather station and it won't allow me to use HTTP port forwarding to a different port (don't know why).

Are you willing to share? :-)
Title: Re: Enphase power monitoring
Post by: strangely on October 26, 2012, 10:19:54 am
Looks like @elordude hasn't been active on the forum since July :(

I'm going to send him a PM for the small chance he would read it.
Title: Re: Enphase power monitoring
Post by: rearden on November 19, 2012, 02:56:47 pm
did you ever get a response from elorddude?  My panels are almost up and I would like to monitor the enphase inverters.

Title: Enphase power monitoring help appreciated
Post by: Jacob on November 19, 2012, 04:05:33 pm
L.S.

I am trying to build a plug-in to read-out my solar system with the enphase micro inverters.
Unfortunately my programming skills go back 20 years and comprise mainly BASIC
Therefor after some days studying the various, possible and remote similar, plug-ins I am lost in the woods of references and strange parameters.

Can someone on this forum give me a push in the appropriate direction?
I think I will be in a better situation if at least the I_file.xml data collection and formatting is showing something recognizable in the log file.

API call to Enphase website:
https://api.enphaseenergy.com/api/systems/123456/summary?key=xxxapiKeyxxx

Response from Enphase website (JSON format):
{"energy_lifetime":479616,"system_id":123456,"source":"microinverters","energy_today":866,"current_power":123,"energy_month":39969,"summary_date":"2012-11-19T00:00:00+01:00","energy_week":13976,"modules":10}

I am interested in the bold figures

Many thanks in advance
Jacob
Title: Re: Enphase power monitoring
Post by: strangely on November 19, 2012, 04:31:06 pm
I PM'd @elordude and got a reply to say he would be happy to share his work, its just he wanted to clean it up a bit first. I will mail him back again and see if he's had any luck doing that yet.
Title: Re: Enphase power monitoring
Post by: rearden on November 21, 2012, 10:33:45 am
Thank you Strangely.  I can't PM yet and everything is not installed yet, but this is something which is high on my list to add to my enphase/vera system.

Jacob, if you come up with something I would interested in testing it.

rearden
Title: Re: Enphase power monitoring
Post by: strangely on November 26, 2012, 11:53:48 pm
I got a response back from @elordude, that he was happy to publish the plugin here. I wont be able to try this for a bit since my panels wont be switched on for a while (need my inspection first), but for anyone who wants to try this, and can load a plugin manually I've attached it.

After creating the plugin, you will need to enter the IP address of your envoy unit and save/restart.
Title: Re: Enphase power monitoring
Post by: Peter on November 27, 2012, 11:24:54 am
@elordude and @strangely

It works like a charme. thank you very much.

Is it also possible to get the production on the device its self?

Title: Re: Enphase power monitoring
Post by: rearden on November 27, 2012, 02:34:52 pm
Thanks! I think I did the manual install correctly.  Now I have to get time to finish installing the panels!
Title: Re: Enphase power monitoring
Post by: Jacob on November 29, 2012, 02:38:46 pm
Ha, Great, Thanks guy's.
Installed the plug-in and it work's

This is a good example for me to start learning the LUUP programming
I did have a problem with "Past week" and "Since installation" KWH

I modified the file I_ENVOY.xml

local s_start, s_end = string.find(ENVOY_Raw,"Today")
            local TPOWER = string.match(ENVOY_Raw,"%d+%p%d+",s_end)
            local s_start, s_end = string.find(ENVOY_Raw,"Past Week")
            local WPOWER = string.match(ENVOY_Raw,"%d+%p%d+",s_end)   Changed "TPOWER" to "WPOWER"
            local s_start, s_end = string.find(ENVOY_Raw,"Since Installation")
            local LFTPOWER = string.match(ENVOY_Raw,"%d+",s_end)             Changed "%d+%p%d+" into "%d+"

With 500 KWH the Lifetime value of my system returned the date 2007-2012 also on the Envoy web page

This gave the right figures.
I will now try to find out how to be prepared for decimals and installation of child devices

Thanks,
Jacob
Title: Re: Enphase power monitoring
Post by: wale636 on December 17, 2012, 12:40:56 am
Thanks for this plugin, it worked like a Charm. Are you going to create a plugging app for this?
Title: Re: Enphase power monitoring
Post by: scott in NH on December 30, 2012, 04:05:11 pm
Can someone describe the install process for this plug in?  Thanks so much!

Scott
Title: Re: Enphase power monitoring
Post by: strangely on January 08, 2013, 04:44:35 pm
Ha, Great, Thanks guy's.
Installed the plug-in and it work's

This is a good example for me to start learning the LUUP programming
I did have a problem with "Past week" and "Since installation" KWH

I modified the file I_ENVOY.xml

local s_start, s_end = string.find(ENVOY_Raw,"Today")
            local TPOWER = string.match(ENVOY_Raw,"%d+%p%d+",s_end)
            local s_start, s_end = string.find(ENVOY_Raw,"Past Week")
            local WPOWER = string.match(ENVOY_Raw,"%d+%p%d+",s_end)   Changed "TPOWER" to "WPOWER"
            local s_start, s_end = string.find(ENVOY_Raw,"Since Installation")
            local LFTPOWER = string.match(ENVOY_Raw,"%d+",s_end)             Changed "%d+%p%d+" into "%d+"

With 500 KWH the Lifetime value of my system returned the date 2007-2012 also on the Envoy web page

This gave the right figures.
I will now try to find out how to be prepared for decimals and installation of child devices

Thanks,
Jacob

So I made these changes, and presuming  I changed them correctly... while it fixed the display glitches where text was overlapping, it seems that Energy Week and Today are showing the same figure (Today's generation).

Anyone else have Last Update being populated?
Title: Re: Enphase power monitoring
Post by: Peter on January 21, 2013, 05:44:39 pm
Same here, today and "energy this week" are always the same :(
Title: Re: Enphase power monitoring
Post by: Jacob on February 10, 2013, 01:02:38 pm
Hi,

It took some time but I think I have found and solved the errors in the ENVOY PV read-out plug-in by elordude
I have modified the files D_ENVOY.json and I_ENVOY.xml
As far I could check today the figures Current power, Energy today, Energy this week and Energy lifetime are correct imported.
I also managed to show the first tree figures in the device
There is still a field "System uptime" that is empty but I did not spend any time on that yet

Installation of the attached files via:
APPS/Develop APPS/Luup files
Upload the files from your computer
Check the box "Restart Luup after upload"

Then:
APPS/Develop APPS/Create device
Fill in the name of your device e.g. Envoy in the field Description
Fill in D_ENVOY.xml in the field Upnp Device Filename
Finally fill in the IP address of your Envoy in the appropriate field in the new created device

Regards,
Jacob
Title: Re: Enphase power monitoring
Post by: elordude on May 28, 2013, 10:20:23 pm
This is awesome!  Thanks for fixing my crappy code - works much better now - I was learning how to code in Lua (still learning) while creating this plugin.  This plugin + Datamine are the best

regards
Harry
Title: Re: Enphase power monitoring
Post by: rearden on October 16, 2013, 04:59:04 pm
Is there a way to expose the variables such that they can be used a triggers in a scene?

It would be nice to do something like
If power>1000 then turn on X

I don't live in a net metering state :( so I need to match my power production to consumption.  So if my power production exceeded my base usage I could turn on various appliances while my production is high enough.
Title: Re: Enphase power monitoring
Post by: futzle on October 17, 2013, 01:07:02 am
Some combination of the Power Arithmetic plugin, PLEG and/or Combination Switch should do the job.
Title: Re: Enphase power monitoring
Post by: reneboer on March 06, 2014, 11:17:18 am
Hi,
I added the Life time and System up time readings and made some better handling incase some values are in Wh instead of KWh. Also made the control look a little cleaner with UI5.

As this was my first ever lua coding it took me hours more than I expected, but it works  ;)

Cheers Rene.
Title: Re: Enphase power monitoring
Post by: kkl on April 15, 2014, 10:15:09 am
elordude, Jacob, reneboer:
Thank you so much for sharing your efforts with the rest of us.

I'm using the latest files uploaded here, but there appears to be a bug with "This Week" and "Lifetime Energy" numerical values being the same ("This Week" not correct).  Can anyone confirm/fix?  Thanks.

Title: Re: Enphase power monitoring
Post by: elordude on April 15, 2014, 06:44:58 pm
KKL,

I have the same issue i will take ca look at the code and come up with a fix - it might take me few days since I have to test it during the day when there is solar power

regards
Harry
Title: Re: Enphase power monitoring
Post by: reneboer on April 17, 2014, 04:51:55 am
Hi kkl, elordude,

I remember seeing this for a short moment as well, but it cleared for some reason ???. Are you still seeing it after a reload?

The only minor tweak I made since this version is on the uptime string, adding  - 1, but that is just cosmetic:
     local SysUpDate = string.sub(ENVOY_Raw,s_end,ut_end - 1)


Cheers Rene
Title: Re: Enphase power monitoring
Post by: Jacob on April 17, 2014, 08:11:22 am
Hi gents,
I have not touched the plugin after the modification by reneboer and it is working perfectly
Jacob
Title: Re: Enphase power monitoring
Post by: kkl on April 18, 2014, 12:07:00 am
Are you still seeing it after a reload?
I am still seeing it after reboot.  The way I installed it was to follow Jacob's instructions, using two of those files, and the other two from reneboer's post.
Title: Re: Enphase power monitoring
Post by: hmspain on July 10, 2014, 07:30:26 pm
I'm excited to get my Enphase solar tied in with my Vera.  I uploaded the four files (and the two updates), created the generic device, added the device name and IP address of the Envoy... but still nothing.  I added the DataMine app, still nothing.  I feel like such a NOOB.

Could someone step through the install of everything ??? ... slowly? :-)

Thanks!
Title: Re: Enphase power monitoring
Post by: gEEk on September 20, 2014, 01:36:30 am
I got my Enphase/Envoy system installed yesterday and was thrilled to see you guys have developed this. I tried to follow these instructions to the letter:

Hi,

It took some time but I think I have found and solved the errors in the ENVOY PV read-out plug-in by elordude
I have modified the files D_ENVOY.json and I_ENVOY.xml
As far I could check today the figures Current power, Energy today, Energy this week and Energy lifetime are correct imported.
I also managed to show the first tree figures in the device
There is still a field "System uptime" that is empty but I did not spend any time on that yet

Installation of the attached files via:
APPS/Develop APPS/Luup files
Upload the files from your computer
Check the box "Restart Luup after upload"

Then:
APPS/Develop APPS/Create device
Fill in the name of your device e.g. Envoy in the field Description
Fill in D_ENVOY.xml in the field Upnp Device Filename
Finally fill in the IP address of your Envoy in the appropriate field in the new created device

Regards,
Jacob

But when I restart the system I see the following error:
Envoy[113] : Startup Lua Failed
The device shows the today power in kWh but no data is shown for the Power or This week. I am running UI7 right now and am pretty new to device creation and luup. What am I doing wrong? Any help will be greatly appreciated.

Cheers
Title: Re: Enphase power monitoring
Post by: robertgabrielson on February 18, 2015, 03:43:07 pm
I just worked on installing the same plugin and had the same issue.  Finally sorted it out to a change in the formatting of the web site reporting the data figures.  I have made corrections to the I_Envoy.xml file. 

Also, while researching the issue discovered that an API call now exists for the monitor locally - provided you have upgraded the firmware.  Site address is

http://<your monitor up>/api/v1/production

This would be a much cleaner way to get the data.  I plan on making the change to this code when I have time.
Title: Re: Enphase power monitoring
Post by: robertgabrielson on February 18, 2015, 04:27:18 pm
Well, I went ahead and made the changes to use the new API - much cleaner without all of the error handling needed for units.

Title: Re: Enphase power monitoring
Post by: reneboer on February 21, 2015, 08:17:44 am
Thanks Robert,

This is a lot cleaner interface indeed.

Cheers Rene
Title: Re: Enphase power monitoring
Post by: elordude on February 21, 2015, 05:14:41 pm
This is great - I was not aware of the local API - thanks for cleaning up my code ;)

Harry
Title: Re: Enphase power monitoring
Post by: Jacob on February 22, 2015, 06:04:26 am
@robertgabrielson

I have installed your file and it works perfect
However there is a lay-out error in the Devices view (UI7)

I tried to correct this in the D_Envoy.json file but so far without succes.
Im I looking in the right direction?

"Control": [
            {
               "ControlGroup":"1",
               "ControlPair":"1",
               "ControlType":"label",
               "top": 0,
               "left": 0,
               "text_align": "left",
               "Label": {
                  "lang_tag": "power",
                  "text": "Power :"
               },
               "Display": {
                  "Top": 60,
                  "Left": 50,
                  "Width": 85,
                  "Height": 20
               }
            },
            {
               "ControlGroup":"1",
               "ControlPair":"1",
               "ControlType":"variable",
               "top": 0,
               "left": 0.5,
               "text_align": "right",
               "Display": {
                  "Service": "urn:micasaverde-com:serviceId:EnergyMetering1",
                  "Variable": "Watts",
                  "Top": 60,
                  "Left": 190,       // should this be modified?
                  "Width": 55,
                  "Height": 20
               }
            },
            {
               "ControlGroup":"1",
               "ControlPair":"1",
               "ControlType":"label",
               "top": 0,
               "left": 1.5,
               "text_align": "left",
               "Label": {
                  "lang_tag": "watts",
                  "text": "W"
               },
Title: Re: Enphase power monitoring
Post by: robertgabrielson on February 22, 2015, 10:32:50 am
Noticed this too, i'm a Lua newbie so trying to figure it out myself.  Yes, I believe thats the right area.  Ill keep plugging away at it.
Title: Re: Enphase power monitoring
Post by: Jacob on February 22, 2015, 05:29:48 pm
I Think I have found it.
The control group column controls the location

   {
               "ControlGroup":"1",
               "ControlPair":"1",
               "ControlType":"variable",
               "top": 0,
               "left": 1,                       // Changed from 0,5 to 1 resulted in better positioning
               "text_align": "right",
               "Display": {
                  "Service": "urn:micasaverde-com:serviceId:EnergyMetering1",
                  "Variable": "Watts",
                  "Top": 60,
                  "Left": 190,         // This one controls the location on the detailed display
                  "Width": 55,
                  "Height": 20
               }
Title: Re: Enphase power monitoring
Post by: reneboer on February 23, 2015, 07:13:55 am
Hi,

There is a significant difference between UI5/6 and UI7 in this. Before the default width of a scene group was 3 button witdths, i.e. "x": "3" even if you set it to 1, 2 or 6. And if you want to make it wider, the device on the panel had to get wider as well ("x">"4" in the top definition) else the values would not be shown.

However, with the new UI7 layout, the width of the device is fixed. Now the scene group x means the number of columns you like to use and you can make it 1, 2, 3 or 15. The higher the number of columns, the narrower they get. If you now position a control in the control group mapping to that scene group you place the control relative of the number of columns. Example will help;
 SceneGroup "x": "1", means you can use a value between 0 and 1 from left to right.
 SceneGroup "x": "3", means left 0 -1 is first column, 1-2 is second and 2-3 is third, but still on that same left to right width.

I think the quickest and most compatible change is to SceneGroup with "id": "1" and change "x": "6" to "x": "3". I cannot test my assumption right now, but give it a shot.

Cheers Rene.
Title: Re: Enphase power monitoring
Post by: Jacob on February 23, 2015, 12:49:10 pm
Bingo,
Thanks Rene.
I have set the scene groups from "6" to "3"
After that it still was not correct and I modified the control group 2 and 2 "left" from "0.5" to "1" and "1.5" to "2"
Result as you predicted
Chapeau,
Jacob
Title: Re: Enphase power monitoring
Post by: Jacob on February 23, 2015, 12:51:42 pm
This is the updated file
Title: Re: Enphase power monitoring
Post by: reneboer on February 24, 2015, 05:03:19 pm
Hi,

25 Feb, updated I_EnvoyPower1.xml to use standard dkjson library making file smaller.

I took the latest api from you guys and took a bit of a different approach. To turn a standard looking PowerMeter device into one that shows the Envoy data. Why? Because both the Vera and more so all mobile apps are good at displaying the standard devices, but not at any non-standard ones. For example the Envoy so far would not even show in ImeriHome or with very limited options in AutHomationHD or the Vera app. You will also get all the Notification and Scene trigger options of the standard PowerMeter for free. Last bonus is no JSON layout problems  ;D.

Cons; it looks like a standard PowerMeter so you will only see the current power and a KWH value. For the latter I used the daily production value, but you could map it to the week or lifetime values if you like by tweaking the code. To see the Week KWH and LifeTime values you have to look at the Advanced settings.

So how to install?
- Upload the I_EnvoyPower1.xml file attached here.
- Then Create device with the following:

Reload your device and done. This can be used in parallel with the ENVOY plugin. I tried this on UI5/6 and UI7.

Let me know what you think about this approach.

Cheers Rene
Title: Re: Enphase power monitoring
Post by: reneboer on February 25, 2015, 10:13:18 am
Hi Jacob,

I just wanted to search on your Enphase forum about the http://<your monitor up>/api/v1/production API to find that the forum is gone  ???. Bummer as I could find a lot of useful information there also from your answers, even to my questions  ;). Critical views as well just as it this forum, but that keeps a company on its tows I think.

Any way, do you know what the update frequency of the current power is? Is that updated each 60 seconds just as on the web page?

Cheers Rene
 
Title: Re: Enphase power monitoring
Post by: Jacob on February 25, 2015, 12:30:40 pm
Hello Rene,
Yes your right the forum is gone?
I did not visit is for quite a while.
I am not home during the week so I can't check but I thought the update to the Internet is 5min
I think the Envoy update is the same.
Ill check during the weekend
Also then Ill install and test your different approach
Jacob
Title: Re: Enphase power monitoring
Post by: reneboer on February 28, 2015, 11:25:27 am
Hi,

FYI. The Power reading is indeed updated on a five minute interval. So not usable to calculate the real time total power usage of your house. I tried by combining it with the Dutch Smart meter readings that gives a value each ten seconds. Guess I need to think on that a bit more. A five minute interval is fine, but it then must use the value from both sources from the exact same moment.

Cheers Rene
Title: Re: Enphase power monitoring
Post by: Jacob on March 01, 2015, 06:33:30 am
@reneboer I have installed your alternative solution.
It works, as a not programmer I will start looking into the differences
Thanks,
Jacob
Title: Re: Enphase power monitoring
Post by: StarLog on August 18, 2018, 05:23:26 pm
Rene,

I am noob, where do I upload?

- Upload the I_EnvoyPower1.xml file attached here.
Title: Re: Enphase power monitoring
Post by: reneboer on August 20, 2018, 06:40:12 am
Rene,

I am noob, where do I upload?

- Upload the I_EnvoyPower1.xml file attached here.
Hi,

No need to install manually anymore. You should look in the Apps, Install Apps and search for enphase. There are two options, the Solar Meter is the more recent one that supports more systems than just Enphase.

Cheers Rene