EcoFlow BLE (Unofficial)

@Rabit Sorry, my bad, got too excited and started trying instead of reading properly :smile:

I just got a SHP2 and DPU setup and Iā€™m looking to get this working! Thanks so much for all the initial work so far. I was able to grab my user ID from the website but I havenā€™t been able to get the integration to work yet.

2024-12-10 15:33:17.987 DEBUG (MainThread) [custom_components.ef_ble.eflib.devicebase] 74:4D:XX:XX:XX:XX: Creating new device: Delta Pro Ultra 'EF-YJ0184ļæ½ļæ½' (XXXXXXXXXXX)
2024-12-10 15:33:17.987 DEBUG (MainThread) [custom_components.ef_ble.eflib.devicebase] A0:DD:XX:XX:XX:XX: Creating new device: Smart Home Panel 2 'EF-HD30120ļæ½' (XXXXXXXXXXXXX)
2024-12-10 15:33:21.489 DEBUG (MainThread) [custom_components.ef_ble] Init EcoFlow BLE Integration
2024-12-10 15:33:26.573 DEBUG (MainThread) [custom_components.ef_ble] Init EcoFlow BLE Integration

Even though I only select my SHP2, a line for the DPU is also present in the logs when I attempt to add it. The UI displays the following:
image

Iā€™m using the ESP32 ble-proxy function for this since itā€™s not near my server. It works at least well enough to detect the devices.

The logs donā€™t show much to go on. Do you have any thoughts on how to dig into this?
Firmware: V4.0.3.27 - V2.0.1.30(Wi-Fi)

Hi @justint223 , yeah, I donā€™t really like the special symbols in the device names in your logā€¦ Maybe proxy doing something not great during passing the devicesā€¦

So since you have debug enabled - it should show much more info in the logā€¦ For example right after Init EcoFlow BLE Integration you should see Connecting Device (as per logic in ha-ef-ble/custom_components/ef_ble/__init__.py at 45d2eeb8c4a3d8fcf54e1eadafc2b175f3b7116d Ā· rabits/ha-ef-ble Ā· GitHub ), but for some reason I see no such logsā€¦

Something that could help you to debug the system:

  • Not quite sure where you reading those logs - but what helps me is to tail -f /conf/home-assistant.log and then try to add device. You can expect exception traces there or some delayed error messages, because BLE bleak client is retrying to connect in case it goes wrong.
  • I could suggest to try to use usb2 expansion cord and try to connect to the devices directly with no proxy - Iā€™m not sure how this proxy is working, so canā€™t tell much how to debug such systemā€¦ Only removing this proxy comes to my mind as a certain path forward.
  • If you are familiar with python - you can try to add more debug messages into the process to figure out where the failure happens. You can just alter the logic in-place and then restart the HA core to apply the changes.
  • Also you can check dmesg and other system logs to see if something wrong happens with the BT adapter - they are prone to misbehave, so could cause issues.
    • Could be a good idea to reboot HA machine to reset BT adapter state and retry connection.
  • Last resort could be to try to connect to the devices using reverse repository - it contains python script, so you can execute it from another device and look at the result.

Hopefully this will help with the next steps.

Thanks so much for your response!

  • The logs I referenced where the standard home-assistant.log file you mentioned.
  • Unfortunately, this isnā€™t an option as my server is nowhere near the EcoFlow devices so I canā€™t get an actual BT dongle close to them.
  • I was able to get further by adjusting the proxy settings (needed to enable proxying active connections) but I can possibly explore this further
  • Rebooted and checked dmesg but nothing too exciting in there
/config dmesg | grep -i bluetooth
[   73.059313] Bluetooth: Core ver 2.22
[   73.059738] NET: Registered PF_BLUETOOTH protocol family
[   73.059742] Bluetooth: HCI device and connection manager initialized
[   73.059751] Bluetooth: HCI socket layer initialized
[   73.059754] Bluetooth: L2CAP socket layer initialized
[   73.059769] Bluetooth: SCO socket layer initialized
[   73.205179] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   73.205187] Bluetooth: BNEP filters: protocol multicast
[   73.205192] Bluetooth: BNEP socket layer initialized
  • I tried your reverse repo but it canā€™t find any BT hardware (because of how the esphome bluetooth proxy magic works within the HA integration ecosystem)

The logs are a lot more useful now so maybe you can see something there. There appears to initially be something related to auth. Maybe my newer firmware is causing an issue?

ef-ble-reverse git:(main) tail -f ../../../home-assistant.log | grep ef_ble
2024-12-11 12:13:30.533 DEBUG (MainThread) [custom_components.ef_ble.eflib.devicebase] 74:XX:XX:XX:XX:XX: Creating new device: Delta Pro Ultra 'EF-YJ0184
2024-12-11 12:13:30.533 DEBUG (MainThread) [custom_components.ef_ble.eflib.devicebase] A0:XX:XX:XX:XX:XX: Creating new device: Smart Home Panel 2 'EF-HD30120
2024-12-11 12:13:38.592 DEBUG (MainThread) [custom_components.ef_ble] Init EcoFlow BLE Integration
2024-12-11 12:13:38.592 DEBUG (MainThread) [custom_components.ef_ble] Connecting Device
2024-12-11 12:13:38.592 DEBUG (MainThread) [custom_components.ef_ble.eflib.devicebase] A0:XX:XX:XX:XX:XX: Creating new device: Smart Home Panel 2 'EF-HD30120
2024-12-11 12:13:38.592 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connecting to device
2024-12-11 12:13:50.184 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connected
2024-12-11 12:13:50.184 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: MTU: 500
2024-12-11 12:13:50.184 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Init completed, starting auth routine...
2024-12-11 12:13:50.184 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: initBleSessionKey: Pub key exchange
2024-12-11 12:13:50.186 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:13:51.624 DEBUG (MainThread) [custom_components.ef_ble] Creating entities
2024-12-11 12:13:51.663 DEBUG (MainThread) [custom_components.ef_ble] Setup done
2024-12-11 12:13:51.665 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:13:51.668 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:13:51.668 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:13:52.977 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:13:52.978 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving auth status
2024-12-11 12:13:52.979 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:13:55.715 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: Data: 'redacted'
2024-12-11 12:13:55.715 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: decrypted payload: 'redacted'
2024-12-11 12:13:55.716 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getAuthStatusHandler: data: 'redacted'
2024-12-11 12:13:55.716 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: autoAuthentication: Sending secretKey consists of user id and device serial number
2024-12-11 12:13:55.718 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:13:56.958 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: Data: 'redacted'
2024-12-11 12:13:56.958 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: decrypted payload: 'redacted'
2024-12-11 12:13:56.959 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: decrypted payload: 'redacted'
2024-12-11 12:13:56.959 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: autoAuthenticationHandler: data: ''
2024-12-11 12:13:56.960 ERROR (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Auth failed with response: ''
  File "/config/custom_components/ef_ble/eflib/connection.py", line 342, in autoAuthenticationHandler
  2024-12-11 12:21:17.475 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Disconnected from device
2024-12-11 12:21:17.475 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Disconnected from device
2024-12-11 12:21:17.476 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
2024-12-11 12:21:17.476 ERROR (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Failed to connect to the device: No backend with an available connection slot that can reach address A0:XX:XX:XX:XX:XX was found
2024-12-11 12:21:17.476 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
2024-12-11 12:21:17.476 ERROR (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Failed to connect to the device: No backend with an available connection slot that can reach address A0:XX:XX:XX:XX:XX was found
2024-12-11 12:21:22.476 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
2024-12-11 12:21:22.477 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
2024-12-11 12:21:24.240 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connected
2024-12-11 12:21:24.240 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: MTU: 500
2024-12-11 12:21:24.240 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Init completed, starting auth routine...
2024-12-11 12:21:24.240 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: initBleSessionKey: Pub key exchange
2024-12-11 12:21:24.241 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:21:24.242 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connected
2024-12-11 12:21:24.242 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: MTU: 500
2024-12-11 12:21:24.242 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Init completed, starting auth routine...
2024-12-11 12:21:24.242 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: initBleSessionKey: Pub key exchange
2024-12-11 12:21:24.243 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:21:26.591 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:21:26.593 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:21:26.593 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:21:26.594 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:21:26.596 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:21:26.596 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:21:27.827 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:21:27.828 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:21:27.829 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:21:27.831 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:21:27.831 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler
  2024-12-11 12:21:37.974 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Disconnected from device
2024-12-11 12:21:37.975 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Disconnected from device
2024-12-11 12:21:37.975 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
2024-12-11 12:21:37.976 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
  File "/config/custom_components/ef_ble/eflib/connection.py", line 262, in initBleSessionKeyHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 271, in getKeyInfoReq
  File "/config/custom_components/ef_ble/eflib/connection.py", line 228, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 262, in initBleSessionKeyHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 271, in getKeyInfoReq
  File "/config/custom_components/ef_ble/eflib/connection.py", line 228, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 262, in initBleSessionKeyHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 271, in getKeyInfoReq
  File "/config/custom_components/ef_ble/eflib/connection.py", line 228, in sendRequest
2024-12-11 12:21:40.643 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connected
2024-12-11 12:21:40.643 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: MTU: 500
2024-12-11 12:21:40.643 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Init completed, starting auth routine...
2024-12-11 12:21:40.643 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: initBleSessionKey: Pub key exchange
2024-12-11 12:21:40.644 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
  File "/config/custom_components/ef_ble/eflib/connection.py", line 95, in connect
  File "/config/custom_components/ef_ble/eflib/connection.py", line 242, in initBleSessionKey
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
2024-12-11 12:21:40.646 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connected
2024-12-11 12:21:40.646 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: MTU: 500
2024-12-11 12:21:40.646 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Init completed, starting auth routine...
2024-12-11 12:21:40.646 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: initBleSessionKey: Pub key exchange
2024-12-11 12:21:40.648 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:21:51.182 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:21:51.184 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:21:51.184 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:21:51.184 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:21:51.186 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:21:51.186 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:21:51.187 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:21:51.188 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler
2024-12-11 12:21:53.122 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Disconnected from device
2024-12-11 12:21:53.122 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
  File "/config/custom_components/ef_ble/eflib/connection.py", line 262, in initBleSessionKeyHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 271, in getKeyInfoReq
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 262, in initBleSessionKeyHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 271, in getKeyInfoReq
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
2024-12-11 12:22:03.990 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Disconnected from device
2024-12-11 12:22:03.990 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
2024-12-11 12:22:03.991 ERROR (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Failed to connect to the device: Timeout waiting for connect response while connecting to A0:XX:XX:XX:XX:XX after 10.0s, disconnect timed out: False,  after 20.0s
2024-12-11 12:22:05.308 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connected
2024-12-11 12:22:05.308 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: MTU: 500
2024-12-11 12:22:05.308 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Init completed, starting auth routine...
2024-12-11 12:22:05.308 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: initBleSessionKey: Pub key exchange
2024-12-11 12:22:05.309 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:08.992 WARNING (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Device is already connected
2024-12-11 12:22:15.869 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Disconnected from device
2024-12-11 12:22:15.869 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
2024-12-11 12:22:19.950 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connected
2024-12-11 12:22:19.950 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: MTU: 500
2024-12-11 12:22:19.950 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Init completed, starting auth routine...
2024-12-11 12:22:19.950 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: initBleSessionKey: Pub key exchange
2024-12-11 12:22:19.952 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:26.493 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:26.495 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:22:26.495 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:26.496 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:26.497 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:26.497 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:26.500 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:22:26.500 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler
2024-12-11 12:22:29.568 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:29.569 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving auth status
2024-12-11 12:22:29.571 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:29.571 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:29.572 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving auth status
2024-12-11 12:22:29.573 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:29.573 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:29.574 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving auth status
2024-12-11 12:22:29.575 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:29.575 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:29.576 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:29.576 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving auth status
2024-12-11 12:22:29.577 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
  File "/config/custom_components/ef_ble/eflib/connection.py", line 250, in initBleSessionKeyHandler
2024-12-11 12:22:33.258 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:33.259 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving auth status
2024-12-11 12:22:33.260 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:33.261 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: Data: 'redacted'
2024-12-11 12:22:33.261 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: Data: 'redacted'
2024-12-11 12:22:33.263 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:33.263 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: Data: 'redacted'
2024-12-11 12:22:33.265 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:33.265 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving auth status
2024-12-11 12:22:33.266 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:33.267 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:33.268 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving auth status
2024-12-11 12:22:33.269 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:33.269 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseEncPackets: Data: 'redacted'
2024-12-11 12:22:33.270 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Disconnected from device
  File "/config/custom_components/ef_ble/eflib/connection.py", line 304, in getAuthStatusHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 215, in parseEncPackets
  File "/config/custom_components/ef_ble/eflib/connection.py", line 122, in decryptSession
  File "/config/custom_components/ef_ble/eflib/connection.py", line 304, in getAuthStatusHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 215, in parseEncPackets
  File "/config/custom_components/ef_ble/eflib/connection.py", line 122, in decryptSession
  File "/config/custom_components/ef_ble/eflib/connection.py", line 250, in initBleSessionKeyHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 304, in getAuthStatusHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 215, in parseEncPackets
  File "/config/custom_components/ef_ble/eflib/connection.py", line 122, in decryptSession
  File "/config/custom_components/ef_ble/eflib/connection.py", line 304, in getAuthStatusHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 215, in parseEncPackets
  File "/config/custom_components/ef_ble/eflib/connection.py", line 122, in decryptSession
2024-12-11 12:22:33.281 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Reconnecting to device
  File "/config/custom_components/ef_ble/eflib/connection.py", line 286, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 300, in getAuthStatus
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 286, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 300, in getAuthStatus
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 286, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 300, in getAuthStatus
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 286, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 300, in getAuthStatus
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 286, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 300, in getAuthStatus
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 286, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 300, in getAuthStatus
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
  File "/config/custom_components/ef_ble/eflib/connection.py", line 286, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 300, in getAuthStatus
  File "/config/custom_components/ef_ble/eflib/connection.py", line 227, in sendRequest
2024-12-11 12:22:38.448 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Connected
2024-12-11 12:22:38.448 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: MTU: 500
2024-12-11 12:22:38.448 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Init completed, starting auth routine...
2024-12-11 12:22:38.448 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: initBleSessionKey: Pub key exchange
2024-12-11 12:22:38.449 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:40.341 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:40.342 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:40.342 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:40.344 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:22:40.344 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:40.345 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
2024-12-11 12:22:40.347 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: getKeyInfoReq: Receiving session key
2024-12-11 12:22:40.347 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: Sending: 'redacted'
2024-12-11 12:22:40.347 DEBUG (MainThread) [custom_components.ef_ble.eflib.connection] A0:XX:XX:XX:XX:XX: parseSimple: Data: 'redacted'
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler
  File "/config/custom_components/ef_ble/eflib/connection.py", line 278, in getKeyInfoReqHandler

Soo it looks like the channel is established, but something goes wrong with the auth routineā€¦ Hard to say for now since the log is heavily redacted and exceptions looks weird. Maybe you can send me the original log as private message, so I will be able to check it closely? In general there is no private info should be in this log - itā€™s not sending your ID directly - but only as a part of the hashed value with the device ID.

Ah, ok. I wasnā€™t sure how much sensitive info was in there that could be reversed so I just erred on the side of caution. Iā€™ll send you over the complete log via DM.

Yep, thanks to the log - I found the auth response handler can receive no data in the first packet and the actual auth response in the second one. So will try to push the fix today.

Thanks for taking a look! Iā€™ll report back later after the update.

Folks, new version v0.3.0 is available! Thank you all for your interest to this development - itā€™s pushing me forward to improve it further!)

Next plans is to continue to work on stabilization, enable SHP2 to show the connected DPUā€™s data (to save the ble connections) and prepare first buttons of SHP2 to enable/disable the circuits and change some important parameters. Please tell me if you need some additional sensors of SHP2/DPU - will be glad to add them in the first row.

1 Like

Can confirm itā€™s working now! Awesome work and I look forward to seeing how you progress it.

Do you know if there is any stat exposed for indicating what the current home power source is? I am looking to create automations on the event the grid power goes out and it switches to battery. If there isnā€™t anything, I suppose you could have a trigger when the Grid Power drops to 0.

1 Like

Yeah, thatā€™s how I figure out that batteries started to work - the Channel Power starts to show negative values (power flows from batteries to the panel) and Grid Power becomes 0. But I think itā€™s not that a big deal to add sensor which will switch between 3 states: GRID, GENERATOR and BATTERY. If you think itā€™s a good one - could you please create a ticket on github, so I will not forget to make it for the next release.

Itā€™s working here as well now. Thank you!!

1 Like

It looks like I spoke too soon :slight_smile:

After an arbitrary amount of time (hours or minutes), I will hit this error and all sensors go to unavailable until restart.

2024-12-14 22:18:51.110 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:DD:6C:10:CD:6E: Disconnected from device
  File "/config/custom_components/ef_ble/eflib/connection.py", line 293, in sendPacket
  File "/config/custom_components/ef_ble/eflib/connection.py", line 276, in sendRequest
2024-12-14 22:18:51.116 INFO (MainThread) [custom_components.ef_ble.eflib.connection] A0:DD:6C:10:CD:6E: Reconnecting to device
2024-12-14 22:18:51.116 ERROR (MainThread) [custom_components.ef_ble.eflib.connection] A0:DD:6C:10:CD:6E: Failed to connect to the device: No backend with an available connection slot that can reach address A0:DD:6C:10:CD:6E was found

Itā€™s possibly due to the ESP32 BLE proxy + WiFi not being as reliable as a real, physical dongle but thatā€™s just speculation. If you agree, is there a simple way to try to re-establish the connection if that happens? It doesnā€™t appear to retry.

Yeah, I also hit it - reload of the configuration helps. So most probably itā€™s a mistake somewhere in reconnect procedure. But will be able to check it closer on next weekend.

1 Like

Sounds good. At least itā€™s not just me :slight_smile: