Home » Archived » Eclipse SmartHome » Allow channels without item type
| | | |
Re: Allow channels without item type [message #1731745 is a reply to message #1731667] |
Mon, 09 May 2016 18:33 |
Marcel Verpaalen Messages: 59 Registered: September 2014 |
Member |
|
|
I don't know for others, but in my case most of my integration is done via mqtt. You may call that a transport, but the mqtt binding is the one exposing all the things that OH has no bindings for (e.g. solar logging, electricity metering, water & gas metering, control water valves, control non-standard lighting, alarm system etc)
If that is no longer considered a binding... than what is it. The mqtt transport layer is already defined, I think similar to the serial binding it is more of a background service than something the user will interact with. Hiding some of the complexities of the mqtt protocol.
I think that the solution watou posted on the forum is certainly better than my proposal: let the ESH framework deal with proper conversions rather than each binding. So depending on what itemtype is linked, the framework will try to convert into the linked item. That also solved the problem what to do when multiple itemtypes are linked to a channel.
In that case e.g. the mqtt binding would simply expose a string channel, and if the user wants to have number or switch item controlled by it, he/she links such an item type, and get's the data delivered according to the item type.
|
|
|
Re: Allow channels without item type [message #1731751 is a reply to message #1731745] |
Mon, 09 May 2016 19:16 |
Kai Kreuzer Messages: 673 Registered: December 2011 |
Senior Member |
|
|
> it is more of a background service than something the user will interact with
Yes, so you seem to agree that the concept of a Thing, which represents an external (usually physical) device with certain features, does not match here at all - it is rather an extended event bus with its own very specific configuration to get it working.
I simply think that we should not try to press it into the Thing concept, if it only makes stuff more complex for all others. I also wonder, if there needs to be any UI support for such a "technical" feature. It seems rather better to be compared to the REST API (which also allows integration with "all for which there is no binding") or e.g. the HomeKit integration (https://github.com/openhab/openhab2-addons/tree/master/addons/io/org.openhab.io.homekit).
But let's stick to the Things for another moment, because I am still not sure I have grasped the whole problem.
> the mqtt binding would simply expose a string channel, and if the user wants to have number or switch item controlled by it, he/she links such an item type
So why doesn't the user directly define a Thing with a number or switch channel? Why does it have to be a string channel in the first place?
Maybe it is not clear that it is not only the binding, which can define channels of a Thing, but also the user, see https://www.eclipse.org/smarthome/documentation/features/dsl.html#defining-channels.
So you can simply define an MQTT Thing with channels for your solar logger, meter, valves, etc. and link the according items to these channels - all would be type safe and would fit nicely into the current architecture.
|
|
| | | | |
Goto Forum:
Current Time: Mon Sep 23 07:16:03 GMT 2024
Powered by FUDForum. Page generated in 0.04874 seconds
|