An off-box watchdog for the EcoFlow DELTA 3 Plus AC output.
Problem. The Delta 3 Plus can switch its own AC output off with mains present. If the thing that would normally notice (in my case Home Assistant, plus both Proxmox hosts) is powered by the Delta, it dies with it and nothing turns the output back on. So the watchdog runs on a host that is not behind the Delta and talks to the unit through EcoFlow's cloud MQTT broker directly.
What it does. Logs in to the EcoFlow private API with your app account, connects to the
EcoFlow MQTT broker over TLS, subscribes to the unit's telemetry, decodes the protobuf
DisplayPropertyUpload (flow_info_ac_out 14 = on, 4 = off, the same derivation the Home
Assistant ecoflow_cloud integration uses) and, when the output reads off for 15 s or more,
publishes the same cfg_ac_out_open = 1 packet the Home Assistant switch sends. It retries every
20 s while the output is still off, capped at 12 commands an hour. Once the output is back it
raises a persistent notification and a push through Home Assistant, queued until Home Assistant
is reachable again. Nothing else is ever written to the unit.
Polling. The unit pushes flow_info_ac_out only about once a minute, but a "get all" request
(thing/property/get) is answered in ~40 ms with the full snapshot, so the watchdog requests one
every 15 s. Detection latency is roughly 15 s poll plus 15 s dwell.
~/.efwatch/pauseexists: observe only.- The Home Assistant
input_booleannamed in config is off: observe only (cached 60 s; Home Assistant unreachable counts as armed). - Battery below 7 %: do not act (nothing to restore).
plug_in_info_ac_in_flagis not used as a mains gate; on this firmware it reads 0 even with 240 V on the input.
pip install protobuf paho-mqtt requests
mkdir ~/.efwatch
cp config.example.json ~/.efwatch/config.json # fill in your EcoFlow account and the unit's serialha_env points at a file containing an HA_TOKEN= line (a Home Assistant long-lived token); it
is read at runtime and never copied. Leave ha_url empty to run without Home Assistant.
python efwatch.py # service mode, runs forever
python efwatch.py --once # read-only: print the decoded state for ~40 s
python efwatch.py --send-on # send one AC-on command (no-op if already on) and exit
python efwatch.py --dry-run # service mode, logs "would send" instead of sending
Logs rotate in ~/.efwatch/efwatch.log (local time); ~/.efwatch/state.json holds the latest
decoded readings.
Run it as a service however your host does that. On Windows a Task Scheduler task at logon with
pythonw.exe efwatch.py, restart on failure, works.
Needs the watchdog host up, internet, and the unit's own Wi-Fi link to the EcoFlow cloud (the unit stays online with its AC output off if its unit timeout is set to Never). It restores the output in roughly 20 to 40 s; it cannot stop the firmware cutting it in the first place. A second, hardware layer (an ESP32 doing the same over MQTT, powered from somewhere else) is the belt-and-braces.
efwatch.py: the watchdog.ef_delta3_pb2.py: generated protobuf schema, vendored from tolwi/hassio-ecoflow-cloud 1.7.2 (Apache-2.0).config.example.json: config template.
MIT for efwatch.py. ef_delta3_pb2.py is Apache-2.0, see above.