Hue Smart Button Thing and Items Unknown (API v2)

As my SD card broke last week I decided to install openhab on my Raspberry Pi 4 from scratch.
Was using openHAB 3.4 before and went for the openHABian release, so my openHAB version is 4.0.4.
On 3.4 I was using Hue Binding on API v1, but want to go v2 now.

After reading the docs and configure my devices it turns out everything but the bridge (which is online) shows as unknown. And if I check the items in UI the channels are shown unknown as well.
If I press the button the Item gets no number.

Since I use the configuation the same way as they are in the documentation (smart button instead of wall button) what might I be missing. Has anyone a working configuration or a hint for his hue setup?

My things (removed all but bridge/button for the example):

Bridge hue:bridge-api2:001788fffe2b3acd “Philips Hue Bridge” [ipAddress=“192.168.10.12”, applicationKey=“abiblablu”] {
Thing device 9f9094f5-943c-4075-bea3-418f855413e5 “Hue Smart button” [resourceId=“9f9094f5-943c-4075-bea3-418f855413e5”] // Hue Smart button idV1:/sensors/29
}

My items

Number SmartButton_LastEvent “Smart Button Last Event” {channel=“hue:device:001788fffe2b3acd:9f9094f5-943c-4075-bea3-418f855413e5:button-last-event”}
Switch SmartButton_BatteryLow “Smart Button Battery Low” {channel=“hue:device:001788fffe2b3acd:9f9094f5-943c-4075-bea3-418f855413e5:battery-low”}

The OH console command will show you what potential things are actually in your bridge…

openhab:hue <brigeUID> things

Thank you.

I know, as it is described in the documentation.
I’ve added all the things via this command they are still all shown unknown in UI.


Try disabling the bridge (in OH UI) and the reenable it again.

Doesn’t change the state, but re-enabling shows the following error:

java.lang.IllegalStateException: Duplicate key Sternenlicht (attempted merging values 2b6a692c-bd31-426f-ab59-a272d404de7f and 6ec7681a-1bea-41a6-b628-f6c26e51d878)
	at java.util.stream.Collectors.duplicateKeyException(Collectors.java:135) ~[?:?]
	at java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182) ~[?:?]
	at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:?]
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
	at org.openhab.binding.hue.internal.handler.Clip2ThingHandler.updateSceneContributors(Clip2ThingHandler.java:1125) ~[?:?]
	at org.openhab.binding.hue.internal.handler.Clip2ThingHandler.onResourcesList(Clip2ThingHandler.java:658) ~[?:?]
	at org.openhab.binding.hue.internal.handler.Clip2BridgeHandler.lambda$11(Clip2BridgeHandler.java:739) ~[?:?]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
	at org.openhab.binding.hue.internal.handler.Clip2BridgeHandler.updateThingsNow(Clip2BridgeHandler.java:736) ~[?:?]
	at org.openhab.binding.hue.internal.handler.Clip2BridgeHandler.lambda$12(Clip2BridgeHandler.java:763) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]

What I wonder now, what is “Sternenlicht”. It’s none of my things.

It sounds like this is sceen on my hue bridge that’s available twice, but checking the name, it’s only there once. Guess this is not an openHAB issue. :frowning:

Oh wow, it’s definetly an issue with the API implementation. It’s reproducable.

If you add a scene from the gallery to your favorites (My scenes) then it’s “copied” there with the same name and the Binding is broken (exception above).

To whom can I send a bug report?

Me. :slight_smile: … so done.

@TiQ AFAIK “Sternenlicht” sounds to me like an effect rather than a scene. It is probably the German equivalent of the “sparkle” effect. So it would therefore probably be associated with a specific lamp device rather than a room or zone. Could you test this by using the Hue app to see if there are any lamps which support the Sternenlicht effect? And if found, then disable that corresponding thing in OH to see if the problem goes away?

I am travelling today, so I can probably only do the fix / diagnosis from tomorrow onwards.

I removed all custom scenes from the room - my gf probably added her own scene with the same name that alreaddy existed from the gallery - and was not able to reproduce the issue afterwards.

So I decided to add one from the gallery, modify it and pull the same from the gallery again. The app automatically renames the second one to “Sternenlicht 2”.
But then I found that you can copy the scene so I copied it to the same room, which might be a very uncommon use case. But I ended up having the same scene twice and also get the exception in OH again.

2023-11-20 12:30:42.455 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.IllegalStateException: Duplicate key Sternenlicht (attempted merging values be8ec293-3845-4101-a640-99c437f0d7bc and e42ac493-023e-4f6f-8536-52e4eeb5f890)
at java.util.stream.Collectors.duplicateKeyException(Collectors.java:135) ~[?:?]
at java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182) ~[?:?]

@TiQ that’s cool :wink: … I could probably eliminate the error by ignoring the duplicate scene; but obviously when you activated Sternenlicht from within OH, it would be a quite random chance if you are activating the one or the other.

@TiQ I made a new test build of the Hue binding which eliminates duplicate scenes having the same name. But before I officially release the new version, can you please test it in your case, and confirm that it works? Simply uninstall the official Hue binding via OH Main UI, then download the new Jar file from the link below and drop it in your addons folder. Note: I built this for the current OH v4.1 Milestone release version, so if you are on v4.0x. you may need to upgrade to v4.1-M3 …