Hue Dimmer Switch, what i do Wrong?

My Question is why nothing happens when i press the Buttons :smiley:

so this is my item where later i want many Channels Combined.

Dimmer   Wohnzimmer_dimmer         "Wohnzimmer Dimmer"                 {channel="nanoleaf:controller:7EA8BF9637AA:color" [profile="follow"]}

and this is my rule for the Hue Dimmer:

rule "Wohnzimmer Dimmer"
when
   Channel "hue:0820:001788ae569d:2:dimmer_switch_event" triggered
then
    switch(receivedEvent.getEvent()) {
        case "2002.0": {
            Wohnzimmer_dimmer.sendCommand("INCREASE")
            // Button 2 press - Increase brightness
        }
        case "3002.0": {
            Wohnzimmer_dimmer.sendCommand("DECREASE")
            // Button 3 press - Decrease brightness
        }

    }
end

I found it like this in the Forum, The Slider in the Paper UI Works but nothing happens when i press the Buttons.
May Someone knows a other Rule how i could bind The Dimmer to the Item ?
Or What is wrong with this one?

Sry for The Pictures next time i know how to Post it :slight_smile:

Thx
Chriss

what is openhab version and binding version please?
These devices recently received some attention
I just set mine up in the Hue app and point them at the bulb I want to control in the app and it just works although I did use rules to control the volume of the radio with one for awhile so it does work in OpenHAB with rules

I use Openhabian

openHAB 2.5.1-2 (Release Build)

and the Hue Binding from The Addons:

binding-hue - 2.5.1

Best to add some logging to the rule so you can see if it is triggered and what event is actually causing the trigger.

There is no reason to use a follow profile if you only have one Channel.

When you add more lights, the best approach is to create a separate Item for each light and put all of those into a Group. You can sendCommand to the Group which will be forwarded to all the members.

There is nothing apparently wrong with the Rule. In all likelihood there is something wrong with the Thing configuration or the Item.

As mentioned, add logging to the Rule so you can see whether or not it’s triggering. Always look at the logs for errors when loading any config file and when the rule runs.

How will I add the logging in that case?

Have you seen this?

1 Like

I don’t think that he got the same issue.

You can see the button presses in the events.log. I don’t got those sometimes and this seems to be my issue. Could it be that you need to send INCREASE and DECREASE instead of “INCREASE” and “DECREASE” so just with the “”?

Nope - thats not the issue. I had a look at my rules, it the same

1 Like

@regnets Thx for response! I wanted to bring it up just in case.

@Zyan: This is how you log somthing in a rule:

logInfo("rules", "Somthing happend")

So this is how you rule should look like:

rule "Wohnzimmer Dimmer"
when
   Channel "hue:0820:001788ae569d:2:dimmer_switch_event" triggered
then
    switch(receivedEvent.getEvent()) {
        case "2002.0": {
            logInfo("rules", "Rule: Wohnzimmer Dimmer; Increase Brightess Nanoleaf")
            Wohnzimmer_dimmer.sendCommand("INCREASE")
        }
        case "3002.0": {
            logInfo("rules", "Rule: Wohnzimmer Dimmer; Decrease Brightess Nanoleaf")
            Wohnzimmer_dimmer.sendCommand("DECREASE")
        }
    }
end

I would also add logging, at the start of the rull (just before the switch). So, you know the rule has started, and you can add info about the event in it.

Thx alot for all the Help,
I put the Loginfo in my rule.
I saw in the Documentation that there should be a file “org.eclipse.smarthome.model.script” but in the Folder : /var/lib/openhab2/etc

Do i need to activate the logging or create the file by my self?

No it is already running

I have the same issue.
I have the follow rule set up:

rule "BedroomSwitchRule"
when
    Channel "hue:0820:0017887922f1:2:dimmer_switch_event" triggered
then
    logInfo("HueRule", "Switching bedroom lights.")
end

I also have the dimmer switch state set up as an item:

Number BedroomDimmerState "Bedroom Dimmer State" {channel="hue:0820:0017887922f1:2:dimmer_switch"}

In the logs I can see that the binding sees the switch being pressed: The status item is also being updated

2020-04-25 21:34:23.175 [DEBUG] [ue.internal.handler.HueBridgeHandler] - Status update for Hue sensor '2' detected: {buttonevent=1002.0, lastupdated=2020-04-25T12:34:43}
2020-04-25 21:34:23.176 [DEBUG] [ue.internal.handler.HueBridgeHandler] - Sending sensorStateChanged for sensor '2'

│2020-04-25 21:31:00.445 [vent.ItemStateChangedEvent] - BedroomDimmerState changed from 4002.0 to 1002.0

But I never get the log output from the rule.
I have also tried switching things in the rule, but that also does not work.
Any idea what I am doing wrong here?

There is no event in the events.log shown for hue:0820:001788ae569d:2:dimmer_switch_event, so there is nothing to trigger the rule.
You need to look at that channel’s configuration.

Thanks for your answer. I don’t know what that means, how do I see/edit a channel configuration?

You’d look in PaperUI for a “T” channel. Where did you find that hue:0820:001788ae569d:2:dimmer_switch_event name?


This is what this looks like.
Perhaps I should also mention that I am on openhab:2.5.4-snapshot
So unless I copy-pasted nonsense from the paperui, it should be correct.

Looks sensible to me, but if there is no event actually generated by the binding to trigger your rule, then there is no event.

THE problem with the Hue bridge is that every connected device has to be polled over the Hue API.
I can not see that it is doable to get every transmit from a remote into openhab without some loss of packets.
In other words: It is a limitation in the Hue API.
Mybe the Hue binding can do a little bit better, but as long as the API only support polling, it will never be perfect.

1 Like