ecoflow-comprehensive-guide

EcoFlow Software Protocols & Communication

This document outlines the software layers used by EcoFlow devices, primarily focusing on the MQTT and Protobuf implementations that allow for monitoring and control.

1. Overview

EcoFlow devices generally operate in two modes:

2. MQTT Protocol

The core communication transport is MQTT.

Topic Structure

Common topics observed in reverse engineering:

3. Data Payload: Google Protobuf

Unlike simple JSON-based MQTT implementations, EcoFlow uses Google Protocol Buffers (Protobuf) for the message payload. This makes the data binary and unreadable without the correct .proto definition files.

Decoding the Data

To decode the payloads, you need the schema. Community projects have reverse-engineered these schemas.

Key Repositories for Protobuf Definitions:

  1. foxthefox/ioBroker.ecoflow-mqtt: Contains extensive JavaScript/TypeScript definitions for various device properties.
  2. tolwi/hassio-ecoflow-cloud: Python-based implementation for Home Assistant, containing logic to parse these binary streams.

Example Protobuf Concepts

A typical message might contain fields for:

Tooling for Protobuf:

4. Local Access via Scripting

While official local API access is limited, you can use scripts to bridge the cloud data to your local system.

Getting Credentials

You can use the ecoflow-token script from community repositories to exchange your email/password for the MQTT keys:

# Conceptual usage
python3 get_token.py --email "user@example.com" --password "secret"

đź“¶ Direct Connection Mode (No Cloud)

When you press the IoT button to enter Direct Mode, the EcoFlow creates its own Wi-Fi Access Point (e.g., EcoFlow_XXXX).

🛡️ Tricking the Device (Local MQTT Redirect)

Using Adguard or Pi-hole, you can redirect the DNS for mqtt-e.ecoflow.com to your local machine running a Mosquitto server.

  1. DNS Rewrite: Point mqtt-e.ecoflow.com to your local IP.
  2. Certificate: Create a self-signed certificate for the local broker.
  3. Observation: The device will connect to your local broker, allowing you to intercept all telemetry and send commands directly without the EcoFlow cloud.
  4. Reference: See the local-powerstream repository for a pre-configured docker setup.

🔑 Official Local API Access

Believe it or not, EcoFlow support has been known to grant local API access upon request.

5. Bluetooth Low Energy (BLE)

Devices also advertise over BLE.