vwt12eh8/hassio-ecoflow

BMS data

Closed this issue · 6 comments

This is not an issue but rather a question:

How exactly does the code fetch the BMS and other data (MMPT and INV)? I cannot find this out by checking the source code. request is only called to get get_serial_main and get_dc_in_current.

I'm still working out how this works myself but it appears that the listening happens in custom_components/ecoflow/ecoflow/rxtcp.py. This class creates a TCP connection to the battery which will then send packets of data about is happening. This binary stream is then converted to something that Home Assistant can use in custom_components/ecoflow/ecoflow/receive.py if you take a look around line 165 you can see where it is converting the binary.

I'm sure someone else can give you better information that I can but it might help you get started.

I get the impression that you are trying to make your own listener and if that is the case something to consider is that Ecoflow have an MQTT server that they host and it is possible to subscribe to that where it send JSON. I was involved in some discussion about it in this ticket in another repo v1ckxy/ecoflow-withoutflow#1 (comment) However using the solution that vwt12eh8 is made is a much nicer solution as it doesn't require an internet connection or Ecoflow's own services.

This is all clear. I can get the PD, EMS, MPPT data via port 8055, but I don't find the code where it queries BMS data. If you check HassioEcoFlowClient you can see that it setups filters for BMS. But HassioEcoFlowClient never sends any commands to port 8055, so I wonder how does it enable that Ecoflow starts sending status data including the BMS.

I also checked it doesn't use a different port for querying status data, HassioEcoFlowClient uses port 8055.

I think I figured it:

def get_bms(): return build2(3, 32, 50)

Would get back the BMS data, but my Ecoflow Delta Pro doesn't reply anything if I send this. PD, EMS etc work.

As far as I can tell, the BMS data is pushed at regular intervals.
However, you need to be aware that it is sent at the same time as other messages.

When a push is performed, multiple messages may be sent in succession.
If there is "0xAA,0x02" as a header, it can be regarded as the beginning of data, but since multiple data may be included in one reception, processing to search the header is required.
Since BMS is almost always sent together with other messages, it is necessary to take measures against continuous sending.

Note that get_bms() works for the RIVER series, but not for the DELTA series.

Sorry I can not explain well.

Thanks, actually after a I connected Ecoflow Delta Pro with the latest Mobile App it started to send data via port 8055 automatically. Before it never did.

So the answer to my question is that Ecoflow sends data by default on port 8055.