Monitoring a SunPower Solar System

After years of waffling on if I should install solar on my house, I finally decided that it would be a good investment. While the federal tax credit went down from 30% to 26%, I would still get a bit of my investment back. The tax credit goes to 22% next year and then goes away, so if I didn’t make the leap now, I’m not sure financially it would make sense for a long time until the panel prices come way down.

Like most major investments, I did a significant amount of research. I got proposals from 9 companies using a variety of panels and inverters. For better or worse, I went with a SunPower system. SunPower wants to make it easy for people to see how much energy they are producing and their monitoring site has a very, very simple dashboard. Apparently their older dashboard (still available via a different URL that uses Flash) showed output on a per panel basis. When I asked SunPower about this, here was their response:

Unfortunately, our monitoring website only shows production data of the system as a whole. Inverter level monitoring was only offered to dealers for troubleshooting and/or repair purposes. This was not offered to homeowners because, after lengthy evaluation, that feature offers more information than is necessary to monitor ongoing system performance, but not enough information to help identify problems (on the rare occasions when they do occur). We also had concerns about the feature’s design, in part due to negative feedback from customers.

After a bit of research, I found that the monitoring device (PVS6) actually has the ability to be queried for local data. An individual with better hacking/detective skills than me figured out the commands to send to the unit and posted information on GitHub describing the setup. That looked pretty straight forward. So I decided to figure out how to integrate it into Home Assistant and into my Grafana graphs.

First step was to configure a Raspberry Pi as basically a bridge where HTTP requests sent to one port would be redirected out the other port. I didn’t need a full fledged router for this, just an HTTP proxy. I decided to use a Raspberry Pi Zero W that I had lying around as a base. I ordered an Ethernet adapter for it and that was it for hardware. My son designed a case for both pieces and I 3D printed it.

Configuring the Raspberry Pi

  1. Download the Raspberry Pi Imager
  2. Select the Raspbian Lite image.
  3. Write the image to an SD card.
  4. Create a file called wpa_supplicant.conf at the root of the image with the following:
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    country=US
    
    network={
     ssid="<Name of your WiFi>"
    psk="<Password for your WiFi>"
    }
    
  5. Add a file called ssh at the root of the image. This file should be empty.

  6. Assign a static IP address mapping on your router for the Pi.
  7. Boot the Raspberry Pi. Login using username: pi password: raspberry
  8. Update the OS using

    sudo apt-get update
    
  9. Install ha-proxy
    sudo apt-get install haproxy
    
  10. Modify /etc/dhcpcd.conf by adding the following so that the Ethernet going to the PVS6 doesn’t attempt to setup a gateway. If this happens, the Pi no longer responds over WiFi.
    interface eth0
    nogateway
    
  11. Add the following to /etc/haproxy/haproxy.cfg:
    frontend http-in
        bind *:80
        default_backend backend_servers
    
    backend backend_servers
        server sv1 172.27.153.1:80
    
    listen stats
        bind *:8080
        stats enable
        stats uri /
        stats refresh 10s
        stats admin if LOCALHOST
    
  12. Reboot the Pi.

Now when you issue HTTP calls to the Pi, they’ll goto the PVS6.

Setting up Home Assistant

I use Node-RED for most of my automations, so the following is how I poll the PVS6 from Node-RED.

Node-RED PVS6

Basically what I do is make an HTTP call to the Raspberry Pi over the WiFi interface that redirects to the PVS6. Using the information from the GitHub repo I found, the call is: http://10.0.3.55/cgi-bin/dl_cgi?Command=DeviceList

I then parse out the different devices that are returned (one for each inverter, one for the monitoring unit, one for the consumption meter and one for the production meter). My installer didn’t hook up the consumption meter, but I use an older version of the Rainforest Automation EAGLE-200 to connect to my electric meter and get consumption data.

This Node-RED flow generates multiple sensors that can then be used to display data right in Home Assistant or in Grafana. There is more information in the output than I need such as AC voltage, DC voltage, AC current, DC, current, etc. I use Home Assistant’s HTTP interface to create new sensors and since I have no idea how fast it can respond, I rate limit the updating of the sensors.

You can download my Node-RED flow from here.

Grafana

I’m going to leave it as an exercise for the reader to setup pretty pictures in Grafana. I’ve setup a basic dashboard and some other graphs. The per panel graphs are useful to tell me if a panel isn’t operating properly. While SunPower doesn’t really want you to know this information, it is very helpful. My system was turned on (my installer and SunPower can remotely disable my system which really bothers me) yesterday and I noticed that 1 of the panels wasn’t generating power. This amounts to about 8% of my overall system; most people wouldn’t know this which makes it even more important to be able to get status on a per panel basis.

Energy Dashboard

Energy Usage

Per Panel Monitoring

Conclusion

I’ve written up this guide to help others, but also to refresh my memory in the future to figure out what I did. My home automation system is growing more and more complex by the day and if I don’t document at least parts of it, I’ll never be able to troubleshoot it.

Feel free to ask questions or provide comments.

172 Replies to “Monitoring a SunPower Solar System”

  1. What tool do you use to generate a request? In Chrome developer tools, if you right click on “components”, hover over “Copy” to get the list, and then for example choose “Copy as cURL (cmd)”. You can use that to run a cURL command. Or I use Postman and import the cURL to set up the request.

    Looks like the authentication times out after some period which means you’ll need to sign in again and grab the new token, or you can trace the sign in, locate the “authenticate” call, and copy that into a request.

  2. can you given and example of a cURL command you are using? I’m confused by the content of the “Copy as cURL (cmd)”.

  3. You should design an app and sell it for money I would definitely be interested. I’m just surprised no one has created a 3rd party app.

  4. How do you power the raspberry pi? The PVS5x/PVS6 usually mount near the breaker panel or power company meter on the outside of your house unless you are running a long ethernet cable from LAN1 port on the PSV5x/PVS6 to bring the signal inside the house to the pi. Is this how you have your pi power? inside the house or outside near the PVS5x/PVS6?

    1. Hi Hai,

      My PVS6 is located in my garage and I have Ethernet runs from my switch out to the garage. I’ve located my Pi in my equipment rack, so I just power it right at the switch. I’ve read that others use one of the USB ports on the PVS6.

  5. I would pay MONEY for this as a third party app. I played around with setting this up but I don’t understand network traffic well enough to build this out without haproxy. For some reason I can’t run haproxy as I have a Pi running Pi-hole.

  6. Scott, this is an amazing article and I’m glad to see someone take initiative to be able to get the data they are seeking.

    It’s a bit weird to me that SunPower would not provide that information to Homeowners due to the fact that it’s more information than needed. Again, I’m quite impressed with the alternative you have provided and it’s something worth the test.

  7. Fairly new PVS6 installation running Build 9210. DeviceList does not show any of the micro inverters. Just the Supervisor, the Production(p?) and Consumption(c?), Am I missing something or has something changed where SunPower is restricting that information?

          1. You can try configuring your PVS6 but you probably will not be able to save the changes. You should request your installer claim your inverters as they did not finish your installation. You could just ask them to verify your panels as you suspect one of them is not working. They will not be able to do this unless they finish your installation and claim your inverters. You can try claiming your inverters yourself by entering:
            http://172.27.153.1/#/landing choose “residential”
            Click “continue”
            It will display a notice that SP is shutting down this app.
            It will then check the firmware
            Click “continue”
            Choose “yes” “updating existing site”
            Select your device and site then click “continue”
            Click “rediscover”
            Click “discover” it may take awhile as is discovers your devices
            After it is done it will take you back to the same screen
            Click “configure” your panels should show up
            Click “done” at bottom of page
            It will take you back to the same page
            Click “continue”
            Your inverters will be claimed
            Click “continue”
            Your devices should all show up and you can click on them to get additional information.
            When you click “continue” it will ask you to login but you will not be able to as you need an installer password & user name. So you probably will not be able to save the changes but at least you can see them this way.

  8. I got this working well and get data for about 12 hours, then the Pi started getting 503 errors when accessing the ConnectedDevices end point. A reboot of the pi fixes it but its frustrating to have to do that so often. Any idea where to start to debug this issue?

  9. My system does not have any power measuring devices for production (only consumption.) So I assume the supervisor lifetime energy is simply summing what is reported by the inverters. I am curious why the energy reported by supervisor is 1.6% less than the sum of the energy values reported by the inverters. I would think it would match exactly. Any idea?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.