Bluetooth Led fails to normalize_uuid_str containing 'None'
The problem
When attempting to configure an auto-discovered bluetooth led, it fails with:
ValueError: invalid literal for int() with base 16: '0000None00001000800000805f9b34fb'`
Seems like None is being passed unexpectedly here.
What version of Home Assistant Core has the issue?
core-2024.7.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
led-blue
Link to integration documentation on our website
https://www.home-assistant.io/integrations/led_ble
Diagnostics information
Unable to as the integration is not activated
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Unexpected error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/led_ble/config_flow.py", line 68, in async_step_user
await led_ble.update()
File "/usr/local/lib/python3.12/site-packages/led_ble/led_ble.py", line 150, in update
await self._ensure_connected()
File "/usr/local/lib/python3.12/site-packages/led_ble/led_ble.py", line 355, in _ensure_connected
await client.start_notify(self._read_char, self._notification_handler)
File "/usr/local/lib/python3.12/site-packages/bleak/__init__.py", line 827, in start_notify
characteristic = self.services.get_characteristic(char_specifier)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak/backends/service.py", line 179, in get_characteristic
uuid = normalize_uuid_str(str(specifier))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak/uuids.py", line 1240, in normalize_uuid_str
return str(UUID(uuid))
^^^^^^^^^^
File "/usr/local/lib/python3.12/uuid.py", line 179, in __init__
int = int_(hex, 16)
^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 16: '0000None00001000800000805f9b34fb'
### Additional information
Device is reported as: `MELK-OC21W A6 (19A6) LED BLE`
Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (led_ble) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of led_ble can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign led_bleRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
led_ble documentation led_ble source (message by IssueLinks)
Same with MELK-OA21 14 (BE:16:58:00:29:14)
ValueError: invalid literal for int() with base 16: '0000None00001000800000805f9b34fb'
Experiencing the same problem with MELK-OC10 on Home Assistant Core 2024.7.1 and 2024.7.2
ValueError: invalid literal for int() with base 16: '0000None00001000800000805f9b34fb'
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
That seems like the device is producing an invalid UUID, but it could be improved in bleak
Same here: `Registratore: homeassistant.components.led_ble.config_flow Fonte: components/led_ble/config_flow.py:68 Integrazione: led_ble (documentazione, problemi) Prima occorrenza: 08:52:56 (1 occorrenze) Ultima registrazione: 08:52:56
Unexpected error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/led_ble/config_flow.py", line 68, in async_step_user await led_ble.update() File "/usr/local/lib/python3.12/site-packages/led_ble/led_ble.py", line 150, in update await self._ensure_connected() File "/usr/local/lib/python3.12/site-packages/led_ble/led_ble.py", line 355, in _ensure_connected await client.start_notify(self._read_char, self.notification_handler) File "/usr/local/lib/python3.12/site-packages/bleak/init.py", line 827, in start_notify characteristic = self.services.get_characteristic(char_specifier) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/bleak/backends/service.py", line 179, in get_characteristic uuid = normalize_uuid_str(str(specifier)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/bleak/uuids.py", line 1240, in normalize_uuid_str return str(UUID(uuid)) ^^^^^^^^^^ File "/usr/local/lib/python3.12/uuid.py", line 179, in init int = int(hex, 16) ^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 16: '0000None00001000800000805f9b34fb'`
Hello, i have the same problem with my HappyLighting/Triones LED Spotlight:
Unexpected error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/led_ble/config_flow.py", line 68, in async_step_user await led_ble.update() File "/usr/local/lib/python3.13/site-packages/led_ble/led_ble.py", line 150, in update await self._ensure_connected() File "/usr/local/lib/python3.13/site-packages/led_ble/led_ble.py", line 373, in _ensure_connected await client.start_notify(self._read_char, self.notification_handler) File "/usr/local/lib/python3.13/site-packages/bleak/init.py", line 827, in start_notify characteristic = self.services.get_characteristic(char_specifier) File "/usr/local/lib/python3.13/site-packages/bleak/backends/service.py", line 179, in get_characteristic uuid = normalize_uuid_str(str(specifier)) File "/usr/local/lib/python3.13/site-packages/bleak/uuids.py", line 1240, in normalize_uuid_str return str(UUID(uuid)) ~~~~^^^^^^ File "/usr/local/lib/python3.13/uuid.py", line 182, in init int = int(hex, 16) ValueError: invalid literal for int() with base 16: '0000None00001000800000805f9b34fb'
Any updates for the problem? Thx!!
Please post the following:
- Link to where you purchased the device
- Exact model number
- Which Bluetooth Adapter/Proxy you are using
Please post the following:
- Link to where you purchased the device
- Exact model number
- Which Bluetooth Adapter/Proxy you are using
Hi, i purchased the device on Amazon but the listing changed so it's not the same model anymore... anyway here is the link:
https://amzn.eu/d/1qDc1Lj
About the model number there is none outside or inside the product, i took some photos of the SOCs on the (what is seems) BLE radio board:
Board Name: TGDLYMK-6 BLE Controller: ST17H26 CA2045 CM8A0V.1 EEPROM: PT24C02 F2019
I'm using the integrated Bluetooth Adapter on the Raspberry Pi 3 B+ where my HAS instance is running:
Adapter: bcm43438-bt
Device name shown by Home Assistant:
Triones-FFFF385A580B (FF:FF:38:5A:58:0B)
Thanks. If you can find the same model available for shipping to the US, I'll purchase it and see if I can fix the problem.
All the listings from Amazon ( .com and .it ) seem to be gone for this specific model, i fond the same spotlight from Ebay, it should ship to the US.
https://www.ebay.com/itm/135470699572
All the listings from Amazon ( .com and .it ) seem to be gone for this specific model, i fond the same spotlight from Ebay, it should ship to the US.
https://www.ebay.com/itm/135470699572
Great. Ordered!
I have similar problem with led lamp (https://www.action.com/pl-pl/p/3207285/wielokolorowa-lampa-dotykowa/). '0000None00001000800000805f9b34fb' is one of UUIDs (screenshot).
homeassistant | File "/usr/local/lib/python3.13/uuid.py", line 182, in __init__
homeassistant | int = int_(hex, 16)
homeassistant | ValueError: invalid literal for int() with base 16: '0000None00001000800000805f9b34fb'
EDIT: PDF (https://adiy.in/wp-content/uploads/2024/02/ADIY-HLK-B50-Bluetooth-Module_Datasheet.pdf) mentions this UUID 0000fff100001000800000805f9b34fb.
Adding information on my devices to the list. Maybe there is something in common :)
Link to the lamp on amazon: https://a.co/d/gGZgJHk
There are lots of different companies building it under different names. The product number SPL-FLL001 is the same.
Displayname in Home Assistant: MELK-OC10 F1 (4DF1) LED BLE
Address: BE:16:C7:00:4D:F1
My current Bluetooth-Chipset of Home Assistant is a Realtek RTL8822CE (but the integrated Raspberry Pi 4 Adapter reports the same problem).
The service UUID seems to be the same as j0zzy's. Please let me know, if I can provide additional information which might help you :)
EDIT: My devices can be controlled trough an app, which makes a local ble connection to the devices. https://play.google.com/store/apps/details?id=wl.smartled.duoco.rgb
I took a quick look inside with https://github.com/Konloch/bytecode-viewer
From what I can tell, the class com.easylink.colorful.service.BluetoothLEService does all the heavy lifting. I haven't looked into details, but it seems to usually sends 9 bytes to the device which encode the operation and the value to set. It looks for services with the UUID 0000fff0-0000-1000-8000-00805f9b34fb and their characteristics 0000fff3-0000-1000-8000-00805f9b34fb and sends the data there.
I did a bit of logic tracing and I documented an issue on an underlying library: https://github.com/Bluetooth-Devices/led-ble/issues/35
Basically it seems that the bluetooth services are not being resolved (code) and that is causing the self._read_char to be NONE when normalizing the UUID.