Skip to main content

Self-hosted dashboard for the SolisCloud (Ginlong Solis) platform

Project description

Solisdash

CI

Self-hosted web dashboard for the SolisCloud (Ginlong Solis) platform. Live tiles on top, historical charts and an alarm feed below. FastAPI + HTMX + Jinja2 + Pico CSS, MongoDB-backed, with an in-process APScheduler poller.

What you get

  • Live tiles — current power, today's yield, this-month yield, battery SOC, open alarms. Refreshed every 30 s via HTMX; falls back to the most recent stored sample when SolisCloud rate-limits.
  • History charts — day (5-min granularity), month (daily totals), year (monthly totals), all-time (yearly totals). Reads MongoDB only, no upstream calls on the chart path.
  • CSV export for any chart view.
  • Alarm feed paginated and filterable by station + state.
  • In-process poller (APScheduler) that pulls stationDetail every 5 min and alarms on the same cadence, plus a nightly daily-rollup job at 00:30 UTC. Rate-limited via a shared TokenBucket.
  • Session-cookie auth (bcrypt) with an invoke add-user CLI.
  • /health (liveness) and /ready (Mongo + scheduler) probes.
  • Dark-mode toggle that persists per-browser.

Quick start

  1. cp .env.example .env and fill in:
    • SOLIS_KEY_ID / SOLIS_KEYSECRET from SolisCloud → Account → Basic Settings → API Management.
    • SOLIS_API_URL — the region-specific base URL (EU: https://www.soliscloud.com:13333).
    • SOLIS_MONGODB_URI — a non-prod MongoDB Atlas cluster.
    • SESSION_SECRET — generate with python -c "import secrets; print(secrets.token_urlsafe(32))".
    • Optional: RUN_SCHEDULER=true to enable the in-process poller, SOLIS_STATION_ID to pin the dashboard to one station.
  2. uv sync --extra dev
  3. Seed your first admin: uv run python -m invoke add-user --username you --role admin
  4. Pick one:
    • Desktop windowuv run solisdash opens the app in a native pywebview window with menus and the sun icon. Closes when you quit the window. Best for "me using it from my laptop".
    • Detached serveruv run python -m invoke start runs uvicorn in the background, log at var/uvicorn.log, lifecycle via stop / restart / status. Best for hosting on a small VPS.
  5. Visit http://127.0.0.1:8000 (or whatever port solisdash printed — it picks a free one by default).

Pages

Path Notes
/ Live tile dashboard (auth-gated).
/history Day / month / year / all-time charts with a download-CSV link.
/alarms Filterable alarm feed (auth-gated).
/login, /logout Session cookie auth.
/health, /ready Liveness + readiness probes.

solisdash CLI

uv run solisdash                   # open the dashboard in a pywebview window
uv run solisdash --no-window       # serve uvicorn in the foreground (ssh / headless)
uv run solisdash --port 8000       # pin the port instead of letting the OS pick
uv run solisdash --debug           # pywebview dev tools + debug uvicorn logging

The pywebview window picks a free port by default, ships a native menu bar (File / View / Help with Dashboard / History / Alarms shortcuts), and uses the bundled sun icon on the dock / taskbar.

Invoke tasks

uv run python -m invoke start           # detached uvicorn
uv run python -m invoke stop / restart / status
uv run python -m invoke test            # full suite under pytest-xdist
uv run python -m invoke lint            # ruff + mypy
uv run python -m invoke add-user --username … --role admin|user
uv run python -m invoke poll-once       # one-shot stationDetail pull
uv run python -m invoke backfill --start YYYY-MM-DD --end YYYY-MM-DD

Layout

  • src/solisdash/ — application package
    • app.py — FastAPI app, lifespan, routes
    • client.py — async SolisCloud client (HMAC-SHA1 signing, retry/backoff)
    • signing.py — HMAC-SHA1 signing helper, pinned to the V2.0.3 worked example
    • db.py — Mongo connection + index schema
    • auth.py — bcrypt hashing, session helpers, FastAPI deps
    • config.py — pydantic-settings facade
    • tiles.py, history.py, alarms.py — page-specific services
    • poller.py, ratelimit.py, scheduler.py — APScheduler poller + token bucket
    • templates/, static/ — Jinja2 + Pico CSS
  • tests/ — pytest suite (160 tests, parallel-safe under pytest-xdist)
  • tasks.py — invoke build/admin tasks
  • tasks/todo.md — build plan (every step ticked through Polish)
  • CLAUDE.md — project conventions for Claude Code sessions
  • SolisCloud Platform API Document V2.0.3.pdf — upstream API spec (source of truth)

Development

uv run python -m invoke lint    # ruff + mypy
uv run python -m invoke test    # pytest -n auto

CI runs the same against a mongo:7 service container in GitHub Actions on every push and PR to main.

License

GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). Network use is distribution — if you run a modified version of Solisdash on a server users interact with, they're entitled to the modified source.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solisdash-0.7.3.tar.gz (160.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solisdash-0.7.3-py3-none-any.whl (67.4 kB view details)

Uploaded Python 3

File details

Details for the file solisdash-0.7.3.tar.gz.

File metadata

  • Download URL: solisdash-0.7.3.tar.gz
  • Upload date:
  • Size: 160.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for solisdash-0.7.3.tar.gz
Algorithm Hash digest
SHA256 a4039c380ddd64a0dc3dd601f63f9bf7bc5980136a33cef13251edc7b3f7eb69
MD5 3f16d932a7029c0ad2e7adff4e88cd77
BLAKE2b-256 9d19fe59e2c2372d852dc68c2a3225ccbeaa2bc096bf297acd46f8d5b1ff6db8

See more details on using hashes here.

Provenance

The following attestation bundles were made for solisdash-0.7.3.tar.gz:

Publisher: release.yml on jdrumgoole/solisdash

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solisdash-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: solisdash-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 67.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for solisdash-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 82367d0223cc7e1a963d65e8946b9d26712cd32adaa4d99cac20852548f0dd36
MD5 bb18fbd51ef31167e6d6c85fd89ddd88
BLAKE2b-256 4c425def79794fefb92ea36951ff1fb472ac9d51243d4ced5f60144a5721b744

See more details on using hashes here.

Provenance

The following attestation bundles were made for solisdash-0.7.3-py3-none-any.whl:

Publisher: release.yml on jdrumgoole/solisdash

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page