Multi Binding/Channel Linkage OH2

I have challenge, that I need an item which has different channels for reading and writing values. The channels are from the same thing.

I have seen examples here: Multi Binding/Channel Linkage

That seems though not for OH2.

Does anybody have an example for OH2

What makes you thinks this examole is not for OH2, it is posted in the OH2 documentation!

Could you be a bit more decriptive in what you want to achieve. Reading your short statement I would suggest to use different items, or do the writing only by a rule.

The notation is not OH2 like, which always starts with “channel=…”

With rules I can use a proxy item and two items connected to two channels. One for reading the value one for writing the value.

This example from the HHTP binding looks also pre-OH2:

Switch MyItem1 { http=">[ON:POST:] >[OFF:POST:]" }

It starts with the binding name and not with “channel=…”

I am looking for a universal solution not binding specific, if there ist one at all.

The notation is OH 2, but for OH 1.x bindings. OH 1.x bindings are fully supported in OH 2, but OH these bindings do not support Things or Channels.

Everything in the OH Docs is relevant and valid for OH 2.

The doc you linked to IS the universal solution. You list the channel OR the binding (if its an OH 1.x binding) separated by a comma.

An Item may be linked to multiple Bindings and/or Channels.

So for a OH2 binding it is not possible to link one read only channel and write only channel to a single item.
Alternative suppose writing a rule with a proxy item to a readonly item and write only item.

You can link multiple channels to the same Item, but there is no way to link them as read-only or write-only.


Notation would be:

... {channel="xxxxxx", channel="yyyy", channel="zzz"}

Updates coming from the channels will update the item, and any update to the item will be written to all channels.


Generally true but it may depend on the channel. Lots of channels are read only themselves and will generate errors in your logs when one tries to send a command or post update to Items they are linked to.

I usually do not do this sort of thing because getting it right tends to be hard and figuring out why it isn’t working tends to be even harder. I almost always use a proxy Item and simple Rule, or Groups.

In http binding you can write and read to the same item.

Like in this example:

Switch GHoma1	"G-Homa Socket 1"	{ http=">[ON:GET:] >[OFF:GET:] <[]" }

Here a switch: ON/OFF write and the state ON or OFF read every 60 seconds.