Bindings on top of Bindings

112 views
Skip to first unread message

Gaël L'hopital

unread,
Nov 29, 2014, 3:49:29 AM11/29/14
to open...@googlegroups.com
I think this question is clearly more in the perimeter of OH2 than OH.
I'm wondering wether it could be a good idea to introduce a notion of 'functional module' or 'plugin' like exists in other home automation boxes:

in my understanding, a binding is a pack of functions targetted to make the link between OH and a specific technology (hardware/software => openhab)
A module would be a set of functions taking Items as input and issuing postUpdate/sendCommand as output.

Currently, nothing would inhibit to do so with bindings I guess, but for clarity, I think it would be worth distinguish these two domains.
I've actually got two of them as a set of items, rules, sitemap parts, transformations : 
- a weather station
- a virtual thermostat
that could be packed in such modules.

Sorry for this fuzzy message, pulling rough ideas this way is not easy

Kai Kreuzer

unread,
Nov 29, 2014, 7:45:57 AM11/29/14
to open...@googlegroups.com
Hi Gaël,

What you describe sounds to me similar to what we are trying to introduce with the new modular rule concept, see https://www.eclipse.org/forums/index.php/t/860533/.
After all, rules are „functional modules“. The only thing that I would not want to try to directly couple to it is the presentation layer, i.e. sitemap parts.

If you are more thinking along a „virtual device“, then note that the bindings do not talk about devices, but „things“, which in our vocabulary also include „virtual“ services - the Yahoo Weather binding is exactly such an example.

Best regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/24670b4e-2761-49ee-aa0a-8163463f2da9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ap15e

unread,
Nov 29, 2014, 2:21:59 PM11/29/14
to open...@googlegroups.com
I'm new to openHAB, so please correct me if I'm wrong.

IIUC, there is no such thing as a 'structured item'.
There is no way to define an item "Weather" that contains
wind speed, wind gust, rain rate, total rain, weather condition, height of snow, radioactivity, ....
AND provides specific actions and events, e. g. a "radioactivity alarm". Yes, you can define
an item for radioactivity, bind it to your Geiger–Müller counter, and set up a simple rule for
"radioactivity alarm", BUT the radioactivity threshold is a function of your geographical location,
the current rain rate, the height of snow, ... It would be nice to be able to hide this complexity
within a simple binary event provided by the Weather item.

The Weather item could come with one (or even more) pre-defined descriptions for the presentation
layer the user could choose from, but I'm with Kai that there shouldn't be a hard-coded coupling
to the presentation layer.

Being a MiOS developer, I'd like to know whether there are plans to provide
an abstraction layer for bindings. UPnP comes to mind ...

BR,
Ap15e

Kai Kreuzer

unread,
Dec 5, 2014, 5:07:08 PM12/5/14
to open...@googlegroups.com
Well, I see two options here:

1. All the required data is somehow available to the binding (because it requests it from some webservice or whatever). Then the binding could offer a "switch" channel for the "radioactivity alarm" and include all the complex processing logic in its own handler class.
2. The data comes from different sources/bindings. In this case you would could offer a rule with a couple of input parameters where the user has to define, which items are fed into them. The resulting rule execution could either directly do all necessary things (sending notifications etc.) or simply set the status of a "virtual" item (i.e. an item that is not linked to any binding).

Regards,
Kai

This sounds very much like a rule trigger to me, not like an item.
Reply all
Reply to author
Forward
0 new messages