[SOLVED/BUG][hue 2.4.0] Hue binding stopped accepting HSB values

Hardware: Raspberry Pi 3 B+
OS: Raspbian 9 (stretch) with openhabian
oH: 2.4.0-1 (Release Build)
Binding: 2.4.0

things

Bridge hue:bridge:1 [ipAddress="192.168.x.x", userName="<username>"]
{
    0210 hueFlur [lightId="9"]
}

items

Switch hueFlur "Flur" (Lights) {channel="hue:0210:1:hueFlur:color"}
Dimmer hueFlur_Dimmer {channel="hue:0210:1:hueFlur:color"}
Color hueFlur_Color {channel="hue:0210:1:hueFlur:color"}
Dimmer hueFlur_Temp {channel="hue:0210:1:hueFlur:color_temperature"}
String hueFlur_Alarm {channel="hue:0210:1:hueFlur:alert"}
Switch hueFlur_Effect {channel="hue:0210:1:hueFlur:effect"}

rule

rule "Flur Licht morgens"
when
    Item itmFIBmotion2 changed to 1
then
    hueFlur_Color.sendCommand("360,80,30")
end

I just made the upgrade from oH 2.3.0 to 2.4.0 and now i´m not able to control my hue bulbs anymore.
The rule above worked with 2.3.0 but now throws an error that "360,80,30" cannot be converted to a command type.

2019-01-03 23:54:42.320 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '360,80,30' to a command type which item 'hueFlur_Color' accepts: [HSBType, PercentType, OnOffType, IncreaseDecreaseType, RefreshType].

I had a look at the changlog of 2.4.0 but it only says:
Enhancements
5946 Added support for bulbs using CIE XY colormode only
6511 Added support for sensors
Bug Fixes
6629 Fixed brightness of 1 shown as OFF

How do i control my hue bulbs with 2.4.0?

And where do i get the .jar files for 2.3.0 bindings…?

kind regards
Michael

Looks like there´s a bug in the binding.
When changing the bulb with the hue app a error is shown in the logs

2019-01-04 00:14:18.300 [ERROR] [ue.internal.handler.HueBridgeHandler] - An exception occurred while calling the BridgeHeartbeatListener
java.lang.IllegalArgumentException: Hue must be between 0 and 360
	at org.eclipse.smarthome.core.library.types.HSBType.validateValue(HSBType.java:106) ~[102:org.eclipse.smarthome.core:0.10.0.oh240]
	at org.eclipse.smarthome.core.library.types.HSBType.<init>(HSBType.java:81) ~[102:org.eclipse.smarthome.core:0.10.0.oh240]
	at org.eclipse.smarthome.binding.hue.internal.handler.LightStateConverter.fromHSBtoHSBType(LightStateConverter.java:234) ~[268:org.eclipse.smarthome.binding.hue:0.10.0.oh240]
	at org.eclipse.smarthome.binding.hue.internal.handler.LightStateConverter.toHSBType(LightStateConverter.java:222) ~[268:org.eclipse.smarthome.binding.hue:0.10.0.oh240]
	at org.eclipse.smarthome.binding.hue.internal.handler.HueLightHandler.onLightStateChanged(HueLightHandler.java:414) ~[268:org.eclipse.smarthome.binding.hue:0.10.0.oh240]
	at org.eclipse.smarthome.binding.hue.internal.handler.HueBridgeHandler.notifyLightStatusListeners(HueBridgeHandler.java:651) [268:org.eclipse.smarthome.binding.hue:0.10.0.oh240]
	at org.eclipse.smarthome.binding.hue.internal.handler.HueBridgeHandler.access$7(HueBridgeHandler.java:636) [268:org.eclipse.smarthome.binding.hue:0.10.0.oh240]
	at org.eclipse.smarthome.binding.hue.internal.handler.HueBridgeHandler$2.doConnectedRun(HueBridgeHandler.java:238) [268:org.eclipse.smarthome.binding.hue:0.10.0.oh240]
	at org.eclipse.smarthome.binding.hue.internal.handler.HueBridgeHandler$PollingRunnable.run(HueBridgeHandler.java:101) [268:org.eclipse.smarthome.binding.hue:0.10.0.oh240]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

Ok got it!
The binding thinks that 360 is not allowed for the H(ue) in HSB.
But the error says the value has to be between 0 and 360…

I´m going to create an Github issue tomorrow.
Github issue created!

Workaround:

  • Changing the Hue to 0 instead of 360 (same color)

Summary:

  • The hue API accepts a value of 65535 for hue which is converted to 360 in openHAB
  • openHAB had a change in the HSBType to only accepts values between 0 and 360 (0 <= hue < 360)
  • Other applications are still able to use the maximum value of 65535 for hue and can cause an error in openHAB

Workaround:

  • Don´t use the maximum value for hue

Fix:

  • Will be fixed with #6790

Actually, this is still happening (or again) in 2.5.12. I don’t expect anyone will fix that old version, but maybe someone can use this information when searching for the error message. :wink: