How to switch a HUE lamp on with the Hue Binding?

Hi folks,

I try to switch a hue light on triggered by a rule but it doesn’t work.
This is my things configuration(just for test):

Bridge hue:bridge:0017882402BD         "Hue Bridge"                    [ ipAddress="172.20.1.122", userName="Wh3X5OWh4p69PGLxAmreMZd8d1wfurL4vL90Q5US"] {
    0220 bulb1          "Lamp right" @ "Office"             [ lightId="8"]
    0820 dimmer-switch1 "Switch Lamp right" @ "Office"      [ sensorId="12"]
}```

This is my items configuration:

```csv
Switch Lamp_Right_Office_Toggle    { channel="hue:220:0017882402BD:bulb1:brightness"}

And here how I want to switch on the light(just for testing):

rule "Receive telegram"
when
    Item telegramMessage received update
then
    logInfo("Rules", "Telegram Message:" + telegramMessage.state.toString)
    if (telegramMessage.state.toString == "switchon")
    {
        // val hueActions = getActions("hue","hue:0220:0017882402bd:8")        
        //hueActions.sendCommand(ON)
        Lamp_Right_Office_Toggle.sendCommand(ON)
    }
end

Here the log entries:

2020-02-09 16:10:44.629 [hingStatusInfoChangedEvent] - 'hue:0220:0017882402BD:bulb1' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2020-02-09 16:10:44.722 [me.event.ThingUpdatedEvent] - Thing 'hue:0220:0017882402BD:bulb1' has been updated.
2020-02-09 16:10:44.723 [hingStatusInfoChangedEvent] - 'hue:0220:0017882402BD:bulb1' changed from INITIALIZING to ONLINE
2020-02-09 16:10:43.341 [hingStatusInfoChangedEvent] - 'hue:0220:0017882402BD:bulb1' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2020-02-09 16:10:44.629 [hingStatusInfoChangedEvent] - 'hue:0220:0017882402BD:bulb1' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2020-02-09 16:10:44.722 [me.event.ThingUpdatedEvent] - Thing 'hue:0220:0017882402BD:bulb1' has been updated.
2020-02-09 16:10:44.723 [hingStatusInfoChangedEvent] - 'hue:0220:0017882402BD:bulb1' changed from INITIALIZING to ONLINE

And here the log entry when I fire the event:

2020-02-09 16:51:03.215 [ome.event.ItemCommandEvent] - Item 'Lamp_Right_Office_Toggle' received command ON
2020-02-09 16:51:03.219 [nt.ItemStatePredictedEvent] - Lamp_Right_Office_Toggle predicted to become NULL

I’ve also used a sitemap with the same result.

Do you have any idea what’s going wrong?

Best,

Marcel.

First question does your bridge and bulb show online under things in paper ui?

This will give you an idea of bridge and bulb configured correctly. From the logs looks like it is but paper ui can be a secondary check.

Off the top of my head your config looks correct. I am confident once it works in a sitemap it will work with rule.

Last thing to do is watch the log when you save your thing and items file make sure no errors are sited. Let’s see if others have any idea

1 Like

Both is marked as online.
Saving the things and items file doesn’t show any error.

Best,

Marcel.

As Danny said, everything looks right but I don’t do thing configuration in text files so that part I can’t comment on.

The item received the command but is predicted to become NULL???
that seems extremely strange.
Only thing I can think of is to back up and remove your thing file and try to discover your bridge in Paper UI, let Paper UI create your thing and see if it works then eliminating a mistake in the manually create thing file as a possible cause

edit to add: other then that, we can’t see your whole files so make sure you don’t have duplicate named items or rules ect. Rules must have a unique name across all rules files

1 Like