EcoFlow BLE (Unofficial)

Good news is the previous issue (not updating sensors) hasn’t shown up again, but there is a new possibly related issue.

So, I’m not sure if this is related to the previous fix/change (or just another quirk of my environment), but the grid output value for the SHP2 doesn’t appear to be initialized/reset to zero. If I reconnect it shows as unknown, which isn’t a big deal, but the bigger problem is if it changes from a numeric value to 0 (like when it switches to battery from grid) it doesn’t update either, and stays “stuck” on the previous value until either I start using grid power again, or I reload the device.

Basically the samething on 2025.2.5, the D3 1500 just does not respond to the auth status request as Gnox said. What I did notice because I didn’t disable my other EF devices I don’t see

autoAuthentication: Sending secretKey consists of user id and device serial number

like I do for my other EF devices that do work. I’m assuming it cause auth protocol is slightly different from other gen 3 devices.

@GnoX and @Rabit, If I can figure out how to get a BT Wireshark capture of the BT pairing process after an IOT reset on the D3 1500, would that help or is this something that REALLY needs to be in hand to figure out?

2025-05-20 20:20:17.848 INFO (MainThread) [custom_components.ef_ble.eflib.devices.delta3 - E4:B3:23:96:4C:82] Connecting to Delta 3
2025-05-20 20:20:17.848 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Connecting to device
2025-05-20 20:20:18.213 WARNING (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Disconnected from device
2025-05-20 20:20:24.141 WARNING (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Disconnected from device
2025-05-20 20:20:30.370 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Connected
2025-05-20 20:20:30.729 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Init completed, starting auth routine...
2025-05-20 20:20:31.045 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Disconnecting from device
2025-05-20 20:20:33.764 WARNING (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Disconnected from device

The latest fix wouldn’t affect this. I think what’s happening is that SHP2 omits grid output from messages if the value is 0 and because we only update sensors if fields are present in messages, we don’t detect this change. Did grid output ever change to 0? In the latest version, you can enable logging option Log deserialized device update messages to see raw messages in logs and look at values of ProtoTime.watt_info.grid_watt. If you can confirm that it only changes when the power is 0, we can set the sensor to 0 every time it is omitted.

It does not necessarily need to be in hand, but it will likely involve some experimentation, modified apk with rooted android device and possibly access to secret keys for packet decryption. This is little bit out of my expertise though, I have only poked around the unmodified apk so @Rabit will probably be able to provide better guidance.

It updates when there is a value (i.e. the SHP2 is using grid power), but your assumption is correct that it doesn’t send a 0 value from the device when pulling only from battery. On battery, it just doesn’t send grid_watt, so I think your suggested fix of setting it to 0 when it isn’t received as part of the next update would be the solution for this problem.

Here is the JSON payload when it has data: watt_info {
grid_watt: 602
ch_watt: 0
ch_watt: 0
ch_watt: 0
all_hall_watt: 602
}

and here it is without:
watt_info {
ch_watt: -457
ch_watt: 0
ch_watt: 0
all_hall_watt: 460
}

It appears to add a negative ch_watt in the first element for the value coming in from battery (the -457), so it’s possibly you could use that to update the grid sensor to 0 as well.

Thanks again for all your work on this, appreciate it very much.

Ok, I made it update to 0 if it is missing from the message and made a PR - will be fixed in the next release. You can check if it works by installing Release v0.15.0-a.1 · GnoX/ha-ef-ble · GitHub from my fork.

Thanks for the quick fix. Unfortunately I’ll be out of town until Tuesday, so will give it a try when I get back.

Hi @sidjohn1 , yeah in theory that would help: so to capture the bluetooth between the app and the device I used slightly modified (to replace log encryption key to my one and enable additional logging) version of the ecoflow app (but probably you would not need to, because we know how the session key is transferred now, so you can decode it just by the known userid+device id) and built-in android bt snooper: you can enable it through developer options and then disable/enable bluetooth on the phone to apply the setting, then execute the actions with the app, disable bluetooth and then find the capture in designated folder.

But that could be a complicated one to do… So probably you will need to read about bt capturing on android - there are tons of articles about that.

1 Like

@Rabit and @GnoX,
I tried a different BT adapted to see if I would get anything different, I tried a LM Technologies LM1010 (BCM20702A0) and I got a an actual error this time. “Failed to connect to the device: failed to discover services, device disconnected”
Its a start, at least we know why it’s disconnecting and if I’m reading the bleak output correctly it might be pairing :sweat_smile:

2025-05-23 20:18:24.866 DEBUG (MainThread) [custom_components.ef_ble.config_flow] Confirm discovery: EF-D30753, {'user_id': 'userid', 'login': {'email': '', 'password': ''}, 'address': 'EF-D30753 (E4:B3:23:96:4C:82)', 'update_period': 1, 'log_options': {'log_masked': False, 'log_connection': True, 'log_messages': True, 'log_packets': True, 'log_payloads': True, 'log_encrypted_payloads': True, 'log_bleak': True}}
2025-05-23 20:18:24.869 INFO (MainThread) [custom_components.ef_ble.eflib.devices.delta3 - E4:B3:23:96:4C:82] Connecting to Delta 3
2025-05-23 20:18:24.869 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Connecting to device
2025-05-23 20:18:24.869 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to device @ E4:B3:23:96:4C:82
2025-05-23 20:18:25.652 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Connected
2025-05-23 20:18:25.981 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] MTU: 500
2025-05-23 20:18:25.985 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Init completed, starting auth routine...
2025-05-23 20:18:25.985 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] initBleSessionKey: Pub key exchange
2025-05-23 20:18:25.987 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Sending: '5a5a00012c000100b7662222fd81dd3afcead094e859bed8bf5cdff6c77e8020171c641d343c5515721e8a24d4e7c6453851'
2025-05-23 20:18:26.322 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] parseSimple: Data: '5a5a00012d00010000404f1399d3ad60ad470f1ca55bfc2cf28bb9757210371d7dbaa327bd4cc9d0c47241c7d29d404616056e'
2025-05-23 20:18:26.326 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] getKeyInfoReq: Receiving session key
2025-05-23 20:18:26.326 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Sending: '5a5a000103000286c2'
2025-05-23 20:18:26.657 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] parseSimple: Data: '5a5a0001230002a9fc4f9a69c296fd3d0ef2785b052ccbd03392dfe27b148850fe42c48bc923b4b4c6'
2025-05-23 20:18:26.658 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] getKeyInfoReq: Receiving auth status
2025-05-23 20:18:26.658 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Sending packet: Packet(0x21, 0x35, 0x35, 0x89, bytes.fromhex(''), 0x01, 0x01, 0x03, b'\x00\x00\x00\x00', 0x00)
2025-05-23 20:18:26.658 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Sending: '5a5a10012200c782c29d3fe361e59eb97b4625eb630c395f945920be50e09a79f9851e937b77e40e'
2025-05-23 20:18:35.201 WARNING (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Disconnected from device
2025-05-23 20:18:35.202 WARNING (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Reconnecting to the device in 10 seconds...
2025-05-23 20:18:45.204 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Reconnecting to device
2025-05-23 20:18:45.205 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to device @ E4:B3:23:96:4C:82
2025-05-23 20:18:46.253 INFO (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Disconnecting from device
2025-05-23 20:18:49.506 ERROR (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Failed to connect to the device: failed to discover services, device disconnected
2025-05-23 20:18:49.510 WARNING (MainThread) [custom_components.ef_ble.eflib.connection - E4:B3:23:96:4C:82] Disconnected from device
2025-05-23 20:18:50.290 DEBUG (MainThread) [bleak.backends.bluezdbus.manager] received D-Bus signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded (/): ['/org/bluez/hci0/dev_E4_B3_23_96_4C_82', {'org.freedesktop.DBus.Introspectable': {}, 'org.bluez.Device1': {'Address': <dbus_fast.signature.Variant ('s', E4:B3:23:96:4C:82)>, 'AddressType': <dbus_fast.signature.Variant ('s', public)>, 'Name': <dbus_fast.signature.Variant ('s', EF-D36E0753)>, 'Alias': <dbus_fast.signature.Variant ('s', EF-D36E0753)>, 'Paired': <dbus_fast.signature.Variant ('b', False)>, 'Bonded': <dbus_fast.signature.Variant ('b', False)>, 'Trusted': <dbus_fast.signature.Variant ('b', False)>, 'Blocked': <dbus_fast.signature.Variant ('b', False)>, 'LegacyPairing': <dbus_fast.signature.Variant ('b', False)>, 'Connected': <dbus_fast.signature.Variant ('b', False)>, 'UUIDs': <dbus_fast.signature.Variant ('as', ['00000001-0000-1000-8000-00805f9b34fb', '00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb'])>, 'Adapter': <dbus_fast.signature.Variant ('o', /org/bluez/hci0)>, 'ServicesResolved': <dbus_fast.signature.Variant ('b', False)>}, 'org.freedesktop.DBus.Properties': {}}]

I just wanted to thank the devs here for the tremendous work on getting this off the ground so quickly.

The fulfillment of my request for changing the polling data intervals (I set mine to 5s, plenty of data points, maybe still too much for my limited purposes) along with disabling unnecessary entities, has resulted in a 700mb reduction in the .db file!

And I want to say it’s all thanks to @GnoX - his tireless efforts moving this project forward and he literally rewrote most of the project’s logic and moved it to modern python. So just wanted to express my gratefulness and unshakable confidence in community and that the opensource is “the way”)

2 Likes

@GnoX The reset to zero functionality is working (slight issue this morning, with connectivity, but resolved by reboot so think it was just my machine) correctly for the grid input (and I believe all other elements). Thanks again for the quick response on getting this addressed

Hi @Rabit ! Thanks for working on this project. I tried to add the new Costco exclusive model but it could not be found. I use an esp32 bluetooth proxy. Bermuda finds it as EF-R3P75623. Should it already be working or does the integration need to be updated? SN prefix is R635. Apparently has a 286Wh battery. Thanks!

Hey, seems I missed it when I was going through serial numbers. Should be added soon - PR is already up. You can try installing version Release v0.15.1 · GnoX/ha-ef-ble · GitHub from my fork to verify that it works.

edit: Already released in the main repo as Release Release v0.4.12 · rabits/ha-ef-ble · GitHub

2 Likes

Wow, awesome news. Thanks! Confirming. I just added the new version and the R635 showed up w/o any problems.

Maybe, I’m just an idiot, but I can’t manage to get the user ID in the integration. When trying to use the built in Login function, it just keeps telling me that the user ID can’t be blank ( and putting non-sense into the user ID and hoping it pulls from the user name/password doesn’t work eitheir). I tried going and pulling it manually but when trying to get the user ID with the Dev Console I saw no posts/request for the URL in the documentation.

Ooh, that’s definitely my bad, will be fixed in the next version. It does not work when you add the device from discovery, but should work when you add it manually with Add integration and Setup another instance.

1 Like

Thank You ! After doing that it worked perfectly fine.

@GnoX I was wondering if this will work with the Delta Pro 3600W Power Station and Smart Home Panel 1? With the latest issues on the Ecoflow cloud and app, I would like to fine a local options. This look promising as a solution.
Thanks

Hello, so, if is is able to connect to the ecoflow app over bluetooth, it is definitely possible to add support for it, but the problem is that our current implementation can only connect to some gen 3 devices we either had physical access to or straight worked with our current implementation (Delta 3 Pro).

Gen 2 devices (and even some gen 3 devices, i.e. Delta 3 1500 or Powerstream) use slightly different authentication procedure that needs to be reverse engineered. It is possible to do this remotely, but it is not easy and could be unsafe to both the device owner and developer, see my mesage over at github issue for Delta 2 Pro support. I will still attempt to do it remotely and I’m preparing for it at the moment, but it will take some time until I figure everything out. Though it would be great if someone with the device would be able to do it themselves - some info on what was used to do it available in this repo.

On the other note, I did prepare a way to check if currently unsupported devices are compatible with our current implementation here.

Thanks for the response. I will review the links and go from there.