HSBType not working

  • Platform information:
    • Hardware: Raspberry Pi 4 4GB
    • OS: Openhabian
    • openHAB version: 2.5.10 | But also exists in latest v3
  • Issue of the topic: HSBType commands are not being accepted by my LED Stripe. I see that Openhab sends the command, but the Stripe itself does not change and the value “jumps” back to what it was before. With Home Assistant, controling the LED Strip works fine so I think there is an issue with Openhab and the HSBType? Also with PaperUI, setting an HSB value does not work. When I change anything with the “native” app, Openhab gets the correct values in the log but still is not able to update:
2021-03-20 18:05:48.325 [ome.event.ItemCommandEvent] - Item 'BettLinks_Color' received command 240,100,49

2021-03-20 18:05:48.328 [nt.ItemStatePredictedEvent] - BettLinks_Color predicted to become 240,100,49

2021-03-20 18:05:50.129 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 240,100,49 to 0.0,100,49

Does anyone have an idea why HSBType might not be working or how I could make it working?
Also with rules, it’s not working at all:

rule "Bett links Blau"
when
    Item BettLinks_Blau changed to ON
then
    val hsb_color = new HSBType(new DecimalType(200), new PercentType(90), new PercentType(60))
    BettLinks_Color.sendCommand(hsb_color.toString)
end

Please set to TRACE logging and post the command send and the response received. Did you try setting color mode to xy?

1 Like

When changing the Brightness

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:45:10.608 [TRACE] [z.internal.handler.LightThingHandler] - Sending {"on":true,"bri":177} to light 5 via http://127.0.0.1:8090/api/6EE976EE01/lights/5/state

2021-03-20 19:45:10.631 [TRACE] [z.internal.handler.LightThingHandler] - Result code=200, body=[{"success":{"/lights/5/state/on":true}},{"success":{"/lights/5/state/bri":177}}]

2021-03-20 19:45:10.633 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":177,"colormode":"ct","ct":392,"effect":null,"hue":0,"on":true,"reachable":true,"sat":254,"xy":[0.3209,0.1541]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

==> /var/log/openhab2/events.log <==

2021-03-20 19:45:10.634 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 166,100,0 to 166,100,70

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:45:10.645 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=177, alert='null', colormode='ct', effect='null', hue=0, sat=254, ct=392, xy=[0.3209, 0.1541], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:45:10.650 [DEBUG] [z.internal.handler.LightThingHandler] - val = '254', scaledValue = '100'

2021-03-20 19:45:10.654 [DEBUG] [z.internal.handler.LightThingHandler] - val = '177', scaledValue = '70'

2021-03-20 19:45:10.660 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"1","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"}

==> /var/log/openhab2/events.log <==

2021-03-20 19:45:10.664 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 166,100,70 to 0.0,100,70

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:45:10.664 [DEBUG] [nternal.netutils.WebSocketConnection] - Unknown message type: groups

2021-03-20 19:45:10.805 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":2,"colormode":"ct","ct":392,"effect":null,"hue":0,"on":true,"reachable":true,"sat":254,"xy":[0.3209,0.1541]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

2021-03-20 19:45:10.808 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=2, alert='null', colormode='ct', effect='null', hue=0, sat=254, ct=392, xy=[0.3209, 0.1541], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:45:10.810 [TRACE] [z.internal.handler.LightThingHandler] - Ignoring differing update after last command until 1616265910881

2021-03-20 19:45:11.748 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":177,"colormode":"ct","ct":392,"effect":null,"hue":0,"on":true,"reachable":true,"sat":254,"xy":[0.3209,0.1541]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

2021-03-20 19:45:11.752 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=177, alert='null', colormode='ct', effect='null', hue=0, sat=254, ct=392, xy=[0.3209, 0.1541], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:45:11.756 [DEBUG] [z.internal.handler.LightThingHandler] - val = '254', scaledValue = '100'

2021-03-20 19:45:11.759 [DEBUG] [z.internal.handler.LightThingHandler] - val = '177', scaledValue = '70'


When changing the Color:

2021-03-20 19:46:27.228 [ome.event.ItemCommandEvent] - Item 'BettLinks_Color' received command 65,100,70

2021-03-20 19:46:27.235 [nt.ItemStatePredictedEvent] - BettLinks_Color predicted to become 65,100,70

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:46:27.254 [TRACE] [z.internal.handler.LightThingHandler] - Sending {"bri":177,"hue":11832,"sat":254} to light 5 via http://127.0.0.1:8090/api/6EE976EE01/lights/5/state

2021-03-20 19:46:27.262 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":177,"colormode":"hs","ct":392,"effect":null,"hue":11832,"on":true,"reachable":true,"sat":254,"xy":[0.3209,0.1541]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

2021-03-20 19:46:27.264 [TRACE] [z.internal.handler.LightThingHandler] - Result code=200, body=[{"success":{"/lights/5/state/bri":177}},{"success":{"/lights/5/state/hue":11832}},{"success":{"/lights/5/state/sat":254}}]

2021-03-20 19:46:27.264 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=177, alert='null', colormode='hs', effect='null', hue=11832, sat=254, ct=392, xy=[0.3209, 0.1541], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:46:27.268 [DEBUG] [z.internal.handler.LightThingHandler] - val = '254', scaledValue = '100'

2021-03-20 19:46:27.270 [DEBUG] [z.internal.handler.LightThingHandler] - val = '177', scaledValue = '70'

==> /var/log/openhab2/events.log <==

2021-03-20 19:46:27.275 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 0.0,100,70 to 65,100,70

2021-03-20 19:46:27.282 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 65,100,70 to 64.99610894941634,100,70

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:46:27.721 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":177,"colormode":"ct","ct":392,"effect":null,"hue":0,"on":true,"reachable":true,"sat":254,"xy":[0.3209,0.1541]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

2021-03-20 19:46:27.724 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=177, alert='null', colormode='ct', effect='null', hue=0, sat=254, ct=392, xy=[0.3209, 0.1541], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:46:27.727 [DEBUG] [z.internal.handler.LightThingHandler] - val = '254', scaledValue = '100'

2021-03-20 19:46:27.730 [DEBUG] [z.internal.handler.LightThingHandler] - val = '177', scaledValue = '70'

==> /var/log/openhab2/events.log <==

2021-03-20 19:46:27.744 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 64.99610894941634,100,70 to 0.0,100,70

2021-03-20 19:46:28.349 [ome.event.ItemCommandEvent] - Item 'BettLinks_Color' received command 280,100,70

2021-03-20 19:46:28.351 [nt.ItemStatePredictedEvent] - BettLinks_Color predicted to become 280,100,70

2021-03-20 19:46:28.382 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 0.0,100,70 to 280,100,70

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:46:28.395 [TRACE] [z.internal.handler.LightThingHandler] - Sending {"bri":177,"hue":50971,"sat":254} to light 5 via http://127.0.0.1:8090/api/6EE976EE01/lights/5/state

2021-03-20 19:46:28.403 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":177,"colormode":"hs","ct":392,"effect":null,"hue":50971,"on":true,"reachable":true,"sat":254,"xy":[0.3209,0.1541]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

2021-03-20 19:46:28.405 [TRACE] [z.internal.handler.LightThingHandler] - Result code=200, body=[{"success":{"/lights/5/state/bri":177}},{"success":{"/lights/5/state/hue":50971}},{"success":{"/lights/5/state/sat":254}}]

2021-03-20 19:46:28.406 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=177, alert='null', colormode='hs', effect='null', hue=50971, sat=254, ct=392, xy=[0.3209, 0.1541], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:46:28.414 [DEBUG] [z.internal.handler.LightThingHandler] - val = '254', scaledValue = '100'

2021-03-20 19:46:28.417 [DEBUG] [z.internal.handler.LightThingHandler] - val = '177', scaledValue = '70'

==> /var/log/openhab2/events.log <==

2021-03-20 19:46:28.426 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 280,100,70 to 279.9963378347448,100,70

2021-03-20 19:46:29.225 [ome.event.ItemCommandEvent] - Item 'BettLinks_Color' received command 280,100,70

2021-03-20 19:46:29.230 [nt.ItemStatePredictedEvent] - BettLinks_Color predicted to become 280,100,70

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:46:29.253 [TRACE] [z.internal.handler.LightThingHandler] - Sending {"bri":177,"hue":50971,"sat":254} to light 5 via http://127.0.0.1:8090/api/6EE976EE01/lights/5/state

2021-03-20 19:46:29.261 [TRACE] [z.internal.handler.LightThingHandler] - Result code=200, body=[{"success":{"/lights/5/state/bri":177}},{"success":{"/lights/5/state/hue":50971}},{"success":{"/lights/5/state/sat":254}}]

==> /var/log/openhab2/events.log <==

2021-03-20 19:46:29.286 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 279.9963378347448,100,70 to 280,100,70

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:46:32.725 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":177,"colormode":"ct","ct":392,"effect":null,"hue":0,"on":true,"reachable":true,"sat":254,"xy":[0.3209,0.1541]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

2021-03-20 19:46:32.727 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=177, alert='null', colormode='ct', effect='null', hue=0, sat=254, ct=392, xy=[0.3209, 0.1541], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:46:32.730 [DEBUG] [z.internal.handler.LightThingHandler] - val = '254', scaledValue = '100'

2021-03-20 19:46:32.732 [DEBUG] [z.internal.handler.LightThingHandler] - val = '177', scaledValue = '70'

==> /var/log/openhab2/events.log <==

2021-03-20 19:46:32.738 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 280,100,70 to 0.0,100,70

To be honest I am a bit a n00b on this so I dont know how to change color mode to xy :slight_smile:

And last, when I change via Phoscon GUI (working fine):

2021-03-20 19:54:18.470 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":177,"colormode":"xy","ct":392,"effect":null,"hue":0,"on":true,"reachable":true,"sat":254,"xy":[0.1562,0.0361]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

2021-03-20 19:54:18.473 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=177, alert='null', colormode='xy', effect='null', hue=0, sat=254, ct=392, xy=[0.1562, 0.0361], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:54:18.479 [DEBUG] [z.internal.handler.LightThingHandler] - val = '177', scaledValue = '70'

==> /var/log/openhab2/events.log <==

2021-03-20 19:54:18.486 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 154,100,70 to 255,100,70

==> /var/log/openhab2/openhab.log <==

2021-03-20 19:54:19.471 [TRACE] [nternal.netutils.WebSocketConnection] - Raw data received by websocket: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":177,"colormode":"xy","ct":392,"effect":null,"hue":0,"on":true,"reachable":true,"sat":254,"xy":[0.1582,0.0187]},"t":"event","uniqueid":"84:2e:14:ff:fe:2a:24:97-01"}

2021-03-20 19:54:19.474 [TRACE] [z.internal.handler.LightThingHandler] - deconz:extendedcolorlight:c8d775a5:842e14fffe2a249701 received LightMessage{hascolor=null, ctmax=null, ctmin=null, type=null, state=LightState{reachable=true, on=true, bri=177, alert='null', colormode='xy', effect='null', hue=0, sat=254, ct=392, xy=[0.1582, 0.0187], transitiontime=null}, e='changed', r='lights', t='event', id='5', manufacturername='', modelid='', name='', swversion='', ep='', uniqueid='84:2e:14:ff:fe:2a:24:97-01'}

2021-03-20 19:54:19.477 [DEBUG] [z.internal.handler.LightThingHandler] - val = '177', scaledValue = '70'

==> /var/log/openhab2/events.log <==

2021-03-20 19:54:19.487 [vent.ItemStateChangedEvent] - BettLinks_Color changed from 255,100,70 to 259,100,70

In UI/Things, select the thing, under “Configuration” select “show advanced”, select XY for color mode.

Unfortunately there is no “show advanced” :frowning:

I’m not 100% sure ist is available in 2.5.x. It is available in the latest snapshot (and milestone)

Awesome, with the latest Snapshot of Openhab 3 I was able to change the Colormode to XY and now it seems working. So I will migrate from 2.5.10 to 3 tomorrow. Thanks a lot

1 Like