OSRAM Lightify Openhab2 Binding

My setup consists of:

1x Lightify Gateway
2x E27 RGB Bulbs
2x E14 dimmable Bulbs
1x Lightify dimmer switch

But currently I have only added the 2 E27 and 1 E14 and left the other devices in the inbox. Oh and by the way one of my devices has an umlaut in it’s name on the gateway, maybe I should change that…

I have now joined the Slack team and #smarthome

Christoph,

Thank you so much for doing this! It’s been my hold up to switching to OpenHAB. Within a couple of hours I was able to install OpenHAB for the first time and add all of my Lightify recessed lights and bridge without any problems. I’ve wanted to get off of Smart Things for a while because there was too much delay controlling the lights but didn’t have the time to write the binding myself.

Any thoughts about incorporating the Lightify smart scenes, or whatever they’re called, so we can do the RGB waterfall effects?

Ok updated the lightify binding (https://dl.dropboxusercontent.com/u/17040722/lightify/org.openhab.binding.lightify-2.1.0-SNAPSHOT.jar) and tried to fix a couple of things. So far still only light bulbs are supported but I added a check to make sure all other devices are not tried to be read (at status update) since I expect some of them to ran into a BufferUnderflowException since there was not enough information to be read. The second thing I’ve added is automatic reconnect to the gateway in case the connection got lost. I hope this fixes the biggest issues for now. I also added a few info logs. If a non-supported device was found, it’ll show the type id (please share those lines) and if the plugin needs to reconnect to the lightify gateway.

About features like scenes and effects: I’m still working on to reverse engineer the lightify local protocol, as there’s no documentation about it. I’m sure it is possible to set those things on the LAN protocol but I have to figure out how, that’s just it. Any help on the protocol cracking is appreciated, the progress is here: https://github.com/noctarius/lightify-binary-protocol. Unfortunately I’m on the road quite a bit and while not at home, I cannot try commands :wink:

Hey Noctarius,

so I got your binding working, but the Bulbs are not beeing recognized.
There was a API update a few days ago, so could this be linked to my issue?

I am looking forward to your reply.

Regards Esriel

What API was updated?

It was working fine, but then it stopped a few days ago. Thinking that I may have installed another binding that was messing up my openhab environment, I started over from a clean build. Right now, I only have the OSRAM Lightify binding installed. Openhab finds the gateway, but that’s it, no bulbs. The following error is in the openhab.log

[.lightify.internal.link.LightifyLink] - Found unsupported Lightify device, type id: 2

I tried removing the bridge, removing the addon, and starting over, but each time I have the same results. Right now, I only have 2 recessed white tunable lights, 2 recessed RGB lights, and the osram gateway. Any idea?

Yeah with the last version I added an additional check to find out the type ids of other devices, since I only have RGBW bulbs. Is no bulb available anymore or only tunable white? Would be great to know what the type id 2 means :slight_smile:

Thanks Chris

Right now, it’s only finding the bridge and non of the bulbs. I didn’t have a problem with it detecting my bulbs two weeks ago. I tried numerous times with the version that had worked and then finally gave up and used the newer version you posted 6 days ago and still can’t find any bulbs. Thinking that maybe the light groups were an issue, I’ve removed everything from my setup except for 2 tunable recessed lights. My bridge is runnign Wifi 1.1.3.37 and Zigbee 1.2.0.68. Since you have only RGB bulbs, I’m going to try removing the tunable white from my setup and only adding the RGB.

No I have RGBW which is RGB + Tunable White and those typeid=10, so I guess pure RGB and pure TW use other typeids :slight_smile: That’s why I’m asking for the messages from the logs about “unsupported device type id”.

So you have the TW bulbs. Are those TW bulbs from OSRAM or any other vendor? Some of them seem to use typeid=2, question is which one. If I know, I’ll add them quickly and make it happen for you :slight_smile:

Sorry for the confusion. I should have included the W. I’m using only OSRAM brand recessed lights. The TW and RGBW ones. I don’t think they have a plain RGB recessed version.

I think the TW lights are causing the type id 2 error. If they’re part of my network, I see that error. When I remove them, I no longer see that error. What’s confusing is that I had these lights working perfectly with your binding, and now I can no longer find them.

I have another problem now. I can only get 1 or 2 commands to work before the binding becomes unresponsive, and those commands are slow to respond. For instance, I can turn one of the RGBW lights off then on, then nothing else will work until I restart the openhab2 service. While they’re working, there’s a 4-5 second delay before the lights respond. Once it stops working, every time I try to turn the lights on or off, there’s the following error listed in the openhab.log

[WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@43d62e' takes more than 5000ms.

There’s actually a few more errors that I didn’t notice the first time. Upon restarting the service, there’s a few of these for the bridge and bulbs

2017-04-02 23:34:55.633 [WARN ] [ome.core.thing.internal.ThingManager] - Disposing handler for thing 'lightify:bulb:027d74c8:9F38060000261884' takes more than 5000ms.
2017-04-02 23:35:00.636 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while calling thing handler factory 'org.openhab.binding.lightify.internal.LightifyHandlerFactory@80c4d0'
java.util.concurrent.TimeoutException
        at java.util.concurrent.FutureTask.get(FutureTask.java:205)[:1.8.0_121]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:188)
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:81)
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:65)
        at org.eclipse.smarthome.core.thing.internal.ThingManager.doUnregisterHandler(ThingManager.java:770)
        at org.eclipse.smarthome.core.thing.internal.ThingManager.unregisterHandler(ThingManager.java:758)
        at org.eclipse.smarthome.core.thing.internal.ThingManager.removeThingHandlerFactory(ThingManager.java:1024)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_121]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_121]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_121]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_121]
        at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod$NotResolved.invoke(BaseMethod.java:576)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.inject.BindMethod.invoke(BindMethod.java:655)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager.invokeUnbindMethod(DependencyManager.java:1837)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeUnbindMethod(SingleComponentManager.java:394)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.removedService(DependencyManager.java:375)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.removedService(DependencyManager.java:291)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1241)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1136)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.untrack(ServiceTracker.java:996)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1175)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)[32:org.apache.felix.scr:2.0.6]
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:222)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:908)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:873)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:139)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:950)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:805)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:787)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.dispose(AbstractComponentManager.java:579)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.disposeComponents(ConfigurableComponentHolder.java:706)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.BundleComponentActivator.dispose(BundleComponentActivator.java:523)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator.disposeComponents(Activator.java:452)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator.access$300(Activator.java:54)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:306)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.utils.extender.AbstractExtender$2.run(AbstractExtender.java:290)[32:org.apache.felix.scr:2.0.6]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
        at org.apache.felix.utils.extender.AbstractExtender.destroyExtension(AbstractExtender.java:312)[32:org.apache.felix.scr:2.0.6]
        at org.apache.felix.utils.extender.AbstractExtender.bundleChanged(AbstractExtender.java:186)[32:org.apache.felix.scr:2.0.6]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.doStop(Module.java:624)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.stop(Module.java:488)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1623)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1542)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:248)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:144)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.doStop(Module.java:626)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.stop(Module.java:488)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:186)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:159)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
2017-04-02 23:35:05.692 [WARN ] [ome.core.thing.internal.ThingManager] - Disposing handler for thing 'lightify:bulb:027d74c8:332B060000261884' takes more than 5000ms.
2017-04-02 23:35:18.182 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot unregister handler. No handler factory for thing 'lightify:gateway:027d74c8' found.
2017-04-02 23:35:18.184 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot unregister handler. No handler factory for thing 'lightify:bulb:027d74c8:332B060000261884' found.
2017-04-02 23:35:18.184 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot unregister handler. No handler factory for thing 'lightify:bulb:027d74c8:9F38060000261884' found.

Once the service has restarted and I try turning the bulb on and off, more than once, I see these warnings

2017-04-02 23:47:55.087 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.core.thing.internal.ThingManager@9908fa' takes more than 5000ms.
2017-04-02 23:47:55.091 [WARN ] [ome.core.thing.internal.ThingManager] - Handler for thing 'lightify:bulb:027d74c8:332B060000261884' takes more than 5000ms for processing event
2017-04-02 23:47:56.952 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.core.thing.internal.ThingManager@9908fa' takes more than 5000ms.
2017-04-02 23:47:56.953 [WARN ] [ome.core.thing.internal.ThingManager] - Handler for thing 'lightify:bulb:027d74c8:332B060000261884' takes more than 5000ms for processing event
2017-04-02 23:48:01.977 [WARN ] [ome.core.thing.internal.ThingManager] - Handler for thing lightify:bulb:027d74c8:332B060000261884 takes more than 5000ms for processing event
2017-04-02 23:48:01.977 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.core.thing.internal.ThingManager@9908fa' takes more than 5000ms.
2017-04-02 23:48:06.997 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.core.thing.internal.ThingManager@9908fa' takes more than 5000ms.
2017-04-02 23:48:06.997 [WARN ] [ome.core.thing.internal.ThingManager] - Handler for thing lightify:bulb:027d74c8:332B060000261884 takes more than 5000ms for processing event

OK here’s an updated version again, this time added support back for tunable white bulbs. They should show a color picker anymore :slight_smile: (so real support).

Also tried to fix the above issue but still not 100% sure if that was the reason.

BEFORE INSTALLATION:
Please remove items / things before as the channel definitions have changed!

https://dl.dropboxusercontent.com/u/17040722/lightify/org.openhab.binding.lightify-2.1.0-SNAPSHOT.jar

Hi, so it was not the Update from Osram that was the Problem here.
I now checked my log and my lamps apparently have a different ID aswell.
The ID of my Lamps is 4, at least thats what the log says:

2017-03-30 10:17:09.565 [INFO ] [.lightify.internal.link.LightifyLink] - Reconnecting to lightify gateway: 192.168.178.55:4000
2017-03-30 10:17:09.639 [INFO ] [.lightify.internal.link.LightifyLink] - Found unsupported Lightify device, type id: 4
2017-03-30 10:17:16.065 [INFO ] [.lightify.internal.link.LightifyLink] - Found unsupported Lightify device, type id: 4
2017-03-30 10:17:49.939 [INFO ] [.lightify.internal.link.LightifyLink] - Reconnecting to lightify gateway: 192.168.178.55:4000
2017-03-30 10:17:50.011 [INFO ] [.lightify.internal.link.LightifyLink] - Found unsupported Lightify device, type id: 4
2017-03-30 10:18:27.324 [INFO ] [.lightify.internal.link.LightifyLink] - Found unsupported Lightify device, type id: 4
2017-03-30 10:19:20.175 [INFO ] [.lightify.internal.link.LightifyLink] - Found unsupported Lightify device, type id: 4
2017-03-30 10:20:13.961 [INFO ] [.lightify.internal.link.LightifyLink] - Found unsupported Lightify device, type id: 4

I am using 2 non Tuneable White Lamps in clear and a Tuneable White but as a e14 socket.

I hope this helps resolve my issue

What is “Non Tunable White”? Does that mean only dimmable / switchable but no white temperature and rgb color? Does the Tunable White (E14) show up now?

The “Non Tuneable White” ist Dimmable and Switchable exactly. The Glas on it is Clear.
Here the Amazon link: https://www.amazon.de/LIGHTIFY-Classic-LED-Glühlampe-warmweiß-Kompatibel/dp/B00YSXBK7M/ref=sr_1_2?ie=UTF8&qid=1491223732&sr=8-2&keywords=osram+lightify
For me there are no Lamps beeing fund. Could it be, that I have to wait longer?
Also is there a way to find out the id of all my lamps? I would be glad to support you with the ids :slight_smile:

Added support for “pure white” bulbs of type id 4. Can you see if this works? It should also just show dimming and power state :slight_smile:

https://dl.dropboxusercontent.com/u/17040722/lightify/org.openhab.binding.lightify-2.1.0-SNAPSHOT.jar

I will check as soon as I am at home.
Thank you for your effort in advance.

Am 03.04.2017 17:53 schrieb “Christoph Engelbert” <bot@community.openhab.org

1 Like

Ok so the Bulbs were found and I can add the tuneable white bulb and
control it but the simple ones throw an error:

2017-04-03 18:01:46.981 [INFO ] [g.discovery.internal.PersistentInbox] -
Added new thing ‘lightify:bulb-sb:017b9bdf:384F070000261884’ to inbox.
2017-04-03 18:01:47.000 [INFO ] [g.discovery.internal.PersistentInbox] -
Added new thing ‘lightify:bulb-sb:017b9bdf:3054070000261884’ to inbox.
2017-04-03 18:01:47.018 [INFO ] [g.discovery.internal.PersistentInbox] -
Added new thing ‘lightify:bulb-tw:017b9bdf:5A820B0000261884’ to inbox.
2017-04-03 18:02:02.123 [WARN ] [g.discovery.internal.PersistentInbox] -
Cannot create thing. No binding found that supports creating a thing of
type lightify:bulb-sb.
2017-04-03 18:02:08.037 [WARN ] [g.discovery.internal.PersistentInbox] -
Cannot create thing. No binding found that supports creating a thing of
type lightify:bulb-sb.
2017-04-03 18:52:17.919 [WARN ] [g.discovery.internal.PersistentInbox] -
Cannot create thing. No binding found that supports creating a thing of
type lightify:bulb-sb.

If you need more Info let me know.

Am 03.04.2017 17:55 schrieb “Andreas Harster” <
andreas.harster@googlemail.com>:

I will check as soon as I am at home.
Thank you for your effort in advance.

Am 03.04.2017 17:53 schrieb “Christoph Engelbert” <bot@community.openhab.org

Oops, guess I forgot a line, gimme a second

Alright, try updating again. Should work now :slight_smile: Afterwards we’re trying to figure out what the last missing ID is you’re looking for :slight_smile: