Philips Hue + KNX

Hey, I’m controlling Philips Hue using KNX Switches. This works quite well in the following scenario (I boiled it down to one bulb, in fact I have multiple):

Thing configuration for the KNX switch:

...
Thing device hue "hue" [pingInterval=0]
{
    Type switch-control: terrace [ga="0/2/26+<0/2/27"]
}
...

Items for the KNX switch:

Switch Light_Terrace <light> {channel="knx:device:bridge:hue:terrace"}

and the Hue light:

Switch Hue_Wall_Terrace <light> {channel="hue:0210:xxx:color"}

Using the following rule to run it:

rule "Switch hue on terrace"
when
    Item Light_Terrace received command
then
 if(receivedCommand == ON) {
    Hue_Wall_Terrace.sendCommand(ON)
    // Do more stuff like colors/effects/etc.
}
else {
  Hue_Wall_Terrace.sendCommand(OFF)
}

This works well. However, once I want to use the Philips Hue App on my smartphone, the state of the KNX bus overrides the state given from the App, e.g., if I have switched the light ON in the app but the wall switch is still OFF, the OFF state of the wall switch is submitted to openHAB every 360 seconds (6mins), so the light are switched off.
The same vice-versa: if I switch the light ON via wall switch and switch it off via Hue App, the lights are switched on again as they receive an ON signal from the bus

I tried to set the ping interval to 0, but the 360s are input from somewhere else. The wall switch is not sending the state again (I have MDT glas switches in version I, they do not even have an option to resend the state on a regular basis) Any idea how to solve this?

Thank you!
Robin

This is a misconfiguration in ETS. Don’t set the wall switch to send the status periodically.

Please be aware that openHAB is per definition the actuator for these channels, so the status comes from openHAB, not from knx bus. I.e. don’t use a < in the definition, set the status GA as first GA and the command GA as second GA, send a postUpdate against the knx item to send the Status to knx. Don’t send any status from knx at all for these GA.

1 Like

My goal: Syncing the HUE System (App, Motiondetectors …) with OpenHAB and with KNX wall mounted switches. (MDT Glastaster)
I tried several rules, and several different approaches and red a lot. This works great:

KNX GA Setup for one Hue Light:

  • 0/0/1 Hue Light SWITCH (KNX Datatype 1.001) (the KNX Wallswitch sends his ON/OFF/(DIMM) command to this address)
  • 0/0/2 Hue Light STATUS (KNX Datatype 1.001) (the KNX Wallswitch (sends)/receives the status of the light)
  • 0/0/3 Hue Light DIMMER STEP (KNX Datatype 3.007) (the KNX Wallswitch sends his DIMM command to this address)
  • 0/0/4 Hue Light DIMMER VALUE (KNX Datatype 5.001) (Absolute dimming value in percent) (e.g. for the purpose of display/visualisation of the current dimmer value on the MDT Glastaster Smart Display)
  • 0/0/5 Hue Light DIMMER STATUS (not in use, or just a dummy item)

OpenHAB Thing File

Thing device hueknx   "HUE-KNX Light"   // switch="GA ONOFF Status+ GA ONOFF", position="GA Dimm Value + GA Dimm Value Status", increaseDecrease="GA Dimmer Step", frequency=300 ]
    {
        Type dimmer-control : Hue_Light_Dimmer     "HUE-KNX Control Dimmer"                       [ switch="", position="0/0/4+0/0/5", increaseDecrease="3.007:0/0/3", frequency=300 ]
        Type switch-control : Hue_Light_Switch     "HUE-KNX Control Switch"                       [ ga="0/0/2+0/0/1" ] // Watch out: first entry: status, second: on/off command
    }
    

OpenHAB items

Dimmer HUELight_Dimmer "HUE Light [%d %%]" <colorlight> {channel="hue:0210:xxxxxxxxxx:y:color", channel="knx:device:bridge:hueknx:Hue_Light_Dimmer"}
Switch HUELight_Switch "HUE Light" <light>  (gLights)   {channel="hue:0210:xxxxxxxxxx:y:color", channel="knx:device:bridge:hueknx:Hue_Light_Switch"}

The trick is to use seperate dimmer-control and switch-control in the thing definition.
I assumed, your Hue Lights are working within OpenHAB (Hue Binding installed, OpenHAB is connected to the Hue Gateway) and you are using OpenHAB 2.5 with the newest KNX Binding.

I hope this is what you are looking for.

1 Like

Unfortunately, I have no option to set the status to periodically with the hardware.
So you mean in that case, I switch to this thing definition?

...
Thing device hue "hue" [pingInterval=0]
{
    Type switch-control: terrace [ga="0/2/27"]
}
...

Thank you for your reply!
This seems to be a huge effort for just one light (I have many of them here), so I will try other approaches as well before I start with yours :slight_smile:

Hi Robin,

aren‘t we using the same hardware: MDT Switches (Glastaster) and Hue Lights?

Try it: you will like it. Fast response and smooth fading. And every deleted rule - is a good rule … :slight_smile:

If you are not dimming your light, you will not need the dimmer-control line.

1 Like

Key to success: you need a group address for the status update! How should your KNX bus or your HUE system know, what the actual status of the light is?

Hello Forum,

since the last update to 2.5.4 this (or the HUE Binding) solution above is no longer working: i don’t know why …

I removed the Hue Bridge, put it back online, cleared the cache, rebooted the system, but the Hue lights are no longer responding.

Word of warning: DO NOT USE HUE LIGHTS with OpenHAB. It is a constant struggle to keep it running, with every update there is the possibility to destroy your setup. It is not reliable. In the next projects, i will not longer use this system. I’ve had enough. [Angry mode: OFF]

While I do respect the level of frustration you must be feeling, maybe something else is at work that gives your setup grief.

Just to add my experience, the integration of the Hue hub through the OH2 binding has been extremely stable since many iterations, I am using OH2 to control 20 or so Hue lights for quite some years, I do follow all upgrades/updates (on bridge and on OH), and it has been a rock solid part of my home automation, shout out to the developers. Power outages, wifi outages, etc nothing matters, it comes back online and simply works.

Rock solid: yeees. But in the last one and half year, my setup get stuck … three times … and every time i need about two hours to get in back online- while the lamps remain dark.
Currently i deleted the binding, the bridge itself … but the coupling (press button in bridge) does not work …,

It is hard to tell it you any other troubleshooting:

  • (not sure what you mean by “deleted the bridge”)
  • did you delete the thing too
  • did you clean the cache
  • did you restart OH2 more than once afterwards
  • any info in the logs?
  • and one of my personal favorites (because I fell in this trap a few times myself): do any of the item definitions need to be updated (as UUID changed, links got broken, etc)?

Just to close the original topic: I made a stupid mistake with my ETS setup. Indeed, my buttons didn’t send the status ever 360 seconds but the actuator still did (as pointed out before). This was the reason why my HUEs were changing their status after I changed the configuration over other channels, e.g., the HUE Android app.
So stupid mistake, now it’s working fine was expected without any workarounds.

Thank you for your help!

No helpfull infos in the log.
Cleaned the cache, restarted (two times) the whole system.

After deleting the Hue Bridge and the Binding within PaperUI, i freshly reinstalled the binding, and freshly connected the Hue Bridge. The Bridge is now shown as “online”, but the lights do not react.
I also deleted some lights, they showed up in the Inbox and i could add them as a thing. The UUID are the same.

Does someone know how to downgrade from 2.5.4-1 within OpenHabian to the previos version?
I know, i should have made a SD card image before the update … :slight_smile:

Sorry, I am not using OPenHabian, but there are quite few posts with regard to downgrading.
But it looks like progress:

  • you have your Hue bridge back online
  • you could add things again.

What you would need to check for all your things in PaperUI: are the channels actually linked to an item?
Can you control your lights from PaperUI?
Just go systematically through the OH structure:

  • is your binding installed and active (done it appears)
  • is your bridge online (done it appears)
  • do your things actually connect to your bridge (deleting the existing ones and re-adding them from the inbox is the safest way to do that)
  • do your items link to channels of your things
  • does your rule still work

Thank you for your reply! :slight_smile:

I’ve done all the “basic” steps: deleting, reinstalling, rebooting. I even created a complete new item, with a new name. When using it on the sitemap, the result apears on the the log file: “light predicted to become ON …” “light dimmer set to 45…”. But the light does not react.

I’m not using any rule. Just basic OH + HUE Binding + HUE Light.

Downgrade: within OpenHABian i don’t know how to downgrade to a specific version. Only to “upgrade” or “downgrade” to a stable version - which i have. Confused …

(Perhaps … i should start a new thread, but still hoping for a easy solution.)

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.