A python script to exfiltrate residential solar electric data from a Sunpower PVS6 monitoring unit, without paying fees. It runs on a Raspberry Pi plugged into the device, or on home network.
For reference, this project was made for a SunPower Photovoltaic (PV) system installed in 2019 on a residential house in the northeast USA with a roof mounted system. The system has 2 circuits, each with 6 Sunpower (actually Maxeon) PV panels & attached Enphase microinverters. No battery.
Sadly, I had a microinverter go bad but did not learn about it until years later when another 5 died. I only noticed that half the system was down when our electric bill going up and went 'down the rabbit hole' to figure it out.
The SunPower company sold perhaps ~586,000 installations before going backrupt. Luckily the panels and microinverters are under warranty, but the PVS monitoring unit is not. The PVS continues to send data to a server that a new company, SunStrong, sells selling app subscription to access the data.
There are multiple cool dashboard project, see below. This project is meant to keep an eye on it and send an email if something goes wrong. Mostly solar panels just work, which leads to them being ignored, like I did.
IMHO Monitoring should NOT be left up to the user! Solar has to be come more friendly or it will not catch on in America. This project is hopefully is a small contribution to that.
The basic approach, demonstrated by other projects, is that the PVS6 has a small computer inside running a web server. If you plug a laptop or other deivce into the internal ethernet port, and go to a 'web page' made for technicians, it will output the current state of the system, but no history or alerting. A Raspberry Pi inserted in the PVS6 case periodically calls a python script to run the code in this github project to catch the status and save for the future.
We want to:
- Get the data off the PVS6, for future reference
- Make it available to review trends by non programmers, e.g. a spreadsheet
- Send alerts if something goes wrong.
This is meant to operate in the background. Not a dashboard! We all have enough to do!
There are two scripts, running on the Raspberry Pi on a regular basis. It also works on my Mac, but a Raspberry Pi is more convenient and dependable for routine script running.
-
Query the PVS6 web interface
-
Save the output as a file on Raspberry Pi
-
Extract key production metrics, saves to output/overview.csv on Raspberry Pi
- Timestamp
- Lifetime PV Production (kWh)
/sys/livedata/pv_en - Lifetime Site Load (kWh)
/sys/livedata/site_load_en - Lifetime Net Grid (kWh)
/sys/livedata/net_en - Current PV Production (kW)
/sys/livedata/pv_p - Current Consumption (kW)
/sys/livedata/site_load_p - Current Net Power (kW)
/sys/livedata/net_p
-
Extract key production metrics, saves to output/inverters.csv on Raspberry Pi
- Timestamp
- Serial Number
- Working / Error
- Current PV Production (kW)
/sys/devices/inverter/{inverter_index}/p3phsumKw - Lifetime PV Production (kWh)
/sys/devices/inverter/{inverter_index}/ltea3phsumKwh
-
Reads previous day's data from
overview.csvandinverters.cvsfiles and calculates daily totals -
Saves daily production, etc as a row to output/daily_summary.csv
- Timestamp
- Daily PV Production (kWh) 24 hour difference of
/sys/livedata/pv_en - Daily Site Consumption (kWh) 24 hour difference of
/sys/livedata/site_load_en - Daily Net Grid (kWh) 24 hour difference of
/sys/livedata/net_en - Lifetime PV Production (kWh)
/sys/livedata/pv_en - Lifetime Site Load (kWh)
/sys/livedata/site_load_en - Lifetime Net Grid (kWh)
/sys/livedata/net_en - Inverters Reporting
- Alerts
-
(optional) save same row to Google sheet via API
-
(optional) Check for inverter anomalies and email alerts
-
(optional) Monthly summary email
Future ideas
- Load a weather API to get temperature and how cloudy it is locally
- the working/error status from inverters is not fully understood
A recent update to the PVS firmware enables direct requests to the PVS, without a Raspberry Pi going to the ethernet port. This is cool, and a direction for future development. This project is intended to run from the Raspberry Pi, but also works on a laptop in local network.
This guide walks you through setting up the monitoring system on a Raspberry Pi (or Mac). The Raspberry Pi sits inside your PVS6 case, collects data every 15 minutes, and sends you alerts.
Hardware needed:
- Raspberry Pi 4B (or similar)
- 32 GB SD card
- Ethernet cable
- USB cable for power
Initial Pi setup:
- Install Raspberry Pi OS Lite 64-bit on SD card
- Create account with password, enable SSH, configure WiFi
- Update the system:
sudo apt update && sudo apt upgrade -y sudo apt install python3-pip git -y - Configure networking to prevent Pi from using PVS6 ethernet as gateway:
Add these lines at the end:
sudo nano /etc/dhcpcd.conf
interface eth0 nogateway - Reboot:
sudo shutdown -r now - Physically install the Raspberry Pi in your PVS6 case:
- Connect ethernet to PVS6 'LAN1' (black) port
- Connect USB to PVS6's left-most USB port for power
SSH into your Raspberry Pi from your computer:
ssh your_username@192.168.x.xClone this repository:
cd ~
git clone https://github.com/steveturbek/SunPower-PVS-Supervisor.git
cd SunPower-PVS-SupervisorCreate and activate Python virtual environment:
python3 -m venv venv
source venv/bin/activateInstall required Python packages:
pip install -r requirements.txtCreate your config file:
cp config.py.example config.py
nano config.pyRequired settings (basic monitoring, no emails or Google Sheets):
PVS6_IP- IP address of your PVS6 (use172.27.153.1if accessing via ethernet)PVS6_SERIAL_LAST5- Last 5 characters of PVS6 serial number (found inside PVS6 cover)
Optional: Google Sheets integration (skip if you only want local CSV files):
- Go to Google Cloud Console
- Create a new project (e.g., "SunPower-Monitor")
- Enable the Google Sheets API
- Create credentials (Service Account, NOT OAuth)
- Download the JSON key file
- Copy the JSON contents into
config.pyasGOOGLE_API_CREDENTIALS - Create a Google Sheet and get its ID from the URL:
https://docs.google.com/spreadsheets/d/SHEET_ID/edit - Add the sheet ID to
config.pyasGOOGLE_SHEET_SPREADSHEET_ID - Share your Google Sheet with the service account email (found in JSON file)
Optional: Email alerts (skip if you don't want email notifications):
- Enable 2-Factor Authentication on your Gmail account:
- Go to https://myaccount.google.com/security
- Enable "2-Step Verification"
- Create an App Password:
- Go to https://myaccount.google.com/apppasswords
- Select "Mail" and "Other (Custom name)"
- Name it "Solar Monitor"
- Click "Generate" and copy the 16-character password
- Add to
config.py:SMTP_SERVER = 'smtp.gmail.com'SMTP_PORT = 587SMTP_USERNAME = 'your_email@gmail.com'SMTP_PASSWORD = 'your_app_password'(16-char from step 2)EMAIL_FROM = 'your_email@gmail.com'SUPERVISOR_EMAIL = 'your_email@gmail.com'
Make sure you're in the virtual environment:
cd ~/SunPower-PVS-Supervisor
source venv/bin/activateTest data collection (should create CSV files in output/ folder):
python3 collect-solar-data.pyTest daily summary (needs data from previous step):
python3 daily-solar-summary.pyOne can run it for previous days, for example 3 days ago
python3 daily-solar-summary.py 3NOTE: it won't overwrite the daily-solar-summary.py, so move or rename file to get new output
E.G. To do the last 47 days
for i in {47..1}; do
python daily-solar-summary.py $i
doneQuick check inverter status (manual diagnostic tool):
python3 Inverter-Status-Quick-Check.pySet up automated data collection every 15 minutes:
crontab -eAdd these two lines:
# Collect data every 15 minutes, 6 AM to 9 PM
*/15 6-21 * * * cd /home/YOUR_USERNAME/SunPower-PVS-Supervisor && /home/YOUR_USERNAME/SunPower-PVS-Supervisor/venv/bin/python collect-solar-data.py >> collect-solar-data-crontab.log 2>&1
# Daily summary at 7 AM, hopefully after first collect-solar-data.py job runs
0 7 * * * cd /home/YOUR_USERNAME/SunPower-PVS-Supervisor && /home/YOUR_USERNAME/SunPower-PVS-Supervisor/venv/bin/python daily-solar-summary.py >> daily-solar-summary-crontab.log 2>&1Replace YOUR_USERNAME with your actual username.
Watch the logs to confirm it's working:
tail -f ~/SunPower-PVS-Supervisor/collect-solar-data-crontab.log
tail -f ~/SunPower-PVS-Supervisor/daily-solar-summary-crontab.logWhen updates are available:
cd ~/SunPower-PVS-Supervisor
git pull
source venv/bin/activate
pip install -r requirements.txt # In case new dependencies were addedThe scripts also work on macOS if you prefer not to use a Raspberry Pi:
- Clone the repository
- Create virtual environment:
python3 -m venv venv - Activate it:
source venv/bin/activate - Install dependencies:
pip3 install -r requirements.txt - Configure
config.pywith your PVS6's local IP address - Run manually or set up with launchd (Mac's equivalent of cron)
Note: Your Mac must be on the same local network as your PVS6.
After setup, you'll have these files in the output/ directory:
overview.csv- System-level production/consumption every 15 minutesinverters.csv- Individual inverter data every 15 minutesdaily_summary.csv- Daily totals and alertsraw_JSON_output_files/- Raw PVS6 responses (for debugging)
Here are some cool projects that inspired and informed this project. I hope I can pay it back to help others.
- Gruby
- ginoledesma/sunpower-pvs-exporter
- Starreveld
- SunPower Docs and Python Code
- documentation on VarServer parameters
- PVS6 VarServer parameters
also
- SunPower Solar Integration to Home Assistant (a smart home dashboard)
- https://github.com/krbaker/hass-sunpower
- https://github.com/jrconlin/sunpower_hass/tree/main/direct
- PVS5-6_Reverse_Proxy_Guide
The Sunpower PVS6 PhotoVoltaic Supervisor 6 is monitoring unit, typically installed near the near electrical panel. It just measures, mostly does not control the microinverters. Your solar panels will generate power and offset your consumption regardless of whether the PVS6 is online.
Note there are several ways for solar systems to work, mine has a microinverter on each solar panel, but other systems have one big inverter or even a battery. Please keep in mind this software is only tested on a basic microinverter system.
PVS6 were manufactured and sold in the US by SunPower, which unfotunately went out of business. SunStrong has resuscitated the server and has an app with a monthly subscription. It works well, but has limited information and no alerting. If you ask, they will enable panel level monitoring, which can show if one panel is not working.
- The PVS6 'listens' to certain circuits the Solar Panels & Microinverters are on. The microinverters send a message on the AC electical wiring, called "Power Line Communication". PVS6 get production data from micro inverters. NO wireless communication from micro inverters to PVS6.
- PVS6 also has white/black, white/red braided cables. These go to Current Transformers which measures electical current on your circuit breakers (estimates but accurate). The PVS6 has measurements for Consumption and Production
The PVS6 does NOT talk to your electrical grid. These are all estimates, but said to be faily accurrate.
- The PVS6 remembers microinverters for a period after disconnect (will show 'error' not 'disconnected'). You can ask your solar installer or SunStrong to forget the device.
- If a microinverter is moved to a different solar circuit, the PVS6 doesn't notice
Tips on accessing the PVS6, from either a raspberry pi, or local mac Building on tips on the 2025 way to access the PVS6 and SunStrong code library example page
The PVS6 has a small web server that shares its internal info. But you can't just load the page in a web browser, because of security limitations.
You can call the PVS6 web server using a terminal command, CURL on your laptop on the same network
First You set 2 variables
auth=echo -n "ssm_owner:A1234" | base64 ip=echo -n "192.168.0.14"
A1234 = last 5 digits of your PVS serial number. It is on the device, inside the cover. The last 5 should looks something like A1234. ip = the local wifi IP address of your PVS6
If accessing the PVS6 via the ethernet port, use
ip=echo -n "//172.27.153.1"
Then you log in
curl \ -k \ -b cookies.txt \ -c cookies.txt \ -H "Authorization: basic $auth" \ "https://$ip/auth?login"
cookies.txt is a file containing cookies (used to store auth tokens) The script makes it, you can basically ignore it
Then you ask for al the data
curl \ -k \ -b cookies.txt \ -c cookies.txt \ "https://$ip/vars?match=/&fmt=obj"
Or you can make a file out of it
curl \ -k \ -b cookies.txt \ -c cookies.txt \ "https://$ip/vars?match=/&fmt=obj" \ -o "$HOME/Desktop/PVS6output_$(date +%Y%m%d_%H%M%S).json"
The chrome browser can open this JSON file and it is slightly easier to read
There are parameters to get just some data
“Match” to get just the meter data
I am working on a small script to keep an eye on my PVS6, let me know interested in hearing more
curl -k -b cookies.txt -c cookies.txt "https://$ip/vars?match=meter/" -o "$HOME/Desktop/PVS6output_$(date +%Y%m%d_%H%M%S).json"
Or ask for specific variables by name
curl -k -b cookies.txt -c cookies.txt "https://$ip/vars?name=/sys/info/sw_rev,/sys/info/lmac"
You can ask that the output data be formatted more cleanly
curl -k -b cookies.txt -c cookies.txt "https://$ip/vars?name=/sys/info/sw_rev,/sys/info/lmac&fmt=obj"
Note there was until 2025 another command to access the info, called
curl http://172.27.153.1/cgi-bin/dl_cgi?Command=DeviceList -o "$HOME/PVS6outputJSON/$(date +%Y%m%d\_%H%M%S).json">
This is not supported when accessing the PVS6 directly, but may still work on the ethernet port, or on older firmware.
The PVS6, when queried, returns JSON formatted data VarServer example using &fmt=obj and older DL_CGI example
