Thank you for your reply @rossko57. I’m sorry that I don’t explain myself well, I’m just don’t familiar enough with the terms to know exactly what things are called yet.
What I mean is that if I use a Group
Item
I can aggregate (OR(ON, OFF)
) so that I can end up with one status that says “alarm” or “no alarm” per device. Listing all of them just takes way too much screen space. But, if I do this, I have no control over the layout or the transformation/mapping, and I’m stuck with the flawed logic as it is defined by the channel.
If I choose the other “subgroup” effect, where I do have layout control, I can’t aggregate as far as I understand. Sure, I guess I could make a proxy item the I displayed, but again this is a hack/workaround using rules to set basic values. This is what I mean:
Text item=MyProxyAggregatedState {
Text item=FireGroundFloorSmokeAlarm label="Røyk [MAP(alarm.map):%s]"
Text item=FireGroundFloorTempAlarm label="Temperatur [MAP(alarm.map):%s]"
..
}
I guess it just “rubs me the wrong way” that I have to do the value conversions on the “sitemap”/presentation level when it should be done on the “item”/logics level. Everything would work out nicely if you could make things correct on the “item” level, your wouldn’t have to make a lot of workarounds every time you wanted to present the value - be in in a sitemap or in some other “output channel”.
I understand that even logical flaws create precedence in that “everybody” has to implement workarounds that will suddenly break if the flaw is fixed. This is why it’s important to deal with such fundamental logic flaws as soon as they arise, and not let them linger around and manifest themselves. It just gets harder and harder to “get out of”.
That said, I have spent the last… 24 hours fighting with Oomph, class path conflicts, out of memory errors and the like, but it seems I can finally build openHAB, or at least most of it. I must admit that this far there’s lots I don’t grasp when in comes to the structure of the system, how it all ties together, and the modelling stuff, but the Java code itself is easy enough. From the little I have grasped this far, it doesn’t seem like this couldn’t be solved by creating more generic, logical “super item types” that behaves as they ought to, and then let Switch
and Contact
remain concrete “sub-types” that keep their “legacy behavior” and in this way avoids breaking anything. But, there are large parts that I don’t yet understand, so I guess I would have to do a lot of debugging to see if things would actually work the way I imagine.
Another thing I’ve noticed is that there already is a standardized way of “casting” between the data types within the Item
types (acceptedDataTypes
etc). It doesn’t seem hard at all to make ContactItem
accept OnOffType
and SwitchItem
accept OnOffType
. After all, they are both really just booleans. I don’t know if it’s that simple, but I think it’s worth looking into if this simple change would allow one to define a Switch
as a Contact
and vice versa.
The problem is that I’ve burned myself before on open-source projects, where I invest time to figure something out, but when I find the solution, the project isn’t really that interested because of reasons not obvious or known to me as an outsider. I hate wasting my time like that, so what I’m really trying to figure out is if there is anything here worth trying to improve, or if this is now simply “how we want to keep it”.