Philips Hue CLIP 2 API v2 Discussion Thread

^
@laursen could we please try to merge #15324 so that these guys can at least get the benefit of my partial fixes. (It doesn’t entirely solve the problem, but it certainly significantly reduces it…)

2 Likes

I have 2 Hue bulbs which are always turned on and off as a pair. So in OH 2 sendCommand’s with ON or OFF are always executed immediately after each other. These 2 bulbs have failed to turn off both times I experienced this bridge problem. That could maybe indicate the parallel activities is the root cause, as you mention.
The same 2 bulbs are also defined as Ambilight in my Philips TV and switches to that mode whenever the TV is on. However, I do not think this is related, as the TV was off during the last incident.

Yes that would be the same case which my current PR will have fixed. As the PR is not yet merged, I will build a temporary Jar and post it here shortly.


EDIT: the temporary Jar is here

1 Like

I looked more into this, and I guess that if you are using some bulbs as a pair, it would make sense to create a zone. Then OH could send only one command to that zone, and the Hue Bridge would do the rest. Then the parallel activities would not be relevant.

True. But I want to fix it anyway.

JAR downloaded and installed. Thanks Andrew.
I will report new things I found out.

In the meantime there is something new I can report.
After a while triggers are executed more than once:

2023-08-08 10:59:10.018 [INFO ] [openhab.event.ChannelTriggeredEvent ] - hue:device:001788fffe2296fe:167:button-last-event triggered 2000
2023-08-08 10:59:10.018 [INFO ] [openhab.event.ChannelTriggeredEvent ] - hue:device:001788fffe2296fe:167:button-last-event triggered 2000

This happens when pushing a button on a dimmer - the command is send twice (when binding is running some days). Of course the rule for that trigger will be executed twice as well…

The 2000 event is for “button down”. Does the log show any entries for a corresponding “button up” event? In any case, I would need to see a debug log from the binding to see what SSE channel traffic occurred when such double events appear.

1 Like

Hello, I’m changing from API V1 to API V2. In V1 there were to Channels ‘Last updated’, one for motion, one for temperature. Now it seems there is only one channel for temperature. Is this a bug or am I missing anything?

did you try clicking “show advanced” in upper right corner?

Yes I did, as you can see in your screenshot there is only one channel ‘Last updated’ and it refers to temperature

No, it is not. It refers to the last update the Thing received.

1 Like

why do you think 'Last updated’ refers to temperature only?
It refers to the “thing” - to all of the above (motion, battery, …).

Ok, so I misunderstood this channel. In V1 I thought the channel refers to motion only. So I could see when the newspaper came in the morning:-)
To solve my problem, I will implement a rule so I can see when the last motion occured. Thanks for your help.

1 Like

That’s correct. Previously the motion sensor and temperature sensor were two separate Things, and the channel last_updated of the motion sensor Thing represented the time of the last motion.

You could also use a profile to avoid a bunch of rules for this. I just did this when realizing the same problem:

Switch HueMotionSensor_Mailbox_Motion "Motion" <motion> { channel="hue:device:home:motion1:motion" }
DateTime HueMotionSensor_Mailbox_LastMotion "Last motion" <time> { channel="hue:device:home:motion1:motion" [profile="timestamp-change"] }
1 Like

Hello,
today i Install oh4 and Test the clip2 API from Hue. For the moment it works fine. What i dont found is the scene Natural light, this is the 24/7 Scene. How i can activate this Scene?

Thanks

In the Hue app, you need to go to room/zone | scene gallery | select Natural light | add to my scenes. The you need to disable/enable the bridge thing in OH to refresh the stored list of scenes.

1 Like

rearding the issue thta after a while triggers are executed more than once - yes, there is as well the “button short pressed” event twice in the log. Rules will be executed twice as well (not good, because I do a switch ON/switch OFF via rule - means: device switches on and immediately off due to second rule-run again)

2023-08-09 08:54:06.274 [INFO ] [openhab.event.ChannelTriggeredEvent ] - hue:device:001788fffe2296fe:167:button-last-event triggered 2000
2023-08-09 08:54:06.274 [INFO ] [openhab.event.ChannelTriggeredEvent ] - hue:device:001788fffe2296fe:167:button-last-event triggered 2000
2023-08-09 08:54:07.283 [INFO ] [openhab.event.ChannelTriggeredEvent ] - hue:device:001788fffe2296fe:167:button-last-event triggered 2002
2023-08-09 08:54:07.283 [INFO ] [openhab.event.ChannelTriggeredEvent ] - hue:device:001788fffe2296fe:167:button-last-event triggered 2002

I enabled debug logging via

  log:set TRACE org.openhab.binding.hue.internal.connection.Clip2Bridge

and sent you the log via PN, @AndrewFG.

“In the Hue app, you need to go to room/zone | scene gallery | select Natural light | add to my scenes”

The scenes are there since months.

“The you need to disable/enable the bridge thing in OH to refresh the stored list of scenes.
I add Yesterday the thing for hue API2 and add the room with the Natural light Scene. But there are Not in the Scene list.”

How i refresh the list of stored scenes?

Thanks for the log.

It does indeed show that the channel was triggered twice. And the reason is that the binding received the onEventData() twice from the Hue bridge. There could be two possible reasons for this: a) that your bridge did indeed send the event data twice, or maybe b) that the binding had made two SSE subscriptions.

In order to figure out which of the above is the real cause, I am afraid that I shall need even more detailed logging – 1) at trace level, and 2) over more time to see if a second SSE subscription may have been made.

Aha! It seems that “Natural light” is a smart_scene resource instead of a standard scene. It looks like support for smart_scene was recently added to the API v2 so it did not get included in my initial release of the binding. But I will open a new Issue to add support for such.

1 Like