dave-code-ruiz / elkbledom

Home Assistant custom component for LED STRIP NAME ELK BLEDOM
MIT License
77 stars 16 forks source link

ELK-BLEDOM with different char value handle #29

Closed Double-A-92 closed 1 year ago

Double-A-92 commented 1 year ago

Hi, I have a LED strip which seems to have a different char value handle and thus isn't supported. Instead of 0x0009 like in the examples, I have 0x000e for the char properties: 0x06.

Those are the commands I could get to work:

sudo gatttool -b BE:96:50:00:00:23 --char-write-req -a 0x000e -n 7e00040100000000ef # POWER ON
sudo gatttool -b BE:96:50:00:00:23 --char-write-req -a 0x000e -n 7e00040000000000ef # POWER OFF

sudo gatttool -b BE:96:50:00:00:23 --char-write-req -a 0x000e -n 7e000503ff000000ef # RED
sudo gatttool -b BE:96:50:00:00:23 --char-write-req -a 0x000e -n 7e0005030000ff00ef # BLUE
sudo gatttool -b BE:96:50:00:00:23 --char-write-req -a 0x000e -n 7e00050300ff0000ef # GREEN

sudo gatttool -b BE:96:50:00:00:23 --char-write-req -a 0x000e -n 7e00010000000000ef # 0% Bightness
sudo gatttool -b BE:96:50:00:00:23 --char-write-req -a 0x000e -n 7e00013200000000ef # 50% Bightness
sudo gatttool -b BE:96:50:00:00:23 --char-write-req -a 0x000e -n 7e00016400000000ef # 100% Bightness

And here the full gatttool output in case it's also needed:

[BE:96:50:00:00:23][LE]> primary
attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0xffff uuid: 0000fff0-0000-1000-8000-00805f9b34fb
[BE:96:50:00:00:23][LE]> Characteristics
handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x0009, char properties: 0x20, char value handle: 0x000a, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x000d, char properties: 0x06, char value handle: 0x000e, uuid: 0000fff3-0000-1000-8000-00805f9b34fb
handle: 0x000f, char properties: 0x10, char value handle: 0x0010, uuid: 0000fff4-0000-1000-8000-00805f9b34fb
dave-code-ruiz commented 1 year ago

Ok, i think it is posible use it with little change developed.

Please i need the blietooth name of your led strip.

You can know the name with BTScan.py:

You can scan BT device with BTScan.py in my repository exec: sudo python3 BTScan.py, code supports led strips whose name begins with "ELK-BLE" or "MELK" or "ELK-BULB"

Double-A-92 commented 1 year ago

It's ELK-BLEDOM which should already be supported.

But actually it might be a general error with my system and bluetooth... Sorry about that.

dave-code-ruiz commented 1 year ago

My code use uuid - 0000fff3-0000-1000-8000-00805f9b34fb not char value, i review code but i think it is for different reason. Please use integration and get debug logs and post its. I explain how to in other issues

dave-code-ruiz commented 1 year ago

You need bluetooth integration in https://www.home-assistant.io/integrations/bluetooth

If you haven't it, you need install it