IKEA Trådfri Gateway

My openhab2 does not receive the status updates of a bulb made in the app or with a remote but when changing status in openhab2 it’s reflected in the app. Is this normal behaviour?

I also experienced this behaviour.
After a sudo systemctl restart openhab2.service it started working again. (uptime was 10+ days)
I now receive status from both the .brightness channel and the .temperature channel when adjusting from the Tradfri remote. I did not power cycle the HUB.

Yes now it’s working…thanks

1 Like

It is still not merged with master but you can play with the jars that you
can find here: https://github.com/S0urceror/tradfri-jars

It happened to me again. Seems like this happens after a few days. No events reported to Rules.
This is a less drastic way to get ut working again: (from Karaf console: ssh openhab@localhost -p 8101)

openhab> bundle:list | grep -i trad                                                                                                        13:29:11
180 │ Active   │  80 │ 0.9.0.201709011622     │ Tradfri Binding
openhab> bundle:restart 180                                                                                                                13:30:15
bundle:restart "Tradfri Binding" 

should work as well, That doesn’t fix anything, but it saves you some typing. You could even set a cron job to run something like this every night until it is resolved

sshpass -p habopen ssh -p 8101 openhab@localhost  "bundle:restart 'Tradfri Binding'"

Curious user here: what is the observed stability of this binding in collab with the Tradfri system? Is it stable enough to use as a serious alternative to for instance hue or Z-wave? In other words: how is the WAF?

I’ve implemented some basic support for the color bulbs, but the conversion of the color is not very good at the moment.

4 Likes

@Syn / @dandanx

FYI: Color support for IKEA Tradfri has just been merged.

Issue:

Pull request:

3 Likes

Am I right, that this is not yet integrated in openHAB 2.2.0 Build #1043, or do I miss something?

Correct, see https://github.com/eclipse/smarthome/wiki/ESH-used-in-openHAB.

Hi Syn,

here is a version of the Tradfri plugin with the new color support, built from the latest Eclipse Smarthome master branch:
https://cloud.h0lger.de/index.php/s/5rAHDzerbSSn0Rg
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…

3 Likes

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:0.9.0.201709260841]
	at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:35) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
	at org.eclipse.smarthome.core.library.types.HSBType.fromRGB(HSBType.java:114) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
	at org.eclipse.smarthome.binding.tradfri.internal.TradfriColor.constructHsbTypeFromRgbWithBrightnessPercent(TradfriColor.java:247) [186:org.eclipse.smarthome.binding.tradfri:0.9.0.201709260841]
	at org.eclipse.smarthome.binding.tradfri.internal.TradfriColor.fromCie(TradfriColor.java:133) [186:org.eclipse.smarthome.binding.tradfri:0.9.0.201709260841]
	at org.eclipse.smarthome.binding.tradfri.handler.TradfriLightHandler$LightData.getColor(TradfriLightHandler.java:423) [186:org.eclipse.smarthome.binding.tradfri:0.9.0.201709260841]
	at org.eclipse.smarthome.binding.tradfri.handler.TradfriLightHandler.onUpdate(TradfriLightHandler.java:140) [186:org.eclipse.smarthome.binding.tradfri:0.9.0.201709260841]
	at org.eclipse.smarthome.binding.tradfri.internal.TradfriCoapHandler.onLoad(TradfriCoapHandler.java:60) [186:org.eclipse.smarthome.binding.tradfri:0.9.0.201709260841]
	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.