Map multiple bindings to one item

I am looking into migrating from OpenHAB 1.7.1 to OpenHAB 2. In OpenHAB I have a rule file that controls my christmas light (a rule that turns the item On or Off) - highly inspired by the article “Taking rules to new hights”. The problem is that the lists in the rules doesn’t work to well. After initialization first run of the rule takes long time, sometimes I get Index errors when accessing the list (they are static sixzed during run). I Found articles of others having similar problems with performance. So I have been planning to implement a binding that does the stuff. This will require that the possibility of mapping multiple bindings to one Item still is possible in OH2.

So my question is can I still map an item to multiple bindings in OH 2 as I can in OH1.x??

BTW. the discovery thing in Paper UI looks pretty cool, I really see som nice possibilities in that!.

/Martin

I can’t say definitively that it’s still supported in OH2, but I would be shocked if that functionality had somehow disappeared. Kai has often said that the goal is to have compatibility going from OH1 to OH2, and it would make no sense to eliminate that feature, since it’s very useful. I can’t imagine why it would be removed.

@watou is right, I pay a lot attention to not reducing any functionality which has been there so far.
So you can actually even link bindings from openHAB 1 and 2 to the very same item, I have used that for demos already.
You can have stuff like

Switch MyLight { knx="<1/2/3", enocean="01:23:45:67", channel="hue:bridge1:4,sonos:12345:mute" } 
```
where KNX and Enocean bindings would be from openHAB 1 and Hue and Sonos from openHAB 2.

Regards,
Kai
1 Like

Cool!
Can it be done from the PaperUI or must it be done from the config files?

The Paper UI does not (yet) support any item management, so this is done through the config files.

Hello Kai, hello community

This is my very first post in openhab forums as I have just started with OpenHAB. First of all I would like to thank everybody for providing such a GREAT system. This is really much appreciated!

My experimental system is running on a virtual machine on an ESXI server, host system for OpenHAB is Ubuntu Server.
I yet made it to communicate with DMX and KNX bus (both using a 2.x Bindings from different Github forums) and I’m able to control lights from the UI already.
Link DMX: https://github.com/J-N-K/smarthome/tree/feature-dmx-binding/extensions/binding/org.eclipse.smarthome.binding.dmx
Link KNX: https://github.com/kgoderis/openhab2/tree/knx-refactor/addons/binding/org.openhab.binding.knx

Also, actions on the KNX bus are recognized and displayed correctly on the UI (i.eg. if i press a lightswitch button)

Now to my “problem” (not sure if it even is one or if I’m trying the impossible?).
I’m currently stuck at controlling DMX lights using a KNX lightswitch. On the basis of the following post:

I created my own Item, which is linked to both, DMX and KNX channel:
Switch MyLight {channel=“dmx:dimmer:single:brightness, knx:generic:ip1:someactor:someswitch”}

If i push the according switch on the UI, this works perfectly fine. KNX lights and DMX LED strip are enabled/disabled accordingly.
If i push the KNX lightswitch, this is also recognized by open HAB, the switch on the UI changes its status (automatically on some systems, after a refresh of the webpage on others). However the DMX ligts do not change.

I will be grateful for any advice how I can solve this, in order to enable/disable some stairway lights by the use of a KNX motion detector later on.
Thanks in advance!

Kind regards,
Stefan

sorry to high-jack the post,
i tried to link two enocean switches and philips hue to one item but by some reason only one switch is working? strange think is its sometimes the 1. one and sometimes the 2 one.

Dimmer S_LR_Ceiling_D "Livingroom Ceiling Light Dimmer" (R_LR_D, R_LR)			{ channel="hue:0210:0017884e88f5:1:color", enocean="{id=FE:F9:78:84, channel=A, eep=F6:02:01}", enocean="{id==FE:F9:79:09, channel=A, eep=F6:02:01}" }

if i add only one of them they are working

I’m reading:
" Channels can be linked to multiple Items and Items can be linked to multiple Channels"
and wonder if the statement above is still true?

Yes, it is.

1 Like