HUB
Sign inSign up
solarman_exporter logo

rcooler/solarman_exporter

By rcooler

•Updated 8 months ago

A simple Prometheus exporter for SOLARMAN Smart metrics to Prometheus

Image
Internet of things
Monitoring & observability
1

1.3K

rcooler/solarman_exporter repository overview

This project evolved into rcooler/jinko_exporter⁠ (JinkoBridge), which keeps the Solarman OpenAPI as one of its sources and adds the Jinko cloud, a local Solarman V5/Modbus source with failover between them, and Home Assistant MQTT Discovery. New installations should use rcooler/jinko_exporter. Its configuration variables and metric names differ from this image, so treat it as a new installation.

The guide below describes the last solarman_exporter image.

SolarMan 2 Prometheus

⁠Quick overview

solarman_exporter is a simple Prometheus exporter for SOLARMAN Smart (Solarman OpenAPI). It polls Solarman Cloud on a fixed interval, caches the result, and exposes metrics for Prometheus and Grafana; a scrape never hits the Solarman API.

  • Solarman OpenAPI token authentication (the password is SHA256-hashed).
  • Auto-discovery of stations and their devices, or device serial numbers set manually.
  • Metric groups: pv, inverter, grid, battery, bms, gen, load (UPS), house.
  • Source and documentation: GitHub⁠

⁠Changelog⁠

⁠2026-04-05
  • Added configuration to limit API usage (the free Solarman API allows 200k requests per year).

Full history: commits on GitHub⁠. Development continues in JinkoBridge: releases⁠.

⁠Installation

⁠Credentials and prerequisites
  1. A Solarman Smart account (email and password) in which the plant and device are already visible.
  2. Solarman OpenAPI credentials (appId and appSecret). They are not shown in the Solarman Smart UI; request them from Solarman⁠.
  3. Optionally the datalogger or inverter serial number, from the device sticker or the Solarman Smart device list.
⁠Docker Compose
services:
  solarman_exporter:
    image: rcooler/solarman_exporter:latest
    container_name: solarman_exporter
    restart: unless-stopped
    environment:
      # --- Solarman OpenAPI ---
      SOLARMAN_BASE_URL: "https://globalapi.solarmanpv.com"
      SOLARMAN_API_VERSION: "v1.0"
      SOLARMAN_LANGUAGE: "en"

      SOLARMAN_APP_ID: "${SOLARMAN_APP_ID}"
      SOLARMAN_APP_SECRET: "${SOLARMAN_APP_SECRET}"
      SOLARMAN_EMAIL: "${SOLARMAN_EMAIL}"

      # Use ONE of these:
      SOLARMAN_PASSWORD_SHA256: "${SOLARMAN_PASSWORD_SHA256}"
      # SOLARMAN_PASSWORD: "${SOLARMAN_PASSWORD}"

      # Optional (if auto-discovery doesn't work):
      # SOLARMAN_DEVICE_SN: "1234567890,0987654321"
      # SOLARMAN_STATION_ID: "0"

      # Exporter runtime
      SOLARMAN_POLL_INTERVAL: "160s"
      SOLARMAN_HTTP_TIMEOUT: "15s"
      SOLARMAN_YEARLY_REQUEST_LIMIT: "200000"
      SOLARMAN_DISCOVERY_REFRESH_INTERVAL: "24h"
      SOLARMAN_ENABLE_GENERIC: "true"
      SOLARMAN_EXPORTER_LOG_LEVEL: "info"
      SOLARMAN_EXPORTER_METRICS_PATH: "/metrics"
      SOLARMAN_EXPORTER_LISTEN: ":9876"
    ports:
      - "9876:9876"
⁠Prometheus scrape job
  - job_name: 'solarman'
    scrape_interval: 160s
    metrics_path: /metrics
    static_configs:
      - targets: ['solarman_exporter:9876']
⁠Metrics

Each group exposes solarman_<group>_metric{device_sn,key,name,unit}: solarman_pv_metric, solarman_inverter_metric, solarman_grid_metric, solarman_battery_metric, solarman_bms_metric, solarman_gen_metric, solarman_load_metric (UPS/backup output) and solarman_house_metric (home consumption).

The generic solarman_metric{device_sn,key,name,unit} stream is optional; switch it with SOLARMAN_ENABLE_GENERIC.

⁠PS

  • Solarman API payloads vary by inverter model; grouping is keyword and unit based.
  • Label-heavy metrics can increase Prometheus cardinality. Prefer the grouped metrics and disable the generic stream if needed.
  • Keep the poll interval in line with the yearly request limit of your Solarman API plan.

MIT licensed. Independent open-source project, not affiliated with, endorsed by, or sponsored by Solarman or any inverter vendor. Product names are trademarks of their respective owners and are used only to describe compatibility and integration.

Tag summary

Content type

Image

Digest

sha256:5e1a58cc9…

Size

12.8 MB

Last updated

8 months ago

docker pull rcooler/solarman_exporter