Skip to content

Conversation

@serhiioliinyk
Copy link


Summary

This PR adds several improvements developed while running the exporter with two EcoFlow DELTA 2 devices on a home setup.

  1. Multi-device support

Monitor multiple EcoFlow devices from a single exporter instance using comma-separated environment variables:

DEVICE_SN=SN1,SN2
DEVICE_NAME=delta-kitchen,delta-livingroom

  • One EcoFlow account authentication shared across all devices
  • Each device gets its own MQTT connection and message queue running in a daemon thread
  • Prometheus metrics use the device label to differentiate — already present in all existing metrics
  • Thread-safe shared Gauge registry prevents duplicate metric registration errors
  1. Fix: use threading.Thread instead of multiprocessing.Process in idle_reconnect

The previous implementation used multiprocessing.Process to handle reconnection. This fails on systems using the "spawn" start method (macOS, and optionally Linux) because Queue contains thread locks that can't be pickled. Replaced with
threading.Thread(daemon=True) which is also simpler and more portable.

  1. Active data polling via latestQuotas

EcoFlow devices do not push telemetry data autonomously — they only respond when the mobile app is active. Added periodic publish to /app/{user_id}/{device_sn}/thing/property/get with operateType: latestQuotas every 15 seconds. This keeps
metrics flowing without requiring the official app to be open.

  1. Grafana dashboard: bundled in repo with auto-provisioning
  • Forked community dashboard https://grafana.com/grafana/dashboards/17812-ecoflow/ into docker-compose/grafana/dashboards/ecoflow.json
  • Auto-provisioned via compose volume mounts — no manual import needed
  • Added collapsed Extra Battery row with 11 panels for bms_slave.* metrics (for devices with an expansion battery)
  1. nginx reverse proxy option for production deployments

Optional nginx service via Docker Compose profile for hosting behind a domain:

docker compose --profile nginx up -d

Includes configs for both Cloudflare and Let's Encrypt scenarios. Internal services (Prometheus, Alertmanager, exporter) are bound to 127.0.0.1 only.


Note for maintainer: compose.yaml currently has build: .. instead of image: ghcr.io/berezhinskiy/ecoflow_exporter — please revert that line after merging if you publish a new image build.


Serhii Oliinyk and others added 8 commits February 8, 2026 03:01
DEVICE_SN and DEVICE_NAME now accept comma-separated values to monitor
multiple EcoFlow devices from a single exporter instance. Each device
gets its own MQTT connection and worker thread, sharing a single
Prometheus HTTP endpoint via thread-safe gauge registry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Process(target=self.connect) fails on macOS (and Python 3.13+ with
spawn start method) because Queue contains _thread.lock objects that
cannot be pickled. Using a daemon Thread with join(timeout=60) provides
the same timeout safety without serialization issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EcoFlow devices do not push MQTT data autonomously — they require a
latestQuotas request to respond with current metrics. This adds a
periodic request every 15 seconds to keep data flowing without needing
the mobile app open.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fork dashboard 17812 into repo with auto-provisioning via compose.
Added collapsed "Extra Battery" row with 11 panels for bms_slave metrics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Restrict prometheus/alertmanager/exporter ports to 127.0.0.1
- Add optional nginx service via Docker Compose profile
- Include configs for Cloudflare and Let's Encrypt scenarios
- Document three deployment options in README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Serhii Oliinyk and others added 3 commits February 8, 2026 05:09
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant