Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Yeelight bulbs #38

Open
vkolotov opened this issue Feb 28, 2018 · 56 comments
Open

Add support for Yeelight bulbs #38

vkolotov opened this issue Feb 28, 2018 · 56 comments
Assignees

Comments

@vkolotov
Copy link
Contributor

No description provided.

@vkolotov vkolotov self-assigned this Feb 28, 2018
@arosboro
Copy link

I had confirmed this python can control and set the color w/ pi3 https://github.com/fayep/bolt. Also there is a PDF that documents BLE profiles of the yeelink lights floating around.

@vkolotov
Copy link
Contributor Author

Hi @arosboro, thanks for that. I'll be working on this once I've received a new bulb.

@vkolotov
Copy link
Contributor Author

Hey @arosboro, I've got now a Yeelight bulb... but it looks like it does not support Bluetooth at all. They either sent me a wrong item or I ordered a wrong item.

Can you please point me where I can get a Bluetooth enabled Yeelight bulb?
Cheers

@arosboro
Copy link

Hi @vkolotov I've been using these bulbs Misfit Bolt They are $20 on amazon, and have a Misfit home app which supports light scenes with I think a list of 10 color presets that alternate. Also supported is wake up timer.

@vkolotov
Copy link
Contributor Author

But this is not a Yeeligh bulb, right? If so, pls create a ticket for your bulb. I'll close this one as afaik Yeelight bulbs are discontinued.

@arosboro
Copy link

I think this is a re-branded yeelight. It responds to the same bluetooth profiles and afaik may also be discontinued as Misfit was acquired by fossil. I cannot tell if there is surplus or if these are being manufactured still as they are easy to find on ebay and amazon.

@vkolotov
Copy link
Contributor Author

I'll try to help you with it (with your help), but I won't be able to buy it as they are discontinued indeed.

@arosboro
Copy link

Thanks, I can program, but I haven't touched C++ or Java since 2009. I currently have this set up with PIR to turn on and off connected to a raspberry pi without open hab.

@vkolotov
Copy link
Contributor Author

That repo on github is a bit crappy, hard to understand the protocol and what characteristics are used (UUIDs). I'll need to get a list of services and characteristics UUIDs.

Please use gatttool or bluetoothctl (this one preferable as it also gives handler IDs) to get a list of UUIDs for me.

@arosboro
Copy link

arosboro commented Mar 13, 2018

Device C4:BE:84:XX:XX:XX
Name: MFBOLT
Alias: MFBOLT
Paired: no
Trusted: no
Blocked: no
Connected: no
LegacyPairing: no
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Unknown (0000fff0-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (f000ffc0-0451-4000-b000-000000000000)

@vkolotov
Copy link
Contributor Author

Cool, thanks. Try to connect to that device via bluetoothctl, it will give you a full list of characteristics etc.

The one you've provided is a list of services.

@arosboro
Copy link

I think this is what you need:

[MFBOLT]# info F4:B8:5E:ED:73:9F
Device F4:B8:5E:ED:73:9F
Name: MFBOLT
Alias: MFBOLT
Paired: no
Trusted: no
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Unknown (0000fff0-0000-1000-8000-00805f9b34fb)
ManufacturerData Key: 0x004c
ManufacturerData Value: 0x02
ManufacturerData Value: 0x15
ManufacturerData Value: 0x3d
ManufacturerData Value: 0xda
ManufacturerData Value: 0xb0
ManufacturerData Value: 0x11
ManufacturerData Value: 0x95
ManufacturerData Value: 0x7f
ManufacturerData Value: 0x7d
ManufacturerData Value: 0x4a
ManufacturerData Value: 0x34
ManufacturerData Value: 0xa6
ManufacturerData Value: 0x74
ManufacturerData Value: 0x69
ManufacturerData Value: 0x66
ManufacturerData Value: 0x73
ManufacturerData Value: 0x69
ManufacturerData Value: 0x6d
ManufacturerData Value: 0x00
ManufacturerData Value: 0x01
ManufacturerData Value: 0x00
ManufacturerData Value: 0x02
ManufacturerData Value: 0xb7
[NEW] Primary Service
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service000c
00001801-0000-1000-8000-00805f9b34fb
Generic Attribute Profile
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service000c/char000d
00002a05-0000-1000-8000-00805f9b34fb
Service Changed
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service000c/char000d/desc000f
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Primary Service
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010
0000fff0-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0011
0000fff1-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0011/desc0013
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0014
0000fff2-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0014/desc0016
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0017
0000fff3-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0017/desc0019
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char001a
0000fff4-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char001a/desc001c
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char001a/desc001d
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char001e
0000fff5-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char001e/desc0020
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0021
0000fff6-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0021/desc0023
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0021/desc0024
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0025
0000fff7-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0025/desc0027
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0028
0000fff8-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0028/desc002a
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char002b
0000fff9-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char002b/desc002d
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char002b/desc002e
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char002f
0000fffa-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char002f/desc0031
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0032
0000fffb-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0032/desc0034
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0032/desc0035
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0036
0000fffc-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0036/desc0038
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0039
0000fffd-0000-1000-8000-00805f9b34fb
Fast IDentity Online Alliance (FIDO)
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0039/desc003b
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char003c
0000fffe-0000-1000-8000-00805f9b34fb
Alliance for Wireless Power (A4WP)
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char003c/desc003e
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char003c/desc003f
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0040
0000ffe1-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0040/desc0042
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0043
0000ffe2-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0043/desc0045
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0010/char0043/desc0046
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Primary Service
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047
f000ffc0-0451-4000-b000-000000000000
Vendor specific
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0048
f000ffc1-0451-4000-b000-000000000000
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0048/desc004a
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0048/desc004b
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char004c
f000ffc2-0451-4000-b000-000000000000
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char004c/desc004e
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char004c/desc004f
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0050
0000ccc1-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0050/desc0052
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0050/desc0053
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0054
0000ccc2-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0054/desc0056
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0057
0000ccc3-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char0057/desc0059
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char005a
0000ccc4-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char005a/desc005c
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char005d
0000ccc5-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char005d/desc005f
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F4_B8_5E_ED_73_9F/service0047/char005d/desc0060
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description

Do you have the yeelight pdf documentation as well?

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

Actually... you don't have to use any of those utilities. Just use binding. It will give you a list of characteristics if you enable "Binary only" for the "GATT parsing Strategy" setting on the binding preferences page.

image

@vkolotov
Copy link
Contributor Author

Cool, that would be enough.

I do not have any pdf for Yeelight, do you?

@arosboro
Copy link

Yes I found this in a openhab discussion from the author of the python script.
yeelight_blue_message_interface_v1.0.pdf

@vkolotov
Copy link
Contributor Author

Yeah, I think it would be a good idea to actually use that new feature to create binary channel in the binding. You will be able to control your bulb by using a binary channel even now. So please try.

When you've added your bulb in OH, please enable "connection control" channel. Wait until it established a connection to your bulb, then refresh PaperUI tab in your browser, then you should be able to see all binary channels. Please take a screenshot of it.

@vkolotov
Copy link
Contributor Author

Great, that PDF is a gold.

@arosboro
Copy link

screen shot 2018-03-13 at 4 36 15 pm

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

WOW... a button? :) Looks like we've got a conflicting characteristic... This will add a bit more complexity.

Are you sure you've enabled "All as Binary" option? I can't see any binary channels there. Please remove that thing from OH, Enable that feature and add your bulb again.

@arosboro
Copy link

I have a tracker / wristwatch that triggers the light as well. The behavior cycles through 50%, 100%, off. I did not see the same options for "All as Binary" in my fresh openhabian 2 install. Is there a way to get the update?

screen shot 2018-03-13 at 4 41 54 pm

@vkolotov
Copy link
Contributor Author

Ah yeah, looks like you are running the previous version. Just uninstall the binding via MarketPlace plugin and install it back again. Unfortunately the MarketPlace plugin does not automatically update bindings...

@arosboro
Copy link

I'm using TinyB and when I went to uninstall they were showing up as not installed. I removed the IoT market place and re-installed everything and I'm currently seeing market:binding-3694484 - 1.0

but it looks like the binding is not what you are showing in your screenshot.

@vkolotov
Copy link
Contributor Author

You might have been installed it manually? By putting jar files in the addons folder? If so, remove them from /usr/share/openhab2/addons

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

This is what you should see in PaperUI:
image

Pls ignore "binding-bluetooth - 2.3.0.SNAPSHOT" binding as it is an "official" bluetooth binding.
"market:binding-3694484 - 1.0" - is what you need.

@vkolotov
Copy link
Contributor Author

Ah yeah, forgot to say that the "marketplace" plugin sometimes does not refresh its registry, so you have to restart OH to make it to refresh its registry of all bindings.

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

When you've reinstalled everything, please make sure you see these version numbers in the karaf console:

openhab> bundle:list | grep bluetooth

Binding: 1.1.4
BlueGiga transport: 1.2.1
TinyB transport: 1.1.1

Note: if you are not using BlueGiga, then you don't need to install it.

@arosboro
Copy link

Ok I'm almost caught up. I'm getting:

openhab> bundle:list | grep bluetooth
211 │ Active │ 80 │ 1.1.2 │ org.sputnikdev:org.eclipse.smarthome.binding.bluetooth
212 │ Active │ 80 │ 1.1.0 │ org.sputnikdev:org.eclipse.smarthome.binding.bluetooth.transport.tinyb
233 │ Active │ 80 │ 1.1.4 │ org.sputnikdev:org.eclipse.smarthome.binding.bluetooth
234 │ Active │ 80 │ 1.1.1 │ org.sputnikdev:org.eclipse.smarthome.binding.bluetooth.transport.tinyb
openhab> bundle:uninstall 211
openhab> bundle:uninstall 212
openhab> bundle:list | grep bluetooth
233 │ Active │ 80 │ 1.1.4 │ org.sputnikdev:org.eclipse.smarthome.binding.bluetooth
234 │ Active │ 80 │ 1.1.1 │ org.sputnikdev:org.eclipse.smarthome.binding.bluetooth.transport.tinyb

And the UI shows as yours does. I'm just waiting for a reboot to refresh Paper UI.

@arosboro
Copy link

screen shot 2018-03-13 at 5 50 03 pm
I selected the binary option but I don't think any binary channels showed up after removing/re-adding the lightbulb.

@vkolotov
Copy link
Contributor Author

Ok, have you enabled "connection control"? Has it been connected?

@arosboro
Copy link

OpenHab2 Bluetooth MFBOLT.pdf
Figured out where to look in the control panel now. Here is the full output of discovered channels.

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

Very cool. Now... In PaperUI: Control -> Bluetooth Devices -> find your bulb there -> find 0000fff1 channel. Click on the value (if exists) to the right of the label. Enter [ff, ff, ff, ff]. This should light up your bulb. Or [00, 00, 00, 00] should turn off your bulb. Try and let me know how it goes :)

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

This is from the PDF:

2.1 Control Character
This character is used to control the on/off/color/lightness of LED. The format is as follows:
<R>,<G>,<B>,<L>,...(Note: if the length of command does not exceed to 18, fill “,” at the end)

So just change any of those 4 bytes to get different color. E.g. [FF, 00, 00, FF] should give you RED color.

@vkolotov
Copy link
Contributor Author

Ah right, according to the pdf, the very last byte can take only 100 (in decimal), so this should be 64 in hex, e.g. [ff, ff, ff, 64] or [FF, 00, 00, 64].

@arosboro
Copy link

Yes it should be R,G,B,Brightness (0-255,0-255,0-255,0-100)

@vkolotov
Copy link
Contributor Author

Nah... the format in the input field is HEX. So all those decimals should be converted to hex.
(0-255,0-255,0-255,0-100) -> [0-FF, 0-FF, 0-FF, 0-64]

@arosboro
Copy link

yes, just agreeing w/ you as I'm used to thinking in decimal when working with RGB values.

@vkolotov
Copy link
Contributor Author

Is this working for you? If so, I'll show how to create GATT descriptors so that you will get channels in a human-readable format.

@arosboro
Copy link

It is set to orange right now... and has a value [32, 35, 35, 2c, 31, 30, 30, 2c, 30, 2c, 34, 30, 2c, 2c, 2c, 2c, 2c, 2c] for this channel:
screen shot 2018-03-13 at 6 21 21 pm

@vkolotov
Copy link
Contributor Author

Oh... a lot of numbers there... I wonder why. Looks like that PDF may not be correct.

@vkolotov
Copy link
Contributor Author

Yeah, anyway, try to send [ff, 00, 00, 64] and see what's happening.

@vkolotov
Copy link
Contributor Author

Here is another good article on that: http://jacksonbaker.net/reverse-engineering-the-misfit-bolt-btle-protocol/

@vkolotov
Copy link
Contributor Author

Right... I see now, those "2c" bytes translate to "," ASCII. What a stupid protocol :) Using a commas in a binary array... oh dear.

@arosboro
Copy link

Yeh, I'm guessing [35, 30, 2c, 32, 35, 35, 2c, 30, 2c, 35, 30, 2c, 2c, 2c, 2c, 2c, 2c] would turn the light green. Trying to confirm now.

@vkolotov
Copy link
Contributor Author

So yeah, you literally need to convert "255,0,0,100,,,,,,," ASCII string to hex bytes, omg.

@arosboro
Copy link

I guess that's what happens you follow the specifications literally

The devices It seems to disconnect and come back with the initial value without changing when I attempt to fill out a new string value and click the checkmark icon. Is there a special way to change values w/ control in paper UI?

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

You could use this tool to convert it: https://www.branah.com/ascii-converter

Enter 0,255,0,100,,,,,,, into "ASCII" window, this will give you:
0x300x2c0x320x350x350x2c0x300x2c0x310x300x300x2c0x2c0x2c0x2c0x2c0x2c0x2c

Just replace all "0x" with "," and you will get:
,30,2c,32,35,35,2c,30,2c,31,30,30,2c,2c,2c,2c,2c,2c,2c

use it in the binding :), e.g.:
[30,2c,32,35,35,2c,30,2c,31,30,30,2c,2c,2c,2c,2c,2c,2c]

@arosboro
Copy link

This config.yml has some working ASCII strings

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

I guess the reason why it disconnects is that we put something "invalid" in that characteristic so the bulb reboots itself. I can see that the number of "," (or "2c") is different to what you get for your device and in the PDF. You might need to play with it a bit.

Or even just you know, when you connect to the device and when it shows you initial/current value in that channel, just do not remove anything from there and change something, e.g:

[32, 35, 35, 2c, 31, 30, 30, 2c, 30, 2c, 34, 30, 2c, 2c, 2c, 2c, 2c, 2c]

to

[31, 35, 35, 2c, 31, 30, 30, 2c, 30, 2c, 34, 30, 2c, 2c, 2c, 2c, 2c, 2c]

^^ see I changed 32 to 31 (eg. 255 to 155)

@vkolotov
Copy link
Contributor Author

yeah, the number of "," in the tail of the the initial value is 6 whereas PDF says it should be 7. Try first, 6. Eg:
[31, 35, 35, 2c, 31, 30, 30, 2c, 30, 2c, 34, 30, 2c, 2c, 2c, 2c, 2c, 2c]
and then 7:
[31, 35, 35, 2c, 31, 30, 30, 2c, 30, 2c, 34, 30, 2c, 2c, 2c, 2c, 2c, 2c, 2c]

@arosboro
Copy link

I think it is as long as there are remaining characters up to 18 values, fill with 2c ",".

I tested the first string w/ 6 commas above and it worked.
This turns the light off:
[2c ,2c ,2c ,30 ,2c ,2c ,2c ,2c ,2c ,2c ,2c ,2c ,2c ,2c ,2c ,2c ,2c ,2c]

@vkolotov
Copy link
Contributor Author

vkolotov commented Mar 13, 2018

Awesome. Nailed. This will add some extra complexity yeah, but still doable. I'll be working on another bulb this week to extend the binding (gatt parser actually) to enable it to provide human readable channels for RGB and now for your bulb. I'll need some help from you in testing it though.

@arosboro
Copy link

Thanks for walking me through it, I'll be happy to test when you have something ready

@pc-maniac
Copy link

pc-maniac commented Dec 11, 2019

I'm trying to add Yeelight YLDP10YL using this binding. Lamp already connected but has only one known writable parameter "Connection control". And several unknown: "00000010-0000-1000-8000-00805f9b34fb", "00000018-0000-1000-8000-00805f9b34fb", "00000017-0000-1000-8000-00805f9b34fb", "00000016-0000-1000-8000-00805f9b34fb". Maybe you have any information about this lamps?
Annotation 2019-12-12 003011

@milkpirate
Copy link

Hey @pc-maniac, I am having a similar model YLDP09YL, which features the same charateristics UUIDs. Have you figured out how to controll it? Could you share your info if you have some?

Thanks!

@pc-maniac
Copy link

@milkpirate As I understand, this BLE Mesh protocol uses some kind of secret API Key and it is currently unknown. Maybe it will leak from manufacturer at some time.

@arosboro
Copy link

arosboro commented Apr 2, 2022

@vkolotov, I've regained interest in setting this up with the work you claimed to be needing my assistance in testing.

Is there anything I should do? I still have the same setup as last time, give me a few hours and I'll have the latest dependencies for open hab updated and installed on my server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants