Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse SmartHome » Binding with communication profile
Binding with communication profile [message #1790291] Fri, 08 June 2018 01:25 Go to next message
Lukasz Dywicki is currently offline Lukasz DywickiFriend
Messages: 32
Registered: July 2009
Member
Hey,
I am checking lutron binding and I think I've found a very good match of communication profiles which were described by Simon Kaufmann on Eclipse Smart Home Day 2017.

Some items in lutron, keypads especially, might be configured in a way where button doesn't have a state and it always reports "PRESS" event (a trigger). Its state is reflected by LED which is ON or OFF depending on other criteria - ie. status of output which is switched with key press.

I been looking for simplified example how to get basic relationship between keys and leds (there is 1:1 relation), but I couldn't find any clear example which I could debug myself. Is there any place which I could follow to see how it works in action and how binding may suggest relation between channels with a trigger and state kinds?

Cheers,
Lukasz

[Updated on: Fri, 08 June 2018 01:26]

Report message to a moderator

Re: Binding with communication profile [message #1790339 is a reply to message #1790291] Fri, 08 June 2018 12:19 Go to previous messageGo to next message
Stefan Triller is currently offline Stefan TrillerFriend
Messages: 28
Registered: April 2017
Junior Member
Hi Lukasz,

there is currently one binding in development which wants to use TriggerProfiles, which is the enOcean binding: https://github.com/openhab/openhab2-addons/pull/2838

You might find some example code there.

Some general documentation about profiles can be found here: https://www.eclipse.org/smarthome/documentation/development/bindings/profiles.html

Regards,

Stefan
Re: Binding with communication profile [message #1790477 is a reply to message #1790339] Mon, 11 June 2018 14:13 Go to previous messageGo to next message
Lukasz Dywicki is currently offline Lukasz DywickiFriend
Messages: 32
Registered: July 2009
Member
Hey Stefan,
Thank you very much for sharing above links. They helped me getting over the profile advisory and linking channels to profiles.

What I still miss is a "linking" channels between each other. Given examples do not explain how, for example, one channel can be updated based on state changes in second channel. To put more light on it - lutron keypad (a thing) contains seval buttons and leds which are mapped to separate channels. Currently I "hardcoded" necessary logic in binding code itself, however I would prefer to use profiles for that as it seems to be better suited than custom code.

So far, all places I have seen are free of channels and advisor have access only to channel type and item name. I miss information of second channel which would be triggered with state change on item. I suppose I can get source channel from item link registry, but how to inject second channel which is supposed to mirror state changes?

Let me know if I missunderstood purpose of profiles. So far I see no way to "configure" it.
Re: Binding with communication profile [message #1790524 is a reply to message #1790477] Tue, 12 June 2018 11:39 Go to previous messageGo to next message
Stefan Triller is currently offline Stefan TrillerFriend
Messages: 28
Registered: April 2017
Junior Member
Ah now I get what you are trying to do: Your thing, the keypad, has 2 channels, which should "act together". So if you push a button, the LED should go ON/OFF as well, right?

Have a look at the "Follow" profile, which I now have documented here: https://github.com/eclipse/smarthome/pull/5727

Basically you link both channel to the same Item and the the channel with the follow profile receives a command containing the state update from the other channel.

Does that help?
Re: Binding with communication profile [message #1790526 is a reply to message #1790524] Tue, 12 June 2018 12:02 Go to previous messageGo to next message
Simon Kaufmann is currently offline Simon KaufmannFriend
Messages: 51
Registered: January 2011
Member
The above solution obviously only works with some user interaction, as it is the user who links both channels to the same item, not you as a binding developer.

Nevertheless, you can make it a little more user-friendly by making the binding always suggest the "follow"-profile for the LED-channels. This can be done by implementing a ProfileAdvisor in the binding and registering it as a service. I've done the same in the KNXProfileAdvisor of the KNX2 binding. It basically "suggests" to the framework to use the "follow" profile by default for certain channel types. In that way, users don't even need to know anything about profiles and the like.
Re: Binding with communication profile [message #1790676 is a reply to message #1790526] Thu, 14 June 2018 10:15 Go to previous message
Lukasz Dywicki is currently offline Lukasz DywickiFriend
Messages: 32
Registered: July 2009
Member
Hey Simon,
Trick with additional segment in channel UID is what I missed. I saw earlier documentation about explicitly specified profile. Now its clear. I gonna give it a try.

I managed to implement profile advisor based on enocean logic, now will play with more advanced syntax.

Cheers,
Lukasz
Previous Topic:How to Use the Recently Added MQTT Binding
Next Topic:Parameters on Channel
Goto Forum:
  


Current Time: Wed Sep 26 04:25:04 GMT 2018

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

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

Back to the top