omblepy icon indicating copy to clipboard operation
omblepy copied to clipboard

Having Trouble Pairing to a BE7000 which is to say a HEM-7600T

Open Eforen opened this issue 6 months ago • 5 comments

My BE7000 (HEM-7600T) Evolv will not connect to my fedora mechine.

(venv) root@fedora:/home/user/omblepy# python3 omblepy.py -d HEM-7600T -m EC:21:XX:XX:XX:XX
2025-07-10 02:18:57,855 - omblepy - INFO - Attempt to import module for device hem-7600t
2025-07-10 02:18:57,870 - omblepy - INFO - Attempt connecting to EC:21:E5:80:C0:55.
2025-07-10 02:18:58,905 - omblepy - INFO - unpair and disconnect
Traceback (most recent call last):
  File "/home/user/omblepy/omblepy.py", line 396, in <module>
    asyncio.run(main())
    ~~~~~~~~~~~^^^^^^^^
  File "/usr/lib64/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.13/asyncio/base_events.py", line 719, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/home/user/omblepy/omblepy.py", line 362, in main
    await bleClient.connect(timeout=20)
  File "/home/user/venv/lib64/python3.13/site-packages/bleak/__init__.py", line 566, in connect
    await self._backend.connect(self._pair_before_connect, **kwargs)
  File "/home/user/venv/lib64/python3.13/site-packages/bleak/backends/bluezdbus/client.py", line 353, in connect
    await self._get_services(
        dangerous_use_bleak_cache=dangerous_use_bleak_cache
    )
  File "/home/user/venv/lib64/python3.13/site-packages/bleak/backends/bluezdbus/client.py", line 703, in _get_services
    self.services = await manager.get_services(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._device_path, dangerous_use_bleak_cache, self._requested_services
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/user/venv/lib64/python3.13/site-packages/bleak/backends/bluezdbus/manager.py", line 677, in get_services
    await self._wait_for_services_discovery(device_path)
  File "/home/user/venv/lib64/python3.13/site-packages/bleak/backends/bluezdbus/manager.py", line 845, in _wait_for_services_discovery
    raise BleakError("failed to discover services, device disconnected")
bleak.exc.BleakError: failed to discover services, device disconnected
(venv) root@fedora:/home/user/omblepy# 

Eforen avatar Jul 10 '25 07:07 Eforen

The above is with await bleClient.pair(protection_level = 2) commented out

Eforen avatar Jul 10 '25 07:07 Eforen

Same outcome with it

Eforen avatar Jul 10 '25 07:07 Eforen

Hi @Eforen

Do you get a bluetooth pairing dialog, with the unmodified code? Do you use a bluetooth stick that supports Bluetooth 4.x? I had a lot of trouble with bleak in combination with the linux bluez backend. This is basically the reason debian 11/12 is marked as unreliable. Since HEM-7600T was already tested successfuly by someone, it is most likely something software/platform related.

If you have an esp32 on hand, you can also give this version a try: https://github.com/userx14/omblepy/tree/esp32bridge, as it bypasses the os bluetooth stack.

Best regards, Benjamin

userx14 avatar Jul 10 '25 23:07 userx14

Wow it's like you read my mind my ultimate goal was to move to a esp32

Eforen avatar Jul 10 '25 23:07 Eforen

For this version the esp32 is mostly just relaying the communication to the python side, basically replacing the bluetooth backend. So if you plan something like a standalone esp32 version, it it would require porting a lot of code to c++ from python.

userx14 avatar Jul 10 '25 23:07 userx14

I'm having trouble connecting to a HEM-7600T too, from Ubuntu 22.04

Was able to pair using bluetoothctl, but kept getting this

➜  omblepy git:(main) python omblepy.py -d HEM-7600T -m 00:5f:bf:ca:d5:c9  -p
2025-11-28 02:42:46,050 - omblepy - INFO - Attempt to import module for device hem-7600t
2025-11-28 02:42:46,141 - omblepy - INFO - Attempt connecting to 00:5f:bf:ca:d5:c9.
2025-11-28 02:42:56,153 - omblepy - INFO - unpair and disconnect
Traceback (most recent call last):
  File "/root/omblepy/omblepy.py", line 395, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.12/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/root/omblepy/omblepy.py", line 362, in main
    await bleClient.connect()
  File "/usr/lib/python3.12/site-packages/bleak/__init__.py", line 623, in connect
    await self._backend.connect(self._pair_before_connect, **kwargs)
  File "/usr/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 152, in connect
    raise BleakDeviceNotFoundError(
bleak.exc.BleakDeviceNotFoundError: Device with address 00:5f:bf:ca:d5:c9 was not found.

bilogic avatar Nov 27 '25 18:11 bilogic

Hi bilogic, did you already try the tipps from the linux specific part of the troubleshooting section? Do you get a pairing dialog? Is is possible for you to test with another linux in liveboot environment?

userx14 avatar Nov 28 '25 00:11 userx14

Thanks, it was my first time trying so I did whatever I could follow.

  1. Tried passing Bluetooth USB into Proxmox LXC, but the passing failed, nothing related to this repo
  2. Tried on Windows, could not pair with OS. My module was CSR based, so decided to move on.
  3. Tried on HomeAssistant's CLI, the errors above were from here
    • I did not get any pairing dialog while the 7600T's P was blinking
    • But I was able to run bluetoothctl and pair 00:5f:bf:ca:d5:c9 which succeeded
    • Exited and ran python omblepy.py -d HEM-7600T -m 00:5f:bf:ca:d5:c9 -p, which failed
  4. My ultimate goal is to have something like https://github.com/bkbilly/medisanabp_ble/tree/main/custom_components/medisanabp_ble for the 7600T

bilogic avatar Nov 28 '25 02:11 bilogic