HUB
Sign inSign up
jinko_exporter logo

rcooler/jinko_exporter

By rcooler

โ€ขUpdated 16 days ago

Read-only Jinko/Solarman solar inverter bridge for Prometheus and Home Assistant.

Image
1

3.0K

rcooler/jinko_exporter repository overview

JinkoBridge

โ Quick overview

JinkoBridge (jinko_exporter) is an unofficial read-only bridge for Jinko and compatible Solarman-backed solar telemetry. It supports the Jinko cloud, Solarman OpenAPI, and a locked local Solarman V5/Modbus profile with failover between them, exposes Prometheus metrics on /metrics, and can publish Home Assistant MQTT Discovery entities. It never sends control commands to the inverter.

  • Images for linux/amd64 and linux/arm64, published as rcooler/jinko_exporter.
  • Source, documentation and Home Assistant cards: GitHubโ 

โ Changelogโ 

โ 1.2.0 - 2026-11-11
  • Added an optional upstream Shelly Pro 3EM grid-input meter and stabilizer support in the Home Assistant cards.
  • More local Modbus telemetry: UPS phase and total values, internal grid power, signed external CT readings, verified BMS mirrors and firmware metadata.
  • Shelly telemetry stays live independently of the inverter; stale and offline cloud telemetry is rejected.
  • Persistent MQTT discovery state and additional diagnostics.
  • Bridge migrated to Go 1.27 (built with 1.27.4); cards migrated to TypeScript 7 and Vite 8 and now show the net daily grid balance.
โ 1.1.0 - 2026-08-17
  • Added the local Solarman V5/Modbus source with hardened failover between the local, Jinko and Solarman sources.
  • Added Shelly Pro 3EM grid-load metering.
  • Added a new Home Assistant cards package.
  • Hardened release verification and packaging.

Full history: GitHub Releasesโ 

โ Installation

โ Local-first Docker Compose

This example contains placeholders only. Create the referenced secret files locally; do not put tokens or passwords in Compose environment values or commit them to source control.

services:
  jinko_bridge:
    image: rcooler/jinko_exporter:latest
    container_name: jinko_bridge
    restart: unless-stopped
    stop_grace_period: 40s
    ports:
      - "9876:9876"
    read_only: true
    tmpfs:
      - /tmp
    volumes:
      - ./state:/var/lib/jinko-bridge
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    environment:
      EXPORTER_SOURCE_PRIORITY: "modbus,jinko,solarman"
      EXPORTER_LISTEN: ":9876"
      EXPORTER_POLL_INTERVAL: "60s"
      EXPORTER_METRICS_DROP_SOURCE_LABEL: "true"

      MODBUS_HOST: "<INVERTER_LAN_IP>"
      MODBUS_PORT: "8899"
      MODBUS_LOGGER_SERIAL: "<LOGGER_SERIAL>"
      MODBUS_DEVICE_SN: "<INVERTER_SERIAL>"
      MODBUS_UNIT_ID: "1"
      MODBUS_TIMEOUT: "5s"

      JINKO_DEVICE_ID: "<JINKO_DEVICE_ID>"
      JINKO_SITE_ID: "<JINKO_SITE_ID>"
      JINKO_REFRESH_TOKEN_FILE: "/run/secrets/jinko_refresh_token"
      JINKO_TOKEN_STATE_FILE: "/var/lib/jinko-bridge/jinko-token-state.json"

      SOLARMAN_APP_ID: "<SOLARMAN_APP_ID>"
      SOLARMAN_APP_SECRET_FILE: "/run/secrets/solarman_app_secret"
      SOLARMAN_EMAIL: "<SOLARMAN_ACCOUNT_EMAIL>"
      SOLARMAN_PASSWORD_FILE: "/run/secrets/solarman_password"
      SOLARMAN_DEVICE_SN: "<INVERTER_SERIAL>"

      # Required as one stable, source-independent identity when MQTT is used
      # with more than one priority source.
      # MQTT_ENABLED: "true"
      # MQTT_DEVICE_ID: "<STABLE_HOME_ASSISTANT_DEVICE_ID>"
      # MQTT_BROKER: "tcp://homeassistant.local:1883"
      # MQTT_USERNAME: "<MQTT_USERNAME>"
      # MQTT_PASSWORD_FILE: "/run/secrets/mqtt_password"
    secrets:
      - jinko_refresh_token
      - solarman_app_secret
      - solarman_password
      # - mqtt_password

secrets:
  jinko_refresh_token:
    file: ./secrets/jinko_refresh_token
  solarman_app_secret:
    file: ./secrets/solarman_app_secret
  solarman_password:
    file: ./secrets/solarman_password
  # mqtt_password:
  #   file: ./secrets/mqtt_password
โ Sources

All three source configurations are required when all three appear in EXPORTER_SOURCE_PRIORITY. Run one supervised Modbus-only fetch before enabling the long-running local-first chain. The local profile uses one fresh connection per fetch, fixed FC03 reads only, and no write or arbitrary-register path. It targets the JKS-6/8/10/12/15/20H-EI family shape; only the 12 kW target has been fully live-correlated.

EXPORTER_METRICS_DROP_SOURCE_LABEL=true also enables primary-surface projection by default, keeping ordinary Prometheus key/group/name/unit labels stable through failover. Jinko token expiry tracking, and token rotation when refresh is configured, continues in serve even while Modbus supplies every snapshot, without making Jinko detail requests while the local source is healthy. The private writable state mount is therefore required when automatic refresh is enabled.

Full setup and source-specific requirements: installationโ  ยท configurationโ 

โ Prometheus scrape job
  - job_name: 'jinko'
    scrape_interval: 60s
    static_configs:
      - targets: ['jinko_bridge:9876']
โ Endpoints
http://localhost:9876/metrics
http://localhost:9876/healthz
http://localhost:9876/readyz

โ PS

  • The HTTP listener has no authentication and MQTT state carries device serials and site IDs. Run the bridge on a private network only.
  • Modbus validation evidence and open hardware-dependent work: Modbus validationโ .
  • Data may be delayed, incomplete, renamed by upstream services, or unavailable. Use official vendor applications and certified equipment for safety-critical, warranty, regulatory, billing, or operational decisions.

MIT licensed. JinkoBridge is an unofficial DIY open-source project and is not affiliated with, endorsed by, sponsored by, or supported by Jinko Solar, Solarman, Deye, or any related 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:018a91938โ€ฆ

Size

9.3 MB

Last updated

16 days ago

docker pull rcooler/jinko_exporter