sputnikdev / eclipse-smarthome-bluetooth-binding

Eclipse SmartHome Bluetooth Binding
46 stars 10 forks source link

Add support for Yeelight bulbs #38

Open vkolotov opened 6 years ago

arosboro commented 6 years ago

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 commented 6 years ago

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

vkolotov commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Cool, that would be enough.

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

arosboro commented 6 years ago

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

vkolotov commented 6 years ago

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 commented 6 years ago

Great, that PDF is a gold.

arosboro commented 6 years ago

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

vkolotov commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

arosboro commented 6 years ago

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

vkolotov commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

vkolotov commented 6 years ago

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 commented 6 years ago

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

vkolotov commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

vkolotov commented 6 years ago

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

vkolotov commented 6 years ago

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

vkolotov commented 6 years ago

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

arosboro commented 6 years ago

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 commented 6 years ago

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

arosboro commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

This config.yml has some working ASCII strings

vkolotov commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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]