Envoy router from Enphase

How to monitor your Envoy router with MRTG

So I am into green, whole family is. This past summer, I decided to install solar panels. Got a 4.4KW system installed with Enphase microinverters.

Traditional solar panel system generate DC in the panels, and all of them goes to a battery bank, then a DC-AC converter for the house. It’s big, bulky and wasteful (converting DC-AC, etc). The Enphase microverters uses a DC-AC converter per panel. So no batteries needed, and losing one panel (whether shade, damage, whatever) is not going to stop power production.

Anyway, long story short, along with the microinverter come an Envoy, which is essentially a small embedded computer that talk with each inverter, query their status (power generation, heat, etc.), collects them and send them to a central place (Enphase’s server).

You have the option of subscribing to Enphase Enlighten program which allow you to login to a personalize website and view your power generation history with nice graphs, etc. The first few months are free after installation so you can play with it and see how it work.

I didn’t want to pay for something I can do myself. The microinverters talk with the Envoy over the power lines, so use their own protocol. But since I have access to the Envoy controller, I can query it for the data it collect from the inverters. There is a web interface on the unit that I can login to and see the data. But there is no programmatic way to get that data, e.g no snmp or API that I can use to ask the Envoy.

Hmmm, ok, I’ll screen scrape the web interface. So I wrote a little perl script to do just that, and that script output MRTG data for graphing locally.

12/14

Sorry, didn’t finish this yet.  I’ll post my little perl script and the config I used for MRTG when I have chance.

3/9/2011

I posted my MRTG config and perl script in the comment to this post.  Too lazy to put it here….

 

How to monitor your Envoy router with MRTG So I am into green, whole family is. This past summer, I decided to install solar panels. Got a 4.4KW system installed with Enphase microinverters. Traditional solar panel system generate DC in the panels, and all of them goes to a battery bank, then a DC-AC converter…

24 Comments

  1. I now have the performance trends, generated with gnuplot, available on my website.
    http://simple-pages.homeunix.net/solar/

    The data I extract from MySQL using a perl script which is then passed on to my gnuplot script:
    #!/usr/bin/gnuplot
    reset
    #
    set grid
    set time
    set title “Daily generation graph”
    set style fill solid 1 border noborder
    set key top left box
    set style data fsteps

    set xtics font “Times-Roman, 12”
    set xlabel “Time”

    set xdata time
    set timefmt “%Y-%m-%d %H:%M:%S”

    set format x “%d/%m\n%H:%M”

    set ylabel “Watt”
    set y2label “kWh”

    set ytics nomirror
    set y2tics
    set tics in
    #
    set key autotitle columnhead
    set terminal png size 800,300

    set output ‘/var/www/htdocs/solar/daily.png’

    plot ‘/tmp/daily.dat’ using 1:3 smooth freq, \
    ” using 1:($4/1000) smooth freq axis x1y2
    # end of gnuplot script

    The datafile (/tmp/daily.dat) is generated using a MySQL query and looks like this:
    ‘date time’ ‘power’ ‘energy’
    2016-08-12 13:45:02 2240 7950
    2016-08-12 13:40:02 1880 7770
    2016-08-12 13:35:02 653 7610
    2016-08-12 13:30:02 1570 7560

    All pretty simple I would think.

    Cheers,
    Frits.

  2. Hi Tin,
    I’ve added some SQL to your perl script:
    Top of the script:
    use CGI qw(:standard);
    use strict;use Socket;
    use DBI;

    Bottom of the script:
    #
    # update the MySQL database table
    #
    my ($dbhandle, $qhandle,$query);
    $dbhandle = DBI->connect (“DBI:mysql:host=localhost;database=envoy”,
    “nobody”, “”,
    {PrintError => 0, RaiseError => 1});
    $query = ”
    INSERT INTO data \
    VALUES (0, now(), $ncurrently, $ntoday, $nlastweek);”,

    # print(“query: $query\n”);
    $qhandle = $dbhandle->prepare($query);
    $qhandle->execute();
    #
    # End of MySQL addition
    #

    I guess you might like that.
    The graphics can you be generated using GNU plot and straight out of the MySQL table 🙂
    Oh, and for good measure I added ‘last week’ generation.

  3. Hi Tin, here are links to my mrtg graphs. I’ve only got a weeks worth of data, so far:

    Day Graph: http://s17.postimg.org/p31t04acv/envoy_day.png
    Week Graph: http://s9.postimg.org/85aaaebyn/envoy_week.png
    Month Graph: http://s24.postimg.org/633yj5fmd/envoy_month.png

    And finally, the year graph: http://s9.postimg.org/3nckw1lan/envoy_year.png

    I don’t have a lot data yet for my yearly graph. But, as you can see, the maximum value is about 6kW. Where on the week and month, it is about 12.5kW.

  4. Tin, thanks for this page. I’ve implemented this to get mrtg graphing of my envoy data. One question: I notice that your screen shot of the mrtg graphs don’t include the yearly data. I’m having issues with my yearly graph. My yearly graph doesn’t seem to be showing the correct daily totals production. Are you having the same issue with your yearly graph?

    1. Can you post a screen cap of your yearly graph? Mine works fine as far as I can remember. I upgraded my server HW and OS last year and broke the monitoring. I’ll get it working again now to take a look.

    2. I got my MRTG monitoring working again with the Envoy and my yearly graph look ok. Note that it take time, at least a day or more for there to be any data to be graphed. Since RRD rolls up data over the time series. You lose precision, but you get cumulative averages.

      I’ve also updated my get-envoy-stats.pl script and checked it into my github repo.

      Get stats script

  5. @Joe

    At the moment, no. The software is meant to run on Linux or *NIX like systems (including BSD variants, OSX, Solaris, etc.).

    This was just a quich hack so I can monitor what my solar panels are generating. Not promising anything, but I’ll look into making it run on other OS, including Windows.

    I have a couple of ideas to make it nicer looking.

  6. I’m not a programmer, but I sure would like to be able to install and utilize this software to get better displays of the performance. I have an enphase system out “in the country” where only dial-up is available, and can’t use their monitoring system. I’m NOT a programmer – is there a “finished’ version of this software I can just load up on a windows 7 computer to let me get the more complete data? Sure would appreciate a copy…

  7. Ok, here is what I have. There are several pieces you need to graph your system using MRTG. You need to have MRTG setup and working. There is an MRTG cronjob that runs every 5 minutes to grab the data, update the RRDs and generate the graph.

    First, create an MRTG config file for your Envoy router. Here is mine, you need to change the IP address to yours. I put mine in a file call envoy.cfg in /var/www/mrtg/cfg directory.

    WorkDir: /var/www/mrtg
    # Options[_]: derive,nopercent,growright
    Options[_]: gauge,nopercent,growright
    
    ######################################################################
    # System: tin.le.org
    # Description: Envoy Solar router 192.168.2.104
    # Contact: Postmaster 
    # Location: Tin Data Closet
    ######################################################################
    
    Target[envoy_192.168.2.104]: `/home/tin/bin/get-envoy-stats.pl`
    SetEnv[envoy_192.168.2.104]: MRTG_INT_IP="192.168.2.104" MRTG_INT_DESCR="envoy"
    MaxBytes1[envoy_192.168.2.104]: 4400
    MaxBytes2[envoy_192.168.2.104]: 50000
    # Kilo[envoy_192.168.2.104]: 1000
    Title[envoy_192.168.2.104]: Envoy (192.168.2.104) -- Solar Router
    Legend1[envoy_192.168.2.104]: Current Generated
    Legend2[envoy_192.168.2.104]: Today Generated
    Legend3[envoy_192.168.2.104]: 5 Min Current Generated
    Legend4[envoy_192.168.2.104]: 5 Min Today Generated
    LegendI[envoy_192.168.2.104]: Now
    LegendO[envoy_192.168.2.104]: Today
    YLegend[envoy_192.168.2.104]: Watt Generated
    XSize[envoy_192.168.2.104]: 600
    ShortLegend[envoy_192.168.2.104]: W/h
    PageTop[envoy_192.168.2.104]: 

    Envoy (192.168.2.104) -- Solar Router

    Then you will need the following perl script:

    get-envoy-stats.pl script

    This is a screen cap of my MRTG screen:
    Envoy MRTG Screencap

  8. I have 12 Enphase inverters as well an Envoy unit which allows me some access to my data but I sure would like to see it all. I did pay for the equipment.

    Please let me know of any progress in this regard.

    1. Sorry, I’ve been busy and have not check my blog for a while. I’ve got to clean up my script and post it.

      If you can post the /etc/passwd file from the envoy, that should help. More eyes to look at it and have a try at cracking it.

    1. No, I wish. I am screen scraping at the moment. I am planning on opening up the router and see if I can get to the OS. If mine is one of the old one with the SD card, then I am in heaven!