Stream AC Pro: protobuf bidirectional control and state decoding#793
Open
jegorden wants to merge 2 commits into
Open
Stream AC Pro: protobuf bidirectional control and state decoding#793jegorden wants to merge 2 commits into
jegorden wants to merge 2 commits into
Conversation
…68) and relay2Onoff (field 380)
…coding - Replace JSON-based BatteryBackupLevel with protobuf command (field 102) - Add _decode_manual_fields to extract state fields not in proto definition: field 461 -> backupReverseSoc (read) field 1628 -> feedGridMode (read) field 380 -> relay2Onoff (read) - Fixes backupReserveSoc and feedGridMode showing as unknown in HA UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The EcoFlow Stream AC Pro uses an internal protobuf MQTT API rather than
the JSON public API for device control. This PR implements bidirectional
control and state reading for the Stream AC Pro via the internal protocol.
What was reverse-engineered
The internal API uses protobuf commands with cmd_id=17, cmd_func=254,
discovered by sniffing MQTT traffic via HA debug logs while making
changes in the EcoFlow app.
Protocol cheat sheet
Changes
_build_proto_command(field_num, value): constructs protobuf commandswith all required header fields
ProtoEnabledEntity: subclass of EnabledEntity that sends raw protobufvia MQTT for feedGridMode and relay2Onoff
ProtoBackupReserveEntity: subclass of BatteryBackupLevel that sendsbackupReserveSoc via protobuf (field 102) instead of JSON
_decode_manual_fields(): extracts state fields not yet in the protodefinition (fields 461, 1628, 380) so HA entities show real values
instead of unknown
Tested on
Still open