-
Notifications
You must be signed in to change notification settings - Fork 782
Units of Measurement: Follow up issues for the new QuantityType #5243
Comments
The documentation of the refactored bindings also needs to be updated: |
Yes please, an updated documentation would be helpful to understand in particular how to define the items now (item label). |
@lolodomo The demo contains some item definition examples: |
Good question: are all persistence services compatible with the new type ? |
@lolodomo That's a very valid question! I had actually thought about this, but in the end forgot to adapt the compatibility layer (through which all persistence in openHAB is still handled) accordingly. |
I left a comment on the PR Kai did which shows a structural issue with persistence and UoM: openhab/openhab-core#319 (review) |
Please see openhab/openhab-core#325. The question is, is it right to strip the unit-subtype there or is it better stripped in the ItemProvider in ESH? |
@J-N-K Clearly to be fixed in the compat layer, not in ESH. |
I found another issue related to the new // EDIT: For clarification: The highlight works fine on |
The sitemap syntax should let you mention the unit for the visibility and color attributes. |
How does it work? I didn't find an example. What has to be changed in the following line?
// EDIT: Item type is |
Sorry, I mean you should be able but unfortunately you probably can't ... until this is enhanced. |
@htreu : can you please remind us what is the new syntax including the unit in rules and in console commands ? |
Looking at the code for the console commands, I have the feeling this was not updated, meaning you can't mention the unit ? |
@lolodomo in the console you are able to provide the value & unit in one string:
Unfortunately in the IDE console you get parsing errors when using the |
As for the syntax in rules it is missing in the docs right now. But I did a blog post here. The syntax is described in the "Scripts & Rules" section. |
So for sitemap, should we update the syntax the same way as for rules or should we consider the same syntax as in console commands ? |
For sitemaps the syntax follows the item state description syntax: |
The QuantityType is actually able to parse Strings like |
As @cweitkamp explained, the problem is not the label attribute but would be the labelcolor /valuecolor / visibility attributes. |
Netatmo binding is handling Co2 and noise data, respectively in ppm and decibel units. |
@htreu : regarding your first point (refresh when the unit system is updated), I imagine that setUnitProvider will be called for the thing handler factory of any binding referencing it when the the unit system is updated by the user ? |
Unfortunately this is not the case. The framework provides one instance of the UnitProvider and changes are not propagated to referencing services. The service setter For the refresh to work we need some registration mechanism where bindings register for UnitProvider updates. The framework can then call all registered listeners and notify about the update. |
As discussed in another PR (netatmo binding), it looks like the min/max/step attributes of a channel type are not correctly handled when the channel type uses UoM. It should be possible to set the unit with the value of these attributes, something like |
As mentioned here, it is not possible to check for the correct type of an item's state without generating log messages. |
Comparison in rules for % is not possible: .items
.rules
openhab.log
If I change to
|
Did you try to put the % between square brackets like this |
@cweitkamp, that works. It‘s even in the blog post @htreu mentioned above. Maybe it‘s me, but I didn‘t notice the necessity of the brackets. |
In a rule under OH 2.3.0, I receive this log error:
in reaction to the expression |
I have seen the same error and wondered why it happened. We might need some implicit imports in Xbase for it - @watou I would say that this is worth a separate issue (as I consider it a bug). Would you be so kind and create one? |
Looking for a working way to use UoM to create a QuantityType in a rule from a variable, not a constant scalar value. The following under OH 2.3.0:
produces the log messages:
|
Using 2.4.0-SNAPSHOT build # 1378, when using
The only expression in the rule referencing CELSIUS is val double dewptf = new QuantityType(dewptc, CELSIUS).toUnit('°F').doubleValue There is no reference to |
These are some known issues after the Units of Measurement support in ESH landed (#4818):
REFRESH
command is issued to the corresponding items the user gets the impression nothing changed.The text was updated successfully, but these errors were encountered: