Can't find and add tradfri bulbs

My setup first: Openhab 2.2.0 on a openhabianpi with the binding-tradfri - 2.2.0: I have had 3 tradfri dimmable white bulbs running with a dimmer and a motions sensor for some time and just now bought a gateway. I was able to add and controll the motion sensor/dimmer/bulbs via the tradfri app and the gateway.
Afterwards I installed the openhab tradfri binding and added the gateway (which worked). Scanning for new devices via the paper UI only returns the gateway/dimmer/motion sensor though. Those have been added to my things/items files and work well. After not finding any bulbs I tried to guess the ID and add them… and they are offline. Any idea how to add them?

I do have some repeating errors in my log from the tradfri binding:

2018-04-22 22:43:08.324 [ERROR] [] - Exception in protocol stage thread: null

java.lang.NullPointerException: null
	at org.eclipse.smarthome.binding.tradfri.internal.model.TradfriDeviceData.<init>( [234:org.eclipse.smarthome.binding.tradfri:0.10.0.b1]
	at org.eclipse.smarthome.binding.tradfri.internal.model.TradfriLightData.<init>( [234:org.eclipse.smarthome.binding.tradfri:0.10.0.b1]
	at org.eclipse.smarthome.binding.tradfri.handler.TradfriLightHandler.onUpdate( [234:org.eclipse.smarthome.binding.tradfri:0.10.0.b1]
	at org.eclipse.smarthome.binding.tradfri.internal.TradfriCoapHandler.onLoad( [234:org.eclipse.smarthome.binding.tradfri:0.10.0.b1]
	at org.eclipse.californium.core.CoapClient$ObserveMessageObserverImpl.deliver( [231:californium-osgi:1.0.6]
	at org.eclipse.californium.core.CoapClient$MessageObserverImpl.succeeded( [231:californium-osgi:1.0.6]
	at org.eclipse.californium.core.CoapClient$MessageObserverImpl.onResponse( [231:californium-osgi:1.0.6]
	at org.eclipse.californium.core.coap.Request.setResponse( [231:californium-osgi:1.0.6]
	at$ClientMessageDeliverer.deliverResponse( [231:californium-osgi:1.0.6]
	at$StackTopAdapter.receiveResponse( [231:californium-osgi:1.0.6]
	at [231:californium-osgi:1.0.6]
	at [231:californium-osgi:1.0.6]
	at [231:californium-osgi:1.0.6]
	at [231:californium-osgi:1.0.6]
	at [231:californium-osgi:1.0.6]
	at [231:californium-osgi:1.0.6]
	at [231:californium-osgi:1.0.6]
	at [231:californium-osgi:1.0.6]
	at$InboxImpl.receiveMessage( [231:californium-osgi:1.0.6]
	at$InboxImpl.access$700( [231:californium-osgi:1.0.6]
	at$InboxImpl$ [231:californium-osgi:1.0.6]
	at$ [231:californium-osgi:1.0.6]
	at java.util.concurrent.Executors$ [?:?]
	at [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201( [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
	at java.util.concurrent.ThreadPoolExecutor$ [?:?]
	at [?:?]

The only reference I found to this error was a github issue: As far as I understand it this should have been fixed by now though? Not sure if this is even the cause of my problems… Or do I need to use some newer version of the binding?

Hi Oliver,

How did you try to add the missing bulbs? Did you use PaperUI or did you configure them manually in your things file? Do you have an example? At which time in this process did the referenced exception occur? Before entering the id or afterwards. Was the id correct?

My first guess is that the id was wrong. And we discovered a new issue which is not related to the one you found.

I used the PaperUI to search for them (and did not find them, while the dimmer and motion sensor showed up). I am not 100% sure when in the process the error message showed up. After finding the 2 items I started to set them all in my things file like this:

Bridge tradfri:gateway:tradfriGateway [ host="", code="xxxxxxxxx" ] {
0820 dimmerKitchen [ id=65542 ]
0107 motionHallway [ id=65539 ]

and it worked just fine. Today I removed the dimmer and one bulb from the tradfri app and readded them and suddenly the bulb showed up in the PaperUI where I was able to control it.
The brightness channel looks like this:
So I took the id and added it to my things/items file:

Bridge tradfri:gateway:tradfriGateway [ host="", code="xxxxxxxxx" ] {
    0100 bulbKitchen [ id=65543 ]
    0820 dimmerKitchen [ id=65542 ]
    0107 motionHallway [ id=65539 ]

Dimmer KitchenBulb { channel="tradfri:0100:tradfriGateway:65543:brightness" }
Slider item=KitchenBulb label="Lampe Küche"
… and it does not react to any changes and does not even show up in my logs.

Earlier I tried to guess the other bulbs’ ids because they are most likely between 39 id and the 42. I will try to remove and readd those bulbs too tomorrow. Maybe they show up then. I will also watch for the error.
Is there any mistake in my definitions? Is that new issue related to this? If more information is needed I would be glad to provide it

One step into the right direction. The things file looks good but the item definition has to be changed. Auto discovery named the thing for the bulbs with the TRADFRI bulb id (e.g. tradfri:0100:tradfriGateway:65543). You gave the bulb the name bulbKitchen. Meaning your item has to be linked to this channel: tradfri:0100:tradfriGateway:bulbSitchen:brightness. I’m pretty sure you will have added your remaining bulbs successfully by the end of the day.

If you can find any information in the exception it will be appreciated if you share them. Thanks.

I finally found the time to get the rest of the lights working. I re-added all of them via the IKEA app and now they are showing up in the paperUI. Strange thing though: I added them to my things file like shown above (with updated ids) and they were shown as online but not working. The strange thing seems to be that some items now show up via their id and some via the name I gave them

When I use the right names for the links to my items everything seems to be working now but I am still not sure if the setup works without the paperUI directly from a things file. The error message from my first post did not show up again though

Sounds good. I use a text-only configuration for the binding. Therefore it should be possible for you too. But it is not a good idea to split it up. Do it in the one way or the other. Not both.


I am new and got the Trafri gateway online. However the bulbs are not visible in the inbox. I added one manually, linked it to the gateway. Filled in quite some id’s like 0100 and also 30-45 just to try.

What am I doing wring here ?