Photonlog #
Local solar monitoring for SunPower PVS6 gateways, no subscription needed.
Interface #

Now tab (left) shows live solar, home, and grid power, today's totals and power curve, and lifetime meters.
Energy tab (middle) breaks down produced, used, imported, exported, and self-powered % by hour, day, week, month, or year.
Panels tab (right) maps each microinverter with hourly detail, peak, 7-day average, temp, and DC voltage/current, flagging lagging or silent panels.
Colors are in Settings. Alongside Classic, there are Cotton Candy, Sunset, Twilight and Bubblegum themes, or you can pick your own solar, home and panel-gradient colors.
Why ? #
The SunStrong Connect app (which replaced mySunPower after Sunpower went bankrupt) now unfortunately paywalls previously free basic functionality like history and analytics (they want $10 / month!). This is ridiculous, of course.
How ? #
Photonlog replicates the old functionality by polling the panel's PVS gateway on your home network, logging history, and serving a web UI & API (plus an optional Android app).
What you need #
- A SunPower PVS6 on 2025+ "varserver" firmware. The discovery tool checks for it; older firmware isn't supported yet (details). Only tested on a PVS6; a PVS5 on the same firmware should work, so open an issue either way if you try it.
- The PVS on your Wi-Fi or Ethernet (the grey box near your electrical panel with the serial on its label; cellular-only units can't be reached locally).
- An always-on machine on the same network, like a Raspberry Pi (any model, including Zero), NAS, or old PC (not a sleeping laptop), running Docker or the static binary.
- Any phone or computer with a browser (including iPhone), or the Android app.
Setup #
1. Find your PVS #
Build the image and scan your subnet (usually your computer's IP with the last number replaced by 0/24; find yours with ipconfig getifaddr en0 on Mac, hostname -I on Linux, or ipconfig on Windows):
git clone https://tangled.org/piss.beauty/photonlog && cd photonlog/collector
docker compose build
docker run --rm photonlog:local discover 192.168.1.0/24
Found PVS ZT000000000000A1234 at 192.168.1.27 (supported firmware).
Put this in collector/.env: PVS_HOST=192.168.1.27
Without Docker (see below), ./photonlog discover detects the subnet automatically.
Reserve that IP for the PVS in your router's DHCP settings so it doesn't move later.
2. Configure and start the collector #
cp .env.example .env # then edit: PVS_HOST, TZ_NAME, API_TOKEN
docker compose up -d --build
curl http://localhost:8787/api/health
PVS_HOSTis the IP from step 1.TZ_NAMEis your timezone (America/Los_Angeles,Europe/Berlin, etc.) for day and month boundaries. Common North American and European zones are built in; elsewhere use a POSIX TZ rule likeAEST-10AEDT,M10.1.0,M4.1.0/3.API_TOKENis optional but recommended. Generate one withopenssl rand -hex 16and enter it in the UI.PVS_PASSWORDcan stay blank (defaults to the last 5 characters of the PVS serial on its label).HTTP_WORKERSis optional: how many API requests run at once (default 4). 2 is plenty on a single-core board like a Pi 1.
The image is about 2.5 MB (one static binary, nothing else). The collector uses 3–5 MB of memory, around 10 MB once it has a year of history, and briefly up to about 20 MB while serving the Panels view.
The health check should show "ok":true and, within a minute, a last_ok time for live and devices under poller. If last_error shows up instead, see Troubleshooting.
Back up your history while the collector keeps running. backup writes a consistent, checked copy of the database:
docker run --rm -v photonlog-data:/data -v "$PWD":/backup --user 0 \
--entrypoint /photonlog photonlog:local backup /backup/photonlog-backup.db
Without Docker, it's DB_PATH=/path/to/photonlog.db ./photonlog backup backup.db. To restore, stop the collector, replace its database with the copy (deleting any -wal and -shm files next to it), and start it again.
Photonlog doesn't schedule or upload backups itself. My own setup runs backup from cron every 6 hours and uploads the copy to Google Drive with rclone, keeping the newest dozen. It isn't a supported feature, and there's no commitment to adding one.
Update later with git pull && docker compose up -d --build in collector/ (history stays in the volume).
Raspberry Pi on a 32-bit OS, or a Pi Zero/1
Building needs a 64-bit OS and more RAM than small boards have, so cross-build on another machine with Docker and copy the output over.
For a Pi Zero or Pi 1 (ARMv6), skip Docker on the Pi (ARMv6 support is shaky) and export the binary from collector/, then follow Running without Docker:
docker buildx build --platform linux/arm/v6 --target bin --output type=local,dest=dist .
scp dist/photonlog pi@raspberrypi.local:
For a 32-bit Pi 2/3/4, build the Docker image the same way:
docker buildx build --platform linux/arm/v7 -t photonlog:local --output type=docker,dest=photonlog.tar .
scp photonlog.tar pi@raspberrypi.local:
On the Pi, in collector/ with your .env ready, load and start it:
docker load -i photonlog.tar
docker compose up -d
Running without Docker #
Static binary with systemd (Pi Zero, Pi 1, or anywhere you'd rather not run Docker)
The collector is a single static binary with no dependencies. Build it with cargo build --release in collector/ (it lands in target/release/photonlog), or export one for another machine with the --target bin command above.
chmod +x photonlog
PVS_HOST=192.168.1.27 TZ_NAME=America/Chicago DB_PATH=./photonlog.db ./photonlog
To run it as a service, install it and create /etc/systemd/system/photonlog.service. Change User and the database path to your own username, since recent Raspberry Pi OS images don't have a pi user:
sudo install -m 755 photonlog /usr/local/bin/photonlog
[Unit]
Description=Photonlog collector
After=network-online.target
Wants=network-online.target
# Never stop retrying after repeated failures.
StartLimitIntervalSec=0
[Service]
Environment=PVS_HOST=192.168.1.27 TZ_NAME=America/Chicago DB_PATH=/home/pi/photonlog.db
Environment=API_TOKEN=change-me
ExecStart=/usr/local/bin/photonlog
Restart=always
RestartSec=5
User=pi
[Install]
WantedBy=multi-user.target
Then run sudo systemctl enable --now photonlog.
3. Open Photonlog #
Open http://<collector address>:8787 (e.g. http://192.168.1.50:8787) in any browser. If you set API_TOKEN, tap the gear icon and enter it once. On iPhone, Share → Add to Home Screen gives you a full-screen icon.
For the Android app:
- Build the APK and install it (no prebuilt download yet, so the web UI is easier).
- On first launch, tap Scan this network to find the collector on Wi-Fi.
- Enter
API_TOKENif set, then tap Save.
4. Remote access (optional) #
The collector is local-only by default. To check it away from home:
- Install Tailscale on the collector machine and your phone.
- Open
http://<machine-name>:8787using its Tailscale name (or set that URL in the Android app's Settings).
Don't forward port 8787 on your router. The API is plain HTTP and isn't meant for the internet.
Limitations and quirks #
- History starts when the collector starts. The PVS only holds live readings and lifetime totals, so past days can't be backfilled (only SunStrong's cloud has older history). Lifetime totals since installation (produced, used, imported, exported) are exact because they come from the PVS meters.
- Outages don't lose energy. Totals come from lifetime counters, so offline stretches are still counted and spread evenly across the gap (marked "estimated").
- Panel tiles sort by serial number since the PVS doesn't report roof layout.
- Systems without a consumption meter show production only, with "–" for grid and usage.
- SunVault battery power and charge level are logged, though not shown in the UI yet.
Older PVS firmware #
Pre-2025 PVS firmware uses a different local API (/cgi-bin/dl_cgi) with no login, often only reachable via the PVS's wired installer port. The discovery tool and collector detect it and say so. Open an issue if you have one; adding support needs hardware to test on.
Troubleshooting #
| Symptom | Fix |
|---|---|
discover finds nothing |
Pass your LAN's subnet (like 192.168.1.0/24), not Docker's. Check that the PVS is online and on your Wi-Fi or Ethernet; one that only uses its cellular modem can't be reached locally. |
| Log says "The PVS rejected the password" | Set PVS_PASSWORD to the last 5 characters of the serial on the PVS label. |
| Log says "Can't reach the PVS…" | The PVS's address probably changed. Re-run discover, update .env, and reserve the address in your router. |
| Page or app: "Can't reach the collector" | Is the phone on the same Wi-Fi, or on Tailscale? Does curl http://<collector>:8787/api/health work from another device? |
| "This collector needs its API token" / "HTTP 401" | The token entered in the page or app doesn't match API_TOKEN. |
| Status shows "Stale" | The collector is running but can't read the PVS. Check docker logs photonlog. |
API #
GET / serves the web UI. All /api/ responses are JSON. Times can be given as epoch seconds, YYYY-MM-DD (local midnight), or an ISO datetime. If API_TOKEN is set, every endpoint except /api/health needs Authorization: Bearer <token>.
| Endpoint | Returns |
|---|---|
GET /api/health |
Poller status, PVS model and firmware, date range of recorded data |
GET /api/current |
Live kW, today's totals, lifetime meters |
GET /api/energy?interval=hour|day|week|month|year&start=…&end=… |
Energy per bucket plus totals |
GET /api/power?interval=5min|15min|hour&start=…&end=… |
Average power per bucket |
GET /api/panels?date=YYYY-MM-DD |
Per-panel daily and hourly energy, peak, 7-day average, latest readings |
How it works #
The PVS6 uploads telemetry to SunStrong's cloud, and SunStrong Connect queries history back over GraphQL (FetchAggregationEnergy, FetchPowerData, Panels). The subscription check is server-side, so no app tweak can restore the old analytics.
The PVS also has a local HTTPS API:
| What | Request |
|---|---|
| Log in | GET /auth?login with Basic auth ssm_owner:<last 5 of serial>. Returns an expiring session cookie; the collector re-logs in on 401. |
| Live site data | GET /vars?match=/sys/livedata/&fmt=obj, updated ~every second. |
| Per-panel and meter data | GET /vars?match=/sys/devices/&fmt=obj, updated every 5 minutes. |
| Serial number | GET /vars?name=/sys/info/serialnum (no login). |
The collector polls live data every 30 seconds and panels every 5 minutes, computing each period's energy from the difference in lifetime counters between start and end.
Development #
collector/ Rust collector: a single static binary
src/ pvs.rs (PVS client), store.rs (SQLite), analytics.rs, server.rs,
discover.rs, tz.rs (built-in timezone rules), main.rs
web/ the web UI: one HTML file (plain JS, SVG charts), compiled into the binary
tests/ integration tests + an anonymised real PVS response in fixtures/
android/ Kotlin + Jetpack Compose app
.tangled/workflows/ CI on Tangled (collector tests)
# Collector (Rust; rust-toolchain.toml pins the version, rustup installs it)
cd collector && cargo test && cargo clippy --all-targets
cargo run -- discover # or run the collector: PVS_HOST=... TZ_NAME=... DB_PATH=./dev.db cargo run
# Android app (JDK 17+, Android SDK with platform 36)
cd android && ./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk