So I’ve been using OH for a number of years, and started playing with OH3, which looks a great update.
However, there’s a few bit’s I’m not clear on. For example - I have a temperature monitor delivering over MQTT. So, I have a Bridge, Thing and Channel:
Bridge mqtt:broker:haus "Haus MQTT Broker" [ .. ]
{
Thing mqtt:topic:boilermon "Boiler Monitor" {
Channels:
Type number : feed_house [ stateTopic="/boilermon/temp/28FFB80C9215043E" ]
.....
}
And a corresponding item
Number Temperature_Boiler1 "Feed House" ["Measurement", "Temperature"] {
channel="mqtt:topic:boilermon:feed_house"
}
This all works great - I see a “Temperature” block in the Properties UI, I click it, see the feed temperature… but: no units. The documentation [https://www.openhab.org/docs/concepts/units-of-measurement.html#quantitytype] says the default metric for a temperature dimension is Celsius, and Kelvin as also supported (but not Fahrenheit?)
So I try to guess at how to override that. Adding unit="K"
to the item definition does… nothing. However, adding it to the feed_house channel… does work.
This is confusing to me for a number of reasons:
- surely it’s the item which is, semantically, the measurement and property(temperature)? The channel might be specifying some other unit, and I may have had to perform a transformation within the item in order to normalize it to degrees C.
- I seem to be able to specify any bit of text I like; “K”, “F”, “Blagh”, makes no difference. I was expecting to only be allowed to specify one of the two supported temperature types (so the system could reason about the units in use).
Secondly, I think I was expecting the semantic tags to “type” additional metadata. So, for example, if I tagged something as a location type “Floor”, there might be an additional declared field of ‘floorNumber’ that I could set. Similarly if I had a property of type ‘temperature’ I was expecting to have a unit property of ‘unit’ from a controlled vocabulary, defaulting to celsius if not specified. The UI could then perhaps add editing for that metadata because of the semantic classification.
Similarly I have items tagged as Voltage, which don’t seem to be displayed as dimensionless, which seems a shame given that ought to be a safe default.
It’s possible I’ve just missed something, or this isn’t finished yet, or I’m wildly off track?
This also feels related to profiles, which feel like a soft-subtyping of item types, where the tagging is extending functionality as well as properties. Kind of like a subtype of the “Equipment” subclass “wallswitch”, making me think “wouldn’t it be nice to be able to subtype these things at runtime” ?