Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » DSL for multiple Channels linked to an Item
DSL for multiple Channels linked to an Item [message #1514447] Wed, 17 December 2014 09:57 Go to next message
Karel Goderis is currently offline Karel GoderisFriend
Messages: 198
Registered: March 2014
Senior Member
Recently the possibility was added to link more than one Channel to an Item using

Item test {channel="x:y:z:", channel="a:b:c"}

if I am not wrong, but in openHAB1 we had the possibility to link binding configuration to a specific command understood by the Item. In the ESH/OH2 world this could result in something like

Switch someSwitch {ON:channel="x:y:z", OFF:channel="a:b:c"}

so that values received on the x:y:z channel would only trigger the ON command for the Switch. Do we abandon this OH1 concept? e.g. we assume that each channel linked can send all accepted values to the Item?

Re: DSL for multiple Channels linked to an Item [message #1514573 is a reply to message #1514447] Wed, 17 December 2014 12:12 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Hi Karel,

No, you are wrong, such a concept does not exist in OH1.
Maybe some bindings define their own custom way of providing such a functionality as they are free to define the binding configuration string.
For the "channel" binding configurations, such things could be treated as parameters on the ItemChannelLinks. We didn't yet go into the details of how these links should be configured and whether its needed at all (or if there should be default "profiles" as link configurations).
So yes, if your channel is bound to an item, we in general assume that it will receive all events for this item.
Re: DSL for multiple Channels linked to an Item [message #1514683 is a reply to message #1514573] Wed, 17 December 2014 14:01 Go to previous messageGo to next message
Karel Goderis is currently offline Karel GoderisFriend
Messages: 198
Registered: March 2014
Senior Member
Ok - That will work for now. That said, if I remember well almost, if not all, bindings somehow use a Map {OHCommand,BindingConfig} that serves this purpose. It was certainly as you say implemented in the core part, but I think it is used by a lot of users. So, there might be an interest for this kind of feature...

That being said, is the ItemChannelLinks part documented somewhere?

Karel
Re: DSL for multiple Channels linked to an Item [message #1516080 is a reply to message #1514683] Thu, 18 December 2014 16:43 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
I am afraid the only currently available documentation is the code: https://github.com/eclipse/smarthome/tree/master/bundles/core/org.eclipse.smarthome.core.thing/src/main/java/org/eclipse/smarthome/core/thing/link
We will try to work on the docs in January!
Re: DSL for multiple Channels linked to an Item [message #1528135 is a reply to message #1516080] Thu, 25 December 2014 15:00 Go to previous messageGo to next message
Karel Goderis is currently offline Karel GoderisFriend
Messages: 198
Registered: March 2014
Senior Member
Kai

what is the appropriate place to bind this registry?
in the Factory, the Bridge Handler or the ThingHandler directly?

Karel
Re: DSL for multiple Channels linked to an Item [message #1532068 is a reply to message #1528135] Sat, 27 December 2014 20:43 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
It should not be used from within a binding at all. If you require access to the information, which items are linked to a channel, you might be interested in this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=456212
Re: DSL for multiple Channels linked to an Item [message #1534906 is a reply to message #1532068] Mon, 29 December 2014 11:17 Go to previous messageGo to next message
Karel Goderis is currently offline Karel GoderisFriend
Messages: 198
Registered: March 2014
Senior Member
Due to the way the objects are instantiated, e.g. OSGi, I have opted to bind the service in the factory handler, and then pass it on as a parameter to the ThingHandlers.
Re: DSL for multiple Channels linked to an Item [message #1535449 is a reply to message #1534906] Mon, 29 December 2014 18:26 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
What I meant is that you should not make use of this registry anywhere in your code, also not in the handler factory.
Re: DSL for multiple Channels linked to an Item [message #1537243 is a reply to message #1535449] Tue, 30 December 2014 18:34 Go to previous messageGo to next message
Karel Goderis is currently offline Karel GoderisFriend
Messages: 198
Registered: March 2014
Senior Member
That, I am afraid, is impossible. You will see when you get a chance to view the KNX 2.0 code that otherwise some stuff can not be implemented.

unless it is abstracted into the core off course.

K
Re: DSL for multiple Channels linked to an Item [message #1724943 is a reply to message #1537243] Sat, 27 February 2016 13:09 Go to previous message
Sunil Shilimkar is currently offline Sunil ShilimkarFriend
Messages: 1
Registered: February 2016
Junior Member
I agree with Karel, some bindings will need 'binding configuration string' per item. I am afraid if this is not supported in ESH then some of the bindings can not be implemented.
Previous Topic:Fehler
Next Topic:Sudden Error during execution
Goto Forum:
  


Current Time: Thu Apr 25 02:16:04 GMT 2024

Powered by FUDForum. Page generated in 0.03834 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top