Betree / magicblue

💡 Unofficial Python API to control Magic Blue bulbs over Bluetooth
MIT License
100 stars 23 forks source link

Incompatibility with V8 #13

Closed Betree closed 7 years ago

Betree commented 7 years ago

Bulb version 8 seems to be incompatible at the moment. What we know :

(See #7)

Betree commented 7 years ago

@IzzyWizzy666

Before you start sniffing packets, you can try (from Gatttool) to connect to the device as you did before then send this command : [XX:XX:XX:XX:XX:XX][LE]> primary

You should end up with something like that :

attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x0008 uuid: 0000fff0-0000-1000-8000-00805f9b34fb
attr handle: 0x0009, end grp handle: 0x000b uuid: 0000ffe5-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0xffff uuid: 0000ffe0-0000-1000-8000-00805f9b34fb

Then try to write previous sequences, replacing 0x000b by the different values you have with grp handle key: char-write-req 0x000b 56FFFFFF00f0aa to set white char-write-req 0x000b 56FF000000f0aa to set red

IzzyWizzy666 commented 7 years ago

Success :D pi@raspberrypi3:~ $ sudo gatttool -t random -b F2:F1:09:E6:DE:78 -I [F2:F1:09:E6:DE:78][LE]> connectAttempting to connect to F2:F1:09:E6:DE:78 Connection successful [F2:F1:09:E6:DE:78][LE]> primary attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb attr handle: 0x0008, end grp handle: 0x0008 uuid: 00001801-0000-1000-8000-00805f9b34fb attr handle: 0x0009, end grp handle: 0x0009 uuid: 0000fff0-0000-1000-8000-00805f9b34fb attr handle: 0x000a, end grp handle: 0x000c uuid: 0000ffe5-0000-1000-8000-00805f9b34fb attr handle: 0x000d, end grp handle: 0xffff uuid: 0000ffe0-0000-1000-8000-00805f9b34fb [F2:F1:09:E6:DE:78][LE]> char-write-req 0x000b 56FFFFFF00f0aa Error: Characteristic Write Request failed: Attribute can't be written [F2:F1:09:E6:DE:78][LE]> char-write-req 0x000c 56FFFFFF00f0aa Characteristic value was written successfully [F2:F1:09:E6:DE:78][LE]> char-write-req 0x000c 5600FFFF00f0aa Characteristic value was written successfully

Now to see if magicblue will work :)

IzzyWizzy666 commented 7 years ago

Hi Benjamin, I've upgraded the bluetooth to bluez 5.9 that's what did it in the end I think :) Magicblueshell also works now :D Many thanks for the help :), now all we need to do is get it added to Homeassistant :)

Betree commented 7 years ago

Glad to hear that 🎉 !

I'm interested in the HomeAssistant integration, keep me in touch with your progress on that. Also I think other people are looking for that feature too (see this post).