Issue with Hue and Homekit

Hi have some strange behavior when using Homekit to control my Hue devices using OH2.2. (same behavior was already with 2.0 and 2.1)
The Brightness seems to be chosen arbitrary for unknown reason - same for the color - sometimes.
I did some testing with three Hue lights.

I configured below brigthness:

Black Iris - 40% 
Light Strip - 50%
White Iris - 60%

When I activated the scence, two of three lights turned on, but only one with the correct setup.

Black Iris - 40% (Correct)
Light Strip - OFF (Wrong)
White Iris - 59% (Wrong)

I checked the logfile afterwards, and it seems that for unknown reason, some wrong commands are sent in addition to the correct parameters.

For the first device - with the correct activated light, the device received multiple commands - fortunately the last command was the correct one, causing the light to show correctly.

11:26:19.748 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_black_iris_Color' received command ON
11:26:19.822 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_black_iris_Color' received command 255.0,5,0
11:26:19.832 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_black_iris_Color' received command 323,68,0
11:26:19.886 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_black_iris_Color' received command 323,5,40
11:26:19.896 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_black_iris_Color changed from 323,5,0 to 323,5,100
11:26:19.929 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_black_iris_Color changed from 323,5,100 to 323,68,0
11:26:19.950 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_black_iris_Color changed from 323,68,0 to 255.0,5,0
11:26:19.981 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_black_iris_Color changed from 255.0,5,0 to 323,5,40
11:26:26.214 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_black_iris_Dimmer changed from 0 to 40
11:26:26.224 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_black_iris_Toggle changed from OFF to ON

The 2nd and 3rd Light received the correct command as well, however followed by another command with wrong parameters, causing the light to turn off or being activated with the wrong brightness.

11:26:19.781 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_lightstrip_Color' received command ON
11:26:19.843 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_lightstrip_Color' received command 28.0,48,0
11:26:19.864 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_lightstrip_Color' received command 39,48,50
11:26:19.875 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_lightstrip_Color' received command 39,23,0
11:26:19.918 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_lightstrip_Color changed from 39,48,0 to 39,48,100
11:26:19.939 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_lightstrip_Color changed from 39,48,100 to 28.0,48,0
11:26:19.971 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_lightstrip_Color changed from 28.0,48,0 to 39,48,50
11:26:19.992 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_lightstrip_Color changed from 39,48,50 to 39,23,0
11:26:26.233 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_lightstrip_Color changed from 39,23,0 to 39,48,0


11:26:19.811 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_white_iris_Color' received command ON
11:26:19.854 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'eg_wohn_white_iris_Color' received command 337,14,60
11:26:19.907 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_white_iris_Color changed from 337,14,0 to 337,14,100
11:26:19.960 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_white_iris_Color changed from 337,14,100 to 337,14,60
11:26:26.181 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_white_iris_Toggle changed from OFF to ON
11:26:26.193 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_white_iris_Dimmer changed from 0 to 59
11:26:26.204 [INFO ] [smarthome.event.ItemStateChangedEvent] - eg_wohn_white_iris_Color changed from 337,14,60 to 337,14,59

I already tried to change the item configuration but without any success.

//  EG White IRIS
Switch	eg_wohn_white_iris_Toggle	"White IRIS"	(gEG,gLamps) { channel="hue:0200:Hue_Bridge:eg_wohn_white_iris:color" }
Dimmer  eg_wohn_white_iris_Dimmer	"White IRIS"	{ channel="hue:0200:Hue_Bridge:eg_wohn_white_iris:color" }
Color 	eg_wohn_white_iris_Color	"White IRIS"	 [ "Lighting" ] { channel="hue:0200:Hue_Bridge:eg_wohn_white_iris:color" }

//  EG Black IRIS
Switch	eg_wohn_black_iris_Toggle	"Black IRIS"	(gEG,gLamps) { channel="hue:0200:Hue_Bridge:eg_wohn_black_iris:color" }
Dimmer  eg_wohn_black_iris_Dimmer	"Black IRIS"	 { channel="hue:0200:Hue_Bridge:eg_wohn_black_iris:color" }
Color 	eg_wohn_black_iris_Color	"Black IRIS"	 [ "Lighting" ] { channel="hue:0200:Hue_Bridge:eg_wohn_black_iris:color" }

// Light Strip - TV Regal
Switch	eg_wohn_lightstrip_Toggle	"TV Regal" 	(gEG,gLamps) { channel="hue:0210:Hue_Bridge:eg_wohn_lightstrip:color" }
Dimmer  eg_wohn_lightstrip_Dimmer	"TV Regal"	 { channel="hue:0210:Hue_Bridge:eg_wohn_lightstrip:color" }
Color 	eg_wohn_lightstrip_Color	"TV Regal"	 [ "Lighting" ] { channel="hue:0210:Hue_Bridge:eg_wohn_lightstrip:color" }
Dimmer  eg_wohn_lightstrip_ColorTemp	"TV Regal" 	(gEG) { channel="hue:0210:Hue_Bridge:eg_wohn_lightstrip:color_temperature" }

Any clue what is happening here?

I’m using the Hue-Bridge currently to control my lights using Homekit instead of OH as a workaround. However this is not the desired setup, as I want to have everything controlled by the OpenHAB system.

Your support is very much appreciated :slight_smile:

Stefan

Hi Stefan,

How do you call the scene? Are you using a rule?

Hi Pascal,

I call the Scene on my iPad directly using the button.
However I see the same behavior when assigning the Scene to a Homekit rule.
Sometimes the brightness is jumping to 100% as well, when I set it on my iPad with the Homekit control. When you move up or down usually the percentage value does change smoothly. However, sometimes it jump up to 100% or down to 0% without any reason. Hence, the issue is not with the Scene but a general binding problem I think.

I found the same issue on the follow topic described.

I did some further testing - with debugging enabled.
I used a fixed scene, with 40% brightness for one lamp only.

I enabled the Scene and in the debug I see the correct value 40 received for this lamp.

18:43:13.108 [TRACE] [ions.LengthPrefixedByteArrayProcessor] - Received message of length 310. Existing buffer is 0
18:43:13.131 [TRACE] [ions.LengthPrefixedByteArrayProcessor] - Attempting to read message of length 310
18:43:13.162 [TRACE] [ions.LengthPrefixedByteArrayProcessor] - Read complete message
18:43:13.179 [TRACE] [ions.LengthPrefixedByteArrayProcessor] - Returning 1 results
18:43:13.197 [TRACE] [ulfe.hap.impl.http.impl.BinaryHandler] - Received data [/192.168.5.120:52766]:
00000000 50 55 54 20 2F 63 68 61 72 61 63 74 65 72 69 73 PUT /characteris
........

00000110 69 64 22 3A 31 30 2C 22 76 61 6C 75 65 22 3A 34 id":10,"value":4
00000120 30 7D 5D 7D                                     0}]}

Howver then OpenHAB sent a value 0 back, which is causing the light to turn off!

18:43:13.470 [TRACE] [ulfe.hap.impl.http.impl.BinaryHandler] - Sending data [/192.168.5.120:52766]:
00000000 48 54 54 50 2F 31 2E 31 20 32 30 34 20 4E 6F 20 HTTP/1.1 204 No
00000010 43 6F 6E 74 65 6E 74 0D 0A 43 6F 6E 74 65 6E 74 Content..Content
00000020 2D 74 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 -type: applicati
.....
00000090 30 2C 22 76 61 6C 75 65 22 3A 30 7D 5D 7D       0,"value":0}]}

I did several tests, and sometimes the value 40 was sent again, causing the light to turn on with the correct brightness. Sometimes the value 100 was sent, even 40 was received before, causing the light being enabled with the highest brightness.

I suppose the author of this Binding need to support here :worried:

Any support is much appreciated.

Stefan