IKEA Trådfri Gateway

Hi Syn,

here is a version of the Tradfri plugin with the new color support, built from the latest Eclipse Smarthome master branch:
Also you can find the updated README there.

Hi Holger,
thanks a lot!
But unfortunately after putting the .jar in the addons folder and a restart, the binding couldn’t be installed (running openHAB 2.2.0 Build #1043):

		[ERROR] [rg.eclipse.smarthome.binding.tradfri] - FrameworkEvent ERROR - org.eclipse.smarthome.binding.tradfri
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.smarthome.binding.tradfri [213]
  Unresolved requirement: Import-Package: org.eclipse.californium.core

	at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599) [?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

Is there something more to do?

Please try to put the other jars in your addons folder as well.
You find them in the previous link.

  • californium-core-1.0.6.jar
  • element-connector-1.0.6.jar
  • scandium-1.0.6.jar

I’ll create a new ESH stable early next week, so stay tuned. We currently have some things that need to be fixed first…


New distro #1048 is available now!

Great, thanks a lot!
After a quick test it seems to run overall fine. But when I change the color in the IKEA Trådfri iOS App to the darkest blue, I get the following error:

==> /var/log/openhab2/openhab.log <==
2017-09-26 19:17:37.493 [ERROR] [alifornium.core.network.CoapEndpoint] - Exception in protocol stage thread: Value must be between 0 and 100
java.lang.IllegalArgumentException: Value must be between 0 and 100
	at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:50) [98:org.eclipse.smarthome.core:]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:35) [98:org.eclipse.smarthome.core:]
	at org.eclipse.smarthome.core.library.types.HSBType.fromRGB(HSBType.java:114) [98:org.eclipse.smarthome.core:]
	at org.eclipse.smarthome.binding.tradfri.internal.TradfriColor.constructHsbTypeFromRgbWithBrightnessPercent(TradfriColor.java:247) [186:org.eclipse.smarthome.binding.tradfri:]
	at org.eclipse.smarthome.binding.tradfri.internal.TradfriColor.fromCie(TradfriColor.java:133) [186:org.eclipse.smarthome.binding.tradfri:]
	at org.eclipse.smarthome.binding.tradfri.handler.TradfriLightHandler$LightData.getColor(TradfriLightHandler.java:423) [186:org.eclipse.smarthome.binding.tradfri:]
	at org.eclipse.smarthome.binding.tradfri.handler.TradfriLightHandler.onUpdate(TradfriLightHandler.java:140) [186:org.eclipse.smarthome.binding.tradfri:]
	at org.eclipse.smarthome.binding.tradfri.internal.TradfriCoapHandler.onLoad(TradfriCoapHandler.java:60) [186:org.eclipse.smarthome.binding.tradfri:]
	at org.eclipse.californium.core.CoapClient$ObserveMessageObserverImpl.deliver(CoapClient.java:1067) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.CoapClient$MessageObserverImpl.succeeded(CoapClient.java:995) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.CoapClient$MessageObserverImpl.onResponse(CoapClient.java:974) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.coap.Request.setResponse(Request.java:509) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.EndpointManager$ClientMessageDeliverer.deliverResponse(EndpointManager.java:267) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.CoapStack$StackTopAdapter.receiveResponse(CoapStack.java:193) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.ObserveLayer.receiveResponse(ObserveLayer.java:137) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.BlockwiseLayer.receiveResponse(BlockwiseLayer.java:321) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.ReliabilityLayer.receiveResponse(ReliabilityLayer.java:269) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.stack.CoapStack.receiveResponse(CoapStack.java:135) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.CoapEndpoint$InboxImpl.receiveMessage(CoapEndpoint.java:656) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.CoapEndpoint$InboxImpl.access$700(CoapEndpoint.java:562) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.CoapEndpoint$InboxImpl$1.run(CoapEndpoint.java:574) [175:californium-osgi:1.0.6]
	at org.eclipse.californium.core.network.CoapEndpoint$5.run(CoapEndpoint.java:721) [175:californium-osgi:1.0.6]
	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) [?:?]

Thanks for your report!
I created an issue: https://github.com/eclipse/smarthome/issues/4349

Edit: Fixed with https://github.com/eclipse/smarthome/pull/4351

I’m trying to start up with this binding - however i don’t have a remote to the Gateway - will there be any other solution for pairing the bulbs with the gateway other than i need to buy a remote only for the pairing? The binding can’t do something like that?

Sorry byt you need one remote to get the lights into the system.

Check post 70 from this thread, @MortenVinding was able to do pairing only with gateway, without remote

I noticed @OMR mentioning a buzzing noise on the 30x90 FLOALT, and the 30x30 being dead silent. I experience the exact same thing here. And it was so noisy i exchanged it at the Ikea warehouse for a new one, but its the same noise on this one. Experiences? My house is quiet when the kids are outdoors :slight_smile:


Thanks for the group for adding the trådfri binding! It’s a great to see how neatly it works.

One question about the groups, have they been introduced only in 2.2 or should they work also in 2.1?
I have the 2.1 release version of the binding running, if 2.2 is required, is the Jar somewhere available, or do I need to drag myself to my dev system and build one? :slight_smile: Additionally, how can I figure out the group id? Or would a newer version of the binding discover those automatically as well?

Native group support is not yet implemented.
At the moment, you can only use normal “Group” items in OpenHAB to group your bulbs together.
See: IKEA Traadfri Groups - Not always turning all lights off

Thanks for the reply!
I found this example from sourceror

Bridge tradfri:gateway:gwa0cc2b6d6e7b [ host=“yourip", code=“yoursecuritycode" ] {
    0220 tradfri_light_attic [ id=65539 ]
    0220 tradfri_light_bedroom [ id=65537 ]
    group tradfri_group_livingroom [ id=140890 ]
    group tradfri_group_bedroom [ id=132922 ]
    group tradfri_group_attic [ id=147073 ]

Looks to me like the groups work somewhere :slight_smile:

This is from unfinished development.
Reference: https://github.com/eclipse/smarthome/pull/3799

Thanks for the link.
Will checkout, build and give it a try.


Thank you for the binding, it has been working very well.

I have noticed an issue, if I restart OpenHab, the TradFri gateway, and the router at the same time (I’ve been having power outages due to storm). The binding will not correctly connect.

What appears to happen is:

  • The gateway restarts and uses a self-assigned IP address because the router is not yet booted.
  • Openhab starts, the binding discovers the gateway, and stores it’s IP.
  • The router starts, and the gateway receives the correct IP (via DHCP).
  • The binding doesn’t detect the change.

Restarting Openhab corrects the problem, but it would be nice to work correctly from a cold start.

Thank you again for all your hard work.

I just bought a Trådfri Color bulb (there aren’t shown on the IKEA Homepage yet).

May I ask where these are available? Just in Europe/Scandinavia? I see they are not listed on the Canadian IKEA site, either…

I dont’t think they are only available in Europe. On the US IKEA site they are listed: http://www.ikea.com/us/en/catalog/products/20353289/

I bought the bulb in a german IKEA store. At that time they weren’t listed online. So maybe it’s only a matter of time until they are available at the Canadian IKEA site, maybe they are also already available at the local IKEA stores.

1 Like

I have a workaround

  • I set a static IP address for the Gateway
  • I configure this address for the binding.
1 Like