Yeelight binding?

I know - that’s why I said I had it working when I wrote the Bluetooth binding :wink:

I had a look into the specs you posted and think, writing a binding should not be a big problem, as I already used SSDP messages in the WeMo 1.x binding.
Unfortunately, I can not start coding before mid of October, so there will be no quick solution.

That would be awesome! i have a few of these bulbs lying around waiting for a nice way of integrating them into Openhab.

That would be awesome
I dont´t need a quick solution.

It´s fine when I know that can integrate Yeelights in the near future into OH and don´t need to buy new bulbs.

so, while waiting, i tried playing around with TCP Binding.
the system is OH2 on a RasPi

tcp.cfg (everything else set to default)
# Post-amble that will be appended to data being sent postamble=\r\n

item:
Switch stairway "Stairway" {tcp=">[ON:192.168.31.103:55443:'MAP(yeelight.map)'], >[OFF:192.168.31.103:55443:'MAP(yeelight.map)']"}

sitemap
Switch item=stairway

yeelight.map
ON={"id":1,"method":"set_power","params":["on","smooth",500]} OFF={"id":1,"method":"set_power","params":["off","smooth",500]}

i’ve been able to turn the bulb on/off, and seems like it 's returning its status

log
10:53:49.459 [INFO ] [ing.tcp.AbstractSocketChannelBinding] - Connecting the channel Channel [item=stairway, command=OFF, direction=OUT, remote=/192.168.31.103:55443, buffer=, isBlocking=false, isReconnecting=false, channel=, host=192.168.31.103, port=55443] 10:53:49.565 [INFO ] [ing.tcp.protocol.internal.TCPBinding] - Updating states with returned values will be set to the default value of true 10:53:49.588 [INFO ] [ing.tcp.protocol.internal.TCPBinding] - The characterset will be set to the default value of ASCII 10:53:49.966 [INFO ] [ing.tcp.AbstractSocketChannelBinding] - The channel for /192.168.31.103:55443 is now connected 10:54:31.225 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'stairway' received command ON 10:54:31.250 [INFO ] [marthome.event.ItemStateChangedEvent] - stairway changed from NULL to ON 10:54:31.571 [WARN ] [rm.AbstractFileTransformationService] - Could not transform '{"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} ' with the file 'yeelight.map' : Target value not found in map for '{"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} ' 10:54:31.576 [WARN ] [ing.tcp.protocol.internal.TCPBinding] - Can not parse input {"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} to match command OFF on item stairway 10:54:31.583 [WARN ] [rm.AbstractFileTransformationService] - Could not transform '{"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} ' with the file 'yeelight.map' : Target value not found in map for '{"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} ' 10:54:31.588 [WARN ] [ing.tcp.protocol.internal.TCPBinding] - Can not parse input {"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} to match command ON on item stairway

i think i just need to find a way to parse the returned json value

1 Like

You might get some help with the JSON from this thread.

Any news on the integration?

Cheers

I’m also curious if there is any progress being made…

Bump for this thread? Any news on the integration?

I did not start as meanwhile, @coasterli, developer at Yeelight steped into.

@coasterli, any news here ?

Coding complete, being tested internal.

@hmerk any advise about how to publish?

See Contributing page.
Basically you need to create a pull request to this repository:

pls publish! thx :slight_smile:

1 Like

Pull request created, waiting for review.

Anyone who has Yeelight product could try to test it in advance.

1 Like

@coasterli could you publish working jar file somewhere? I think it would be helpful for people without development environment.
Thank you

I have one question regarding this binding:
Do you still need to use your smartphone app to link your bulb / lamp with WiFi network? I bought two white LED Bulbs and they are not detected. I tried with Yeelight app and with your binding.

EDIT: Ok, I’ve managed to connect one of them :slight_smile: It would be worth noticing in README that you need to connect your bulbs with smartphone app first. And for some reason in Yeelight app I needed to go to Devices settings and enable Developer Mode.
Then it was discovered by Yeelight binding.

It looks really promising! I’m looking forward to try it out.

BTW. Here’s the link to the built jar: https://dl.dropboxusercontent.com/u/10102270/org.openhab.binding.yeelight-2.0.0-SNAPSHOT.jar

All you need to do is putting it into /addons/ folder in openHAB and you’re ready to add things to inbox.

Hi, guys!

I’ve got Yeelight Bedside lamp, will it work as well? I’ve copied the jar to my OH 2.
I can see the binding in the paper UI but I cannot find a thing.
Please correct me if I’m wrong, is it discovering by bluetooth not wifi?

And also I cannot find where to enable developer mode in the app…

Cheers!
Sasha

I have updated README to notice that PRECONDITIONS.

Please review.

Do you mean I need to add the jar file within my pull request? I didn’t find there is any binding jar in the directory you mentioned.

I am afraid Yeelight Bedside lamp is BLE based, which is not supported by this binding.

All the supported devices are listed in the README.