Yeelight binding?

hue
Tags: #<Tag:0x00007f014362a750>

(Alex) #81

Yep, but I don’t understand what should I enter in the location field. It is not the field for IP. In case if yeelight was added manually then I see that it is offline all time. I see that someone had same problems with multicast packets. I had VirtualBox on my PC, but it was deleted yesterday. Still observing this issue. Probably I will try to move OpenHab to Linux and see the result.


(yaazzz) #82

No need to enter something in the location field. Just put your ip and the token. It is working on my RPI3 : done yesterday.


(Ray) #83

I have OH running on a VM w7, on my qnap nas, works great!
I see what you mean when adding it manually, when i look at the settings of my working color bulb i see this in the properties under " location" strange place but ok, yeelight://192.168.1.174:55443
It is the ip adress, can you try with your ip


(Alex) #84

huh! I don’t know what I did, but now it works. First of all, after few attempts, Yeelight appeared in my inbox and then I was able to configure it without any issues. X-Ray181 thank you so much!


(Ray) #85

Happy to help!, with some bindings it takes a while for devices to appear in inbox, I’m testing a BETA for the Broadlink devices, and there devices appear and disappear by them selfs :rofl:, its all part off a great hobby!
Ray


(Eyal ) #86

Hi, I am new to openhab and this is my first try with it.
I have OH2.1 on win10

i have a similar problem

I was able to add the bulb as a thing one time and it worked for a while but than turned offline.

i deleted it and can’t add it again.

I tried resetting the bulb itself’ but i can’t find it again.

Thank you for any help


(Eyal ) #87

I installed openhab on rpi and everything is ok

I guess it doesn’t work well with win 10


(Talat Keles) #88

Thanks for this great binding. My yeelight bulb arrived and it has working quite well OH2 on rPi for 2 days. rPi is ethernet connected, paper ui discovered the thing without any problem. With aid of example items I can control it without any lag via OH. Now I’m working on rules for sunrise simulation.

Edit: Today i changed bulb’s location. I can control in official app but not OH which shows offline :confused: Removed and manually added thing, removing and installing addon zip file didn’t work. Looking for a solution. I’ll edit whenever I find. No idea what caused it.

Edit 2: I’ve a wireless bridge router to cover whole house, beside main modem-router. Original location was living room which is next to main router. New location of bulb is bedroom which is covered by bridge.
I took bulb to living room, thing became online. Then I brought it back to bedroom which made it offline. Later on I deactivated wifi of main, than re-activating made thing online while bulb is in bedroom. Bridge has same SSID and pass. Maybe some conflict caused this situation. It is working as expected.


(Andy) #89

I had some trouble regarding the Yeelights. When i switched them OFF with a wall-mounted switch, they do not come back ONLINE after switching with wall-mounted switch ON. When i restarted the binding within KARAF the lights went ONLINE immediately.
I made a work-around with my FRITZ-Box. First i checked that the Yeelights always get the same IP from my router. Then with the Network-Binding i got OPEN and CLOSE when the lights are ONLINE and OFFLINE.

This little rule restarts the Yeelight-Binding after the bulbs go Online:

//Yeelight-Binding Neustart nachdem sie über Fritz online sind
//import org.openhab.model.script.actions.*
//var Timer timer = null

rule "Yeelight Restart"
when
	Item YeelightRestart received command ON or
	Item Esszimmerlicht1 changed from CLOSED to OPEN
then
	logInfo("Yeelight Rule","Timer für Yeelight-Binding gestartet")
	Thread::sleep(10000)
	val String results = executeCommandLine("ssh -i /var/lib/openhab2/.ssh/openhab.id_dsa openhab@localhost -p 8101 bundle:restart 188",15000)
	logInfo("Yeelight Rule","Yeelight Restart wg. Update")
	logInfo("Yeelight Rule",results)
	YeelightRestart.sendCommand(OFF)
	logInfo("Yeelight Rule","Yeelight-Binding Neustart erledigt")
end

Greets
Andy


(Matteo Giorgi) #90

Good evening,
I have openhabian installed on a Raspberry PI and a Yeelight Color LED Stripe, connected to WIFI and with LAN Control enabled.
I added the Yeelight Binding (org.openhab.binding.yeelight-2.1.0-SNAPSHOT.zip) to the directory /usr/share/openhab2/addons/
It’s the right binding?
I see binding in Paper UI, but I can not show the Yeelight in Inbox :frowning_face:
Where do I need to enter IP and Token? The Token where is it?
How do I do it?
Thank you
Matteo


(Talat Keles) #91

My yeelight is working normal when controlled manually via ui.
I’m working on sun rise simulation rule based on Wake Up Light and Help with hue sunrise rule

My items are simple ones given in above i.e dimmer items for brightness and color_temperature and color item for color channel.

First of all Color Item HSB brightness value looks like no effect. I tried paper ui, basic ui, android and ios apps and direct manipulation. HSB commands are sent but changing B value doesn’t change brightness. I don’t know it this is yeelight’s, binding’s of openhab’s problem.

Color temperature based rule works fine however I’m strugling in color one. For debugging I’m using direct item manipulation. Below is commands and logs for bulb off at start. Brightness is send manually due to above problem. Color item behaves odd, which makes choppy color changes, jumping around.

for Hue +1, Sat -1, Bri +1

**openhab> smarthome:send Yeelight1_Dimmer 1**
22:23:25.229 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 1
22:23:25.248 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Dimmer' received command 1
22:23:25.261 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 0 to 1
22:23:25.276 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 1 to 61
22:23:25.285 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Switch changed from OFF to ON
22:23:26.759 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 61 to 1
**openhab> smarthome:send Yeelight1_Color 0,99,1**
22:23:50.172 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 0,99,1
22:23:50.187 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Color' received command 0,99,1
22:23:50.204 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 60,69,60 to 0,99,1
22:23:50.229 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 0,99,1 to 0,100,0
**openhab> smarthome:send Yeelight1_Dimmer 2**
22:24:21.135 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 2
22:24:21.147 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Dimmer' received command 2
22:24:21.167 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 1 to 2
**openhab> smarthome:send Yeelight1_Color 2,98,2**
22:24:32.001 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 2,98,2
22:24:32.012 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Color' received command 2,98,2
22:24:32.025 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 0,100,0 to 2,98,2
22:24:32.672 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 2,98,2 to 0,100,1
**openhab> smarthome:send Yeelight1_Dimmer 3**
22:38:52.073 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 3
22:38:52.089 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Dimmer' received command 3
22:38:52.142 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 2 to 3
**openhab> smarthome:send Yeelight1_Color 3,97,3**
22:39:00.385 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 3,97,3
22:39:00.402 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Color' received command 3,97,3
22:39:00.429 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 0,100,1 to 3,97,3
22:39:00.446 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 3,97,3 to 0,100,2

for Hue +1, Sat -1, Bri +2

**openhab> smarthome:send Yeelight1_Dimmer 1**
22:52:16.880 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 1
22:52:16.902 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Dimmer' received command 1
22:52:16.945 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 0 to 1
22:52:16.958 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 1 to 99
22:52:16.973 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Switch changed from OFF to ON
22:52:18.420 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 99 to 1
**openhab> smarthome:send Yeelight1_Color 0,99,1**
22:52:36.186 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 0,99,1
22:52:36.205 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Color' received command 0,99,1
22:52:36.212 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 0,0,100 to 0,99,1
22:52:36.261 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 0,99,1 to 0,100,0
**openhab> smarthome:send Yeelight1_Dimmer 3**
22:52:45.859 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 3
22:52:45.877 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Dimmer' received command 3
22:52:45.899 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 1 to 3
**openhab> smarthome:send Yeelight1_Color 2,98,3**
22:52:53.527 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 2,98,3
22:52:53.556 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Color' received command 2,98,3
22:52:53.576 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 0,100,0 to 2,98,3
22:52:53.599 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 2,98,3 to 0,100,2
**openhab> smarthome:send Yeelight1_Dimmer 5**
22:52:56.473 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 5
22:52:56.502 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Dimmer' received command 5
22:52:56.528 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Dimmer changed from 3 to 5
**openhab> smarthome:send Yeelight1_Color 4,97,5**
22:53:02.783 [INFO ] [yeelight.handler.YeelightHandlerBase] - YeelightColorHandler: command: 4,97,5
22:53:02.796 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Yeelight1_Color' received command 4,97,5
22:53:02.829 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 0,100,2 to 4,97,5
22:53:02.847 [INFO ] [marthome.event.ItemStateChangedEvent] - Yeelight1_Color changed from 4,97,5 to 4,100,4

Edit: I played with rule, when dimmer is constant, hue and sat doesn’t jump around. Whenever dimmer item changed, HSB values go crazy.


(The Squid) #92

I just received my first yeelight and noticed that after I make any adjustment (turn on, turn off, change color, change level, etc) my Karaf console gets flooded with with data…

Any way to turn that off?

openhab> ######### this is control command response, don't need to notify status
 change!
status = DeviceStatus [isPowerOff=false, r=255, g=30, b=56, color=16719416, brig
htness=100, ct=4000, hue=0, sat=100, isFlowing=false, delayOff=-1, mFlowItems=nu
ll, mode=MODE_COLOR, isMusicOn=false, name=]
######### this is control command response, don't need to notify status change!
######### this is control command response, don't need to notify status change!
status = DeviceStatus [isPowerOff=false, r=255, g=45, b=49, color=16723249, brig
htness=100, ct=4000, hue=0, sat=100, isFlowing=false, delayOff=-1, mFlowItems=nu
ll, mode=MODE_COLOR, isMusicOn=false, name=]
######### this is control command response, don't need to notify status change!
######### this is control command response, don't need to notify status change!
######### this is control command response, don't need to notify status change!
######### this is control command response, don't need to notify status change!
status = DeviceStatus [isPowerOff=false, r=255, g=228, b=56, color=16770104, bri
ghtness=100, ct=4000, hue=0, sat=100, isFlowing=false, delayOff=-1, mFlowItems=n
ull, mode=MODE_COLOR, isMusicOn=false, name=]
######### this is control command response, don't need to notify status change!
######### this is control command response, don't need to notify status change!
######### this is control command response, don't need to notify status change!
######### this is control command response, don't need to notify status change!
######### this is control command response, don't need to notify status change!
status = DeviceStatus [isPowerOff=false, r=122, g=255, b=140, color=8060812, bri
ghtness=100, ct=4000, hue=0, sat=100, isFlowing=false, delayOff=-1, mFlowItems=n
ull, mode=MODE_COLOR, isMusicOn=false, name=]
######### this is control command response, don't need to notify status change!
status = DeviceStatus [isPowerOff=false, r=134, g=94, b=255, color=8806143, brig
htness=100, ct=4000, hue=0, sat=100, isFlowing=false, delayOff=-1, mFlowItems=nu
ll, mode=MODE_COLOR, isMusicOn=false, name=]
######### this is control command response, don't need to notify status change!
status = DeviceStatus [isPowerOff=false, r=255, g=51, b=241, color=16724977, bri
ghtness=100, ct=4000, hue=0, sat=100, isFlowing=false, delayOff=-1, mFlowItems=n
ull, mode=MODE_COLOR, isMusicOn=false, name=]
######### this is control command response, don't need to notify status change!
status = DeviceStatus [isPowerOff=true, r=255, g=51, b=241, color=16724977, brig
htness=100, ct=4000, hue=0, sat=100, isFlowing=false, delayOff=-1, mFlowItems=nu
ll, mode=MODE_COLOR, isMusicOn=false, name=]


(Thorsten Loers) #93

I have the same issue. turned on and off a few times … even switched LAN-Control on and off several times, but the color bulb won’t show in INBOX. Also scanning manually won’t bring any results. Suggestions would be highly appreciated. :slight_smile:
thanks in advance


(Andreas B ) #94

Is the binding also working with the Yeelight Bedside Lamp? (2nd version with WiFi)

Thank you in advance.


(Daniel Linder) #95

tried, did not work


(Stefano) #96

Good day to everyone, I’m new user, so I’ve installed Opnehab 2.2 on raspberry (full installation no Opehabian), with the new strech system for raspberry. I love xioami product, so my gateway works very well but for the yeelight is hard work. I’ve installed the binding 2.1.0 (the zip file metioned above). The binding seems to be ok but when i try to find my Yeelight ceiling nothing is found. May anyone can help me? Do I have to install also Zulu java (raspberry scretch has JAVA8 already installed)? On domoticz the Yeelight is very easy because i can directly configure the ip address but here it seems to be impossible. At the end take in account that with the new firmware the Yeelight ceeling can be used also as Bluethoot gateway for the other xiaomi ligth that are only in bluetooth. Do you thing that the binding should be updated? Thank you very much for everyone who works on.


(Tom M ) #97

the lamp works at this time only with the Xiaomi Mi IO Binding and the Token. But there you can use only On/OFF and brightness.

I also hope for a yeelight binding update.


(TK) #98

I got Yeelight ceiling lamp recognized by OpenHAB (using Xiaomi Mi IO Binding with token). Linked power (channel) to switch type item and added switch to sitemap.

But when I’m using the switch from sitemap, state will be changed to OFF and immediately to ON. Could not switch light on and off:

2018-01-22 18:09:17.197 [ome.event.ItemCommandEvent] - Item 'YeelightLEDCeilingLamp1_Power' received command OFF
2018-01-22 18:09:17.202 [vent.ItemStateChangedEvent] - YeelightLEDCeilingLamp1_Power changed from ON to OFF
2018-01-22 18:09:17.309 [vent.ItemStateChangedEvent] - YeelightLEDCeilingLamp1_Power changed from OFF to ON

Don’t have a clue what causes this … anyone faced this?


(marcel) #99

This means your lamp does not respond to the on/off command as send.
Right after the sending of the command, the binding requests the state again from the light. As the status is not changed, the state is switched back.

Some of the yeelights expect multiple parameters when switching on/off, current the binding only sends single command this might be the reason for your issue.

You may be able to send a ‘custom command’ to the lamp
set_power [“on|off”, “smooth”, 5000]

it may even need a mode after the 5000 part.e.g. set_power ["on", "smooth", 5000,1]

0: last mode
1: normal mode
2: rgb mode
3: hsv mode
4: color flow
5: moonlight

if that improves, let me knwo the modelId you see and I may be able to update it in the database.


(Andreas B ) #100

Yeelight Binding is completely broken for me - all lamps are shown offline and I do have several errors. Only thing I did is updating java. But I already tried version 152 and version 144 again and it is still not working. All my lamps (around 30?) are offline… it is the worst thing that could happen :confused:

Here are some errors:

Jan 28 20:56:52 openhabpi karaf[2960]: java.lang.IllegalArgumentException: No enum constant com.yeelight.sdk.enums.DeviceType.bslamp1
Jan 28 20:56:52 openhabpi karaf[2960]:         at java.lang.Enum.valueOf(Enum.java:238)
Jan 28 20:56:52 openhabpi karaf[2960]:         at com.yeelight.sdk.enums.DeviceType.valueOf(DeviceType.java:1)
Jan 28 20:56:52 openhabpi karaf[2960]:         at com.yeelight.sdk.device.DeviceFactory.build(DeviceFactory.java:29)
Jan 28 20:56:52 openhabpi karaf[2960]:         at com.yeelight.sdk.services.DeviceManager$2.run(DeviceManager.java:130)
Jan 28 20:56:52 openhabpi karaf[2960]:         at java.lang.Thread.run(Thread.java:748)


18:58:25.416 [WARN ] [fig.xml.osgi.XmlDocumentBundleTracker] - The XML document '/ESH-INF/binding/binding.xml' in module 'org.openhab.binding.yeelight' could not be parsed: The XmlConfigDescriptionProvider must not be null!
java.lang.IllegalArgumentException: The XmlConfigDescriptionProvider must not be null!
        at org.eclipse.smarthome.core.binding.xml.internal.BindingInfoXmlProvider.<init>(BindingInfoXmlProvider.java:60) [116:org.eclipse.smarthome.core.binding.xml:0.10.0.b1]
        at org.eclipse.smarthome.core.binding.xml.internal.XmlBindingInfoProvider.createDocumentProvider(XmlBindingInfoProvider.java:141) [116:org.eclipse.smarthome.core.binding.xml:0.10.0.b1]
        at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.acquireXmlDocumentProvider(XmlDocumentBundleTracker.java:181) [112:org.eclipse.smarthome.config.xml:0.10.0.b1]
        at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.addingObject(XmlDocumentBundleTracker.java:206) [112:org.eclipse.smarthome.config.xml:0.10.0.b1]
        at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.parseDocuments(XmlDocumentBundleTracker.java:350) [112:org.eclipse.smarthome.config.xml:0.10.0.b1]
        at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.processBundle(XmlDocumentBundleTracker.java:336) [112:org.eclipse.smarthome.config.xml:0.10.0.b1]
        at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.access$3(XmlDocumentBundleTracker.java:331) [112:org.eclipse.smarthome.config.xml:0.10.0.b1]
        at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker$2.run(XmlDocumentBundleTracker.java:307) [112:org.eclipse.smarthome.config.xml:0.10.0.b1]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

I do not know how that happened, but I need to resolve it fast…

Thank you in advance!


Edit: Same problems with “Zulu”…