External integration - EcoFlow

:battery: New integration: EcoFlow (River 2 / River 2 Max / River 2 Pro)

Note: the block in the bottom left is a smart plug in front of the EcoFlow, which I used before the integration.

An external integration to monitor and control your EcoFlow River 2 series stations directly from Gladys, via the EcoFlow cloud (the same one used by the official app).

What it does

For each detected device, you get:

  • Battery level (%)
  • AC charging power, total output power, AC output power, incoming solar power
  • Switches: AC output, X-Boost, DC output (cigarette lighter), backup reserve
  • A « Test connection Â» action to check if a device is responding

Two ways to connect

  1. EcoFlow Developer Account (Open Platform) — the official and documented way, with automatic discovery of all devices in the account. Downside: you need to create a developer account and wait for EcoFlow’s approval (~1 week), and some devices already linked to the mobile app may be rejected by EcoFlow (« already assigned Â») — a known and recurring limitation of their platform, independent of the integration.
  2. Simple connection (email/password) — the same credentials as the EcoFlow app, without a developer account or waiting. Unofficial (internal endpoints of the app), so no automatic discovery: the serial number of each device is entered manually. This is the method that unlocks devices rejected by the developer path — tested and functional on a real River 2 Pro (what I use).

Both methods can run at the same time.

Known limitations

  • No local/LAN control: even a device that never leaves your WiFi goes through the EcoFlow cloud, like the official app — confirmed by EcoFlow themselves (the only exception in their entire catalog is the EZ1, an irrigation timer unrelated).
  • No setting of charge/discharge limits or backup reserve level in percentage (read-only for now).
  • The simple method (2) is based on endpoints not documented by EcoFlow: it may break without notice if EcoFlow changes its app.

Installation

Developer mode in Gladys → paste the link GitHub - LM1LC3N7/gladys-ecoflow · GitHub

:locked: Security, maintenance, and reuse

  • Communication in signed HTTPS/MQTT only — no local access or open port on the device
  • Non-root container, read-only file system, npm install without script execution (--ignore-scripts)
  • Credentials stored encrypted by Gladys, never transmitted anywhere other than to EcoFlow
  • CI (lint, tests, build) on every change + automatic dependency updates (Dependabot), image publication on every evolution
  • Request signatures and MQTT protocol cross-checked with two implementations already used by the community (tolwi/hassio-ecoflow-cloud, rustyy/ecoflow-api), validation via the real schemas of @ecoflow-api/schemas

Hey @lmilcent :slight_smile:

Great job on this integration!

Just a small note, this integration is missing a thumbnail:

Ask your Claude to add one :wink:

Thanks, I completely forgot!

EcoFlow Integration for Gladys – version 0.3.0

Presentation

New version of the EcoFlow integration for River 2 stations (River 2, River 2 Max, River 2 Pro). It takes advantage of what Gladys 5.1 brings to external integrations: a dedicated widget on the dashboard, and triggers and actions in the scene editor. Control is still done via the EcoFlow cloud (these stations do not have local control), either with the official Open Platform API or with the simple email/password connection of the application.

What it does today

  • EcoFlow Station Widget: what the station is doing (« On battery · 3 h 10 remaining Â», « Charging · 300 W incoming Â»â€Š), battery gauge and live grid / solar / output power, output status, reserve, charge and discharge limits, and buttons to turn AC and DC outputs on/off.
  • Scene Triggers:
    • grid input cut and restored (useful when the station is used as an inverter);
    • station no longer responding or responding again;
    • charge limit reached.
  • Scene Actions:
    • set charge and discharge limits;
    • set backup reserve;
    • set grid charging power, or pause it (for example to charge only during off-peak hours);
    • read the station on demand, to reuse the battery level and autonomy in the rest of the scene.
  • New Sensors: remaining autonomy and « charging Â», in addition to the battery level, powers and AC / X-Boost / DC / reserve switches.
  • Immediate Feedback: a switch activated in Gladys changes position immediately, then the station is read a few seconds later to confirm.
  • Connection Badge per Device: cloud, degraded cloud (last reading failed) or unreachable.
  • Clear Status in Configuration: each method is actually tested and its result displayed (« Official API: 2 devices · Simple Connection Failed: incorrect password Â»).
  • Diagnostic Action: lists the data returned by the station, without serial number or network info, for bug reports or to add other models.
  • Reliability:
    • a change in credentials is applied without restart, and clearing them really cuts access to EcoFlow;
    • more robust MQTT session;
    • no command sent with made-up values.
  • Docker Image: Node 24, non-root user, read-only file system, multi-architecture (amd64 / arm64, so Raspberry Pi).

Current Limitations

  • Gladys 5.1 Minimum: older versions stay on 0.2.x.
  • Tested in Real Conditions on a Single Model (River 2 Pro, simple connection method). Scene actions, grid cut detection, and remaining autonomy remain to be confirmed on other devices.
  • Update from 0.2.x: an « Update Â» button appears on the device in the Discovery tab, to add the two new sensors. History is preserved.
  • River 2 Range Only for now (no Delta or River 3).
  • No Real-Time: the station is read periodically, every 30 seconds by default.
  • The Simple Connection Uses the Internal Access of the EcoFlow Application and may break without notice if EcoFlow modifies them.

If you have another EcoFlow station, the result of the Diagnostic action posted here would help a lot to add it.

Note: It seems very verbose with pooling every 30s, it’s up to you to decide if you want to keep each state.

EcoFlow Integration – version 0.3.1 (yes, again)

Presentation

A small update following the first feedback on version 0.3.0. The power outage detection has been tested in real conditions on a River 2 Pro and works perfectly. However, a trigger for low battery was missing: here it is.

What’s New

  • New scene trigger « EcoFlow: Low Battery »: It triggers when the battery drops to 50, 30, 20, 10, or 5 %. Choose the level in the « Reached Level » filter; if it is empty, any level triggers the scene.
  • Variables usable in actions: In addition to the battery level and output power, this trigger transmits the reached level and remaining autonomy. For example:
    🔋 EcoFlow at {{triggerEvent.data.battery_level}} %, {{triggerEvent.data.remaining_minutes}} min remaining
  • No burst messages: Each level only triggers once and resets only after the battery rises 5 points above. A battery fluctuating around 20 % will not send you a notification with each reading.
  • More descriptive logs: Each event sent to Gladys is now logged with its data, allowing you to verify what a scene actually received.

Tip

For another threshold (25 %, less than 30 min autonomy
), Gladys’ standard trigger also works:

  1. « Device state change »;
  2. the « Battery Level » or « Remaining Autonomy » feature of the station;
  3. < and your value;
  4. check the option to trigger only when the threshold is crossed, otherwise the scene is triggered with each reading.

Small pitfall: the variables {{triggerEvent.data.
}} remain empty if you launch the scene manually from the editor. They are only filled when the event actually arrives.

Current Limitations

Unchanged from version 0.3.0. Gladys 5.1 minimum, River 2 range only, periodic reading (30 s by default). Scene actions (charge and discharge limits, reserve, grid charging) remain to be confirmed on devices other than mine.