openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.56k forks source link

[deconz] Manually added colortemperaturelight stuck at CONFIGURATION_PENDING #8054

Closed Asbjoern closed 4 years ago

Asbjoern commented 4 years ago

Expected Behavior

Light should go online and work.

Current Behavior

After adding light to configuration file

Bridge deconz:deconz:bridge "DeCONZ bridge" @ "Infrastructure" [ host="192.168.113.8", apikey="*********" ]{
    colortemperaturelight kontorloft "LysKontor Loft"  @ "Kontor"  [ id="10" ]

The thing status never goes online. It is stuck stuck at CONFIGURATION_PENDING Log here:

==> /var/log/openhab2/openhab.log <==
2020-07-02 10:42:09.248 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'zigbee.things'

==> /var/log/openhab2/events.log <==
2020-07-02 10:42:09.948 [hingStatusInfoChangedEvent] - 'deconz:colortemperaturelight:bridge:kontorloft' changed from UNINITIALIZED to INITIALIZING

==> /var/log/openhab2/openhab.log <==
2020-07-02 10:42:09.991 [TRACE] [ernal.handler.DeconzBaseThingHandler] - Requesting URL for initial data: http://192.168.113.8:80/api/*********/lights/10

==> /var/log/openhab2/events.log <==
2020-07-02 10:42:09.993 [hingStatusInfoChangedEvent] - 'deconz:colortemperaturelight:bridge:kontorloft' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING)

==> /var/log/openhab2/openhab.log <==
2020-07-02 10:42:10.037 [TRACE] [z.internal.handler.LightThingHandler] - deconz:colortemperaturelight:bridge:kontorloft received LightMessage{hascolor=true, ctmax=454, ctmin=250, type=COLOR_TEMPERATURE_LIGHT, state=LightState{reachable=true, on=false, bri=166, alert='none', colormode='ct', effect='null', hue=null, sat=null, ct=170, xy=null, transitiontime=null}, e='', r='', t='', id='', manufacturername='IKEA of Sweden', modelid='FLOALT panel WS 60x60', name='Kontor Lys', swversion='1.2.217', ep='', uniqueid='90:fd:9f:ff:fe:75:17:97-01'}

If I restart the binding I get an exception right after initialization of the lamp:

2020-07-02 10:49:10.893 [hingStatusInfoChangedEvent] - 'deconz:colortemperaturelight:bridge:kontorloft' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING)

==> /var/log/openhab2/openhab.log <==
2020-07-02 10:49:10.885 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: Value must be between 0 and 100
java.lang.IllegalArgumentException: Value must be between 0 and 100
        at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:57) ~[?:?]
        at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:52) ~[?:?]
        at org.eclipse.smarthome.core.library.types.DecimalType.as(DecimalType.java:152) ~[?:?]
        at org.eclipse.smarthome.core.internal.items.ItemStateConverterImpl.convertToAcceptedState(ItemStateConverterImpl.java:64) ~[?:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.sendUpdate(ProfileCallbackImpl.java:134) ~[?:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onStateUpdateFromHandler(SystemDefaultProfile.java:53) ~[?:?]
        at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$9(CommunicationManager.java:467) ~[?:?]
        at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$11(CommunicationManager.java:487) ~[?:?]
        at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_222]
        at org.eclipse.smarthome.core.thing.internal.CommunicationManager.handleCallFromHandler(CommunicationManager.java:483) ~[?:?]
        at org.eclipse.smarthome.core.thing.internal.CommunicationManager.stateUpdated(CommunicationManager.java:465) ~[?:?]
        at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl$1.stateUpdated(ThingManagerImpl.java:168) ~[?:?]
        at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:245) ~[?:?]
        at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:264) ~[?:?]
        at org.openhab.binding.deconz.internal.handler.LightThingHandler.valueUpdated(LightThingHandler.java:295) ~[?:?]
        at org.openhab.binding.deconz.internal.handler.LightThingHandler.handleCommand(LightThingHandler.java:114) ~[?:?]
        at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:191) ~[?:?]
        at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:267) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_222]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_222]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

Behavior is the same with other colortemperaturelights and lights work with the hue binding.

If I let the lamp be auto discovered it goes online instantly:

2020-07-02 11:07:50.728 [me.event.InboxRemovedEvent] - Discovery Result with UID 'deconz:colortemperaturelight:bridge:90fd9ffffe75179701' has been removed.
2020-07-02 11:07:50.731 [hingStatusInfoChangedEvent] - 'deconz:colortemperaturelight:bridge:90fd9ffffe75179701' changed from UNINITIALIZED to INITIALIZING
2020-07-02 11:07:50.748 [hingStatusInfoChangedEvent] - 'deconz:colortemperaturelight:bridge:90fd9ffffe75179701' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING)

==> /var/log/openhab2/openhab.log <==
2020-07-02 11:07:50.749 [TRACE] [ernal.handler.DeconzBaseThingHandler] - Requesting URL for initial data: http://192.168.113.8:80/api/*********/lights/10
2020-07-02 11:07:50.764 [TRACE] [z.internal.handler.LightThingHandler] - deconz:colortemperaturelight:bridge:90fd9ffffe75179701 received LightMessage{hascolor=true, ctmax=454, ctmin=250, type=COLOR_TEMPERATURE_LIGHT, state=LightState{reachable=true, on=false, bri=166, alert='none', colormode='ct', effect='null', hue=null, sat=null, ct=170, xy=null, transitiontime=null}, e='', r='', t='', id='', manufacturername='IKEA of Sweden', modelid='FLOALT panel WS 60x60', name='Kontor Lys', swversion='1.2.217', ep='', uniqueid='90:fd:9f:ff:fe:75:17:97-01'}

==> /var/log/openhab2/events.log <==
2020-07-02 11:07:50.771 [hingStatusInfoChangedEvent] - 'deconz:colortemperaturelight:bridge:90fd9ffffe75179701' changed from OFFLINE (CONFIGURATION_PENDING) to ONLINE

Steps to Reproduce (for Bugs)

  1. Add light to configuration file: colortemperaturelight kontorloft "LysKontor Loft" @ "Kontor" [ id="10" ]
  2. Save file

Context

I am trying to migrate my light away from the hue binding now that the Deconz binding support lights.

Your Environment

J-N-K commented 4 years ago

What item type did you use for the color temperature channel?

Asbjoern commented 4 years ago

I have not yet connected any items to any channels. But I would use a Dimmer like the hue binding.

J-N-K commented 4 years ago

Nope. Use a Number Item. I'm pretty sure you have the channel linked. Otherwise the REFREESH command (that lead to your exception) should not have been issued.

But I think I found atleast one other issue.

Asbjoern commented 4 years ago

Good to know. I really like specifying the temperature in Kelvin instead of percent!

Great news. It is now online! You were right about channels being linked. There must have been some residual link or naming conflict between the hue and deconz binding?!

The light was also named kontorloft in the hue binding. I had removed the hue thing but not the links. Once I removed the hue links:

Dimmer Kontor_Brightness "Lysstyrke" <slider> (gColorTempSw){ channel="hue:0220:1:kontorloft:brightness" }
Dimmer Kontor_ColorTemperature  "Farvetemperatur" <colorpicker>  { channel="hue:0220:1:kontorloft:color_temperature" }

The log responed with deconz links removed.

2020-07-02 19:59:25.761 [temChannelLinkRemovedEvent] - Link 'Kontor_Brightness => deconz:colortemperaturelight:bridge:kontorloft:brightness' has been removed.
2020-07-02 19:59:25.764 [temChannelLinkRemovedEvent] - Link 'Kontor_Brightness => hue:0220:1:kontorloft:brightness' has been removed.
2020-07-02 19:59:25.767 [temChannelLinkRemovedEvent] - Link 'Kontor_ColorTemperature => hue:0220:1:kontorloft:color_temperature' has been removed.
2020-07-02 19:59:25.769 [temChannelLinkRemovedEvent] - Link 'Kontor_ColorTemperature => deconz:colortemperaturelight:bridge:kontorloft:color_temperature' has been removed.

I will close the issue unless you would like to keep it open to look into the naming thing?

J-N-K commented 4 years ago

That’s strange. I‘ll investigate that.