Hue binding support for Hue Friends

Hi,

Reading new idea’s for OH5 I found something about Hue v1 and v2 API. I totally missed that. Busy updating everything to v2 I found one issue related to Hue Friends. I my case the switch. This is what OH shows

.
At item level I get
image.
Button Last Event is not supported.
I’m running OH 4.2.0.M3.
Is support added in a later version?
Where can I find this?

Can you please turn on log:set TRACE, disable then reenable the bridge thing, and post the log file?

Ok I got your logs thank you.

I am replying on the public thread for the benefit of others who may have the same issue.

I can see that your FoH switch does have different capabilities than your own four button switch from Philips. See the capabilities log excerpts below. From my experience I can confirm that the FoH switch is declaring – shall we say it politely – a rather exotic set of capabilities :frowning: – so we would probably need to add some new functionality to the binding in order to add support for such a device. => Can you please tell what exact manufacturer and model is this device? Can you send me a link to its datasheet? How many buttons etc. and what are their respective functions?

1. Four button switch from Philips

		"capabilities": {
			"certified": true,
			"primary": true,
			"inputs": [
				{
					"repeatintervals": [
						800
					],
					"events": [
						{
							"buttonevent": 1000,
							"eventtype": "initial_press"
						},
						{
							"buttonevent": 1001,
							"eventtype": "repeat"
						},
						{
							"buttonevent": 1002,
							"eventtype": "short_release"
						},
						{
							"buttonevent": 1003,
							"eventtype": "long_release"
						},
						{
							"buttonevent": 1004,
							"eventtype": "long_press"
						}
					]
				},
				{
					"repeatintervals": [
						800
					],
					"events": [
						{
							"buttonevent": 2000,
							"eventtype": "initial_press"
						},
						{
							"buttonevent": 2001,
							"eventtype": "repeat"
						},
						{
							"buttonevent": 2002,
							"eventtype": "short_release"
						},
						{
							"buttonevent": 2003,
							"eventtype": "long_release"
						},
						{
							"buttonevent": 2004,
							"eventtype": "long_press"
						}
					]
				},
				{
					"repeatintervals": [
						800
					],
					"events": [
						{
							"buttonevent": 3000,
							"eventtype": "initial_press"
						},
						{
							"buttonevent": 3001,
							"eventtype": "repeat"
						},
						{
							"buttonevent": 3002,
							"eventtype": "short_release"
						},
						{
							"buttonevent": 3003,
							"eventtype": "long_release"
						},
						{
							"buttonevent": 3004,
							"eventtype": "long_press"
						}
					]
				},
				{
					"repeatintervals": [
						800
					],
					"events": [
						{
							"buttonevent": 4000,
							"eventtype": "initial_press"
						},
						{
							"buttonevent": 4001,
							"eventtype": "repeat"
						},
						{
							"buttonevent": 4002,
							"eventtype": "short_release"
						},
						{
							"buttonevent": 4003,
							"eventtype": "long_release"
						},
						{
							"buttonevent": 4004,
							"eventtype": "long_press"
						}
					]
				}
			]

2. Your FoH Switch

		"capabilities": {
			"certified": true,
			"primary": true,
			"inputs": [
				{
					"repeatintervals": [],
					"events": [
						{
							"buttonevent": 16,
							"eventtype": "initial_press"
						},
						{
							"buttonevent": 20,
							"eventtype": "short_release"
						}
					]
				},
				{
					"repeatintervals": [],
					"events": [
						{
							"buttonevent": 17,
							"eventtype": "initial_press"
						},
						{
							"buttonevent": 21,
							"eventtype": "short_release"
						}
					]
				},
				{
					"repeatintervals": [],
					"events": [
						{
							"buttonevent": 19,
							"eventtype": "initial_press"
						},
						{
							"buttonevent": 23,
							"eventtype": "short_release"
						}
					]
				},
				{
					"repeatintervals": [],
					"events": [
						{
							"buttonevent": 18,
							"eventtype": "initial_press"
						},
						{
							"buttonevent": 22,
							"eventtype": "short_release"
						}
					]
				}
			]

BTW I see that your log was taken on a bridge using API v1. It would help me greatly to have the same trace log using API v2. So can you please disable both your v1 and v2 bridge things, then turn on trace logging, and enable ONLY the v2 bridge thing.

1 Like

It was working in that way with the v1 API. With the v2 API I don’t get that information.
Details of the FoH switch

Your FoH Switch
Busch Jaeger 6716 UJ-885
https://www.dedomoticastore.nl/busch-jaeger-6716-uj-885-friends-of-hue-smart-switch-future-linear-zwart-mat-complete-set.html

I will mail you the new log file
[/quote]

@HenMus can you confirm that your switch has a total of 4 contacts? i.e. 2 sets of up-off-down buttons…

See also Philips Hue CLIP 2 API v2 Discussion Thread - #476 by laursen

Yes

I did’t know there was a virtual button. I tested this with the v1 API and indeed pressing 2 buttons together generates another number. I don’t use that function. The problem is I don’t get the number channel.
The first item below is from the v1 API and is working. I get different numbers for different buttons. The last 2 items are created for v2. The second line is not created and is the issue.
PS those FoH switches are always shown as offline but working. I assume they are offline because they don’t have a battery.


Number    IngangSlaapkamerTapSwitch    "Tap switch state"  {channel="hue:0830:1d920141a4:118:tap_switch"}

Number     HueFSlaapkamerIngangTapSwitch           "Tap switch state"      {channel="hue:device:001788fffe639982:7270ad9e-7013-4ac0-91f5-867490ec4e80:button-last-event"}

DateTime   HueFSlaapkamerIngangButtonLastUpdated   "Button last updated"   {channel="hue:device:001788fffe639982:7270ad9e-7013-4ac0-91f5-867490ec4e80:button-last-updated"}
DateTime   HueFSlaapkamerIngangLastUpdated         "Last updated"          {channel="hue:device:001788fffe639982:7270ad9e-7013-4ac0-91f5-867490ec4e80:last-updated"}

Umm. Did you check the “Show advanced” box?

And if that is indeed checked can you please confirm the visibility of the channels as follows.

  • button-last-event is visible
  • button-last-updated is NOT visible
  • last-updated is NOT visible

^
Or is it the other way round?

  • button-last-event is NOT working
  • button-last-updated is visible
  • last-updated is visible

If that is the case then you need to take note that button-last-event is a trigger channel which has different behavior than a normal state channel.

Note you can link normal items to trigger channels … however the item type for such linked items is ‘String’ and not ‘Number’…

I get this

  • button-last-event is NOT visible
  • button-last-updated is visible
  • last-updated is visible

I added the channel below to my items file and it is working. The virtual button is not working but that is fine for me.
Can you maybe explain why this channel is not automatically added?

String     HueFSlaapkamerIngangTapSwitch           "Tap switch state"      {channel="hue:device:001788fffe639982:7270ad9e-7013-4ac0-91f5-867490ec4e80:button-last-event"}

It looks now

Thanks for your support!

What do you mean by “automatically”? What was the process that you were following whereby you expected it to appear automatically?

I go in the GUI to Hue Binding and select a discovered Thing and add it as Thing
image
Than I go in VSC to Things press refresh. Then I go in the items file to the location I want to add the Thing. From the Things menu I press the → button (Create Items from Channels) and they are added to the items file automatically. In this case only

DateTime   HueFSlaapkamerIngangButtonLastUpdated   "Button last updated"   {channel="hue:device:001788fffe639982:7270ad9e-7013-4ac0-91f5-867490ec4e80:button-last-updated"}
DateTime   HueFSlaapkamerIngangLastUpdated         "Last updated"          {channel="hue:device:001788fffe639982:7270ad9e-7013-4ac0-91f5-867490ec4e80:last-updated"}

appeared and I added with your support

String     HueFSlaapkamerIngangTapSwitch           "Tap switch state"      {channel="hue:device:001788fffe639982:7270ad9e-7013-4ac0-91f5-867490ec4e80:button-last-event"}

This is working but still in the Things window of VSC not shown as existing in the items file
image

This is not something that I have ever used; what is VSC? Notwithstanding that I am pretty sure it has nothing to do with the Hue binding as such. I suppose it is probably due to the channel type being ‘trigger’ rather than ‘state’ (it is NOT necessary to have a linked item in order respond to trigger events – you just use the "on xyz channel triggered" syntax within a rule).

I suggest to post a new question in the forum with a title about “VSC auto-suggestion of trigger channels”. As I said before, I am pretty sure it has nothing to do with the Hue binding (and I am absolutely certain it has nothing to do with FoH devices), so I suggest a more generic title in your new post otherwise the experts will probably not see it.


No. They are marked as offline when they do not report their status as ‘connected’. This is probably a bug in the binding: normal Hue buttons always report their status as ‘connected’ whereas your FoH switch reports as ‘unidirectional-incoming’ (which I guess should be interpreted as ‘connected’…

This was the case with the v1API and is solved with the v2 API.

Visual Studio Code

This could be the case. I had the same with the Hue tap dial switch. In both cases the items changed from a state in v1 to a trigger in v2

Indeed. The maintainers asked me to do that in v2 because v1 was doing it wrong.