I would definitely go for option 2.
The existing serial binding is very basic and only meant to do simple tasks such as sending Strings (without a particular meaning) or being a cheap way to connect a hardware button (what I use at demos by simply shortcutting two pins on the serial port).
Any use case that sends data in a structured way (i.e. a certain protocol) via the serial interface, should be covered in a dedicated binding. This binding can then be specific to what the protocol/hardware supports. So you could bind your window contacts to ContactItems and your PIRs to SwitchItems.
Regards,
Kai
> --
> You received this message because you are subscribed to the Google Groups "openhab" group.
> To post to this group, send email to ope...@googlegroups.com.
> To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/openhab?hl=en.
>
> I would definitely go for option 2.
+1
What i expect are many bindings that have the Transport Protocol in common. For example the "Simple Serial Binding", DMX512, RS485, your alarm system, many heating systems, etc. There will also be a TCP/UDP binding which which does only differ in the way the information the received String is interpreted (see issue #33 http://code.google.com/p/openhab/issues/detail?id=33 which will do the same except using another Transport Protocol.
So we should keep this common base in mind when designing the new binding. I don't know how to which grade we could achieve reusability, but at least we should keep that in mind. Also i vaguely remember a discussion taking place on the mailing list (but i didn't find the thread yet, @Kai: do you remember the discussion) where a solution based on regular expressions has been discussed.
Ragrds,
Thomas E.-E.
No, sorry, I don't remember...
Thomas, are you talking about this discussion? I would really like to think about this option, as this would open the road people to define relatively easy new or existing protocols.Karel, which burglar alarm system you plan to integrate? I would like to do exactly what you talk about to my home. I stopped to PARADOX alarm system and had published the protocol here: http://code.google.com/p/openhab/issues/detail?id=36
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/uEUwcTcxIkAJ.
For me it seems an easy way to bring universal control of media appliances (TV's, PVR,...) to openHAB by just leveraging the ubiquitous IR interface these devices have.
Inheritance / extension of a base tcp/ip java class?
That was about my idea about implementing ONE binding, which provides a plugin mechanism for the protocol, while using the same transport for all.
Such a plugin mechanism could use the openHAB script language, i.e. I could imagine having a new file type in the designer that allows writing the logic. Each file would correspond to one protocol and there would be no need to generate, implement & build any new bindings.
Regards,
Kai