I am using openHab controlling and reading Homematic Devices since a while and recently I saw that one of my Homematic temperature/humidity sensor shows “one” as a unit istead of “%”. The strange thing is that another temp./humidity sensor is recognized correctly. I am pretty sure both showed “%” some weeks/month ago.
What may be interesting in addition is, that for the Sensor without proper Unit I need to click “show advanced” when I want to see the channel for humidity - otherwise it does not show up.
EDIT 3: The next strange observation is, that the Humidity with Unit “one” does not trigger any log events. I.e. when I filter “humidity” in the log, I only see value changes of the sensor with a unit, not the other one. But when I open the diagram for the humidity values without unit I can see that it changes over time.
Temperatur values are visible inside the log for both sensors by the way.
Dimensionless is, as the name says, dimensionless. There are a few dimensionless units, among them %, decibles, and ONE.
If you use a Number:Dimensionless Item, posting a number without units will default to ONE as the unit. You can tell OH to use one of the other units (%) in this case, by setting the State Description Metadata (see the “Add Metadata” section of the Item’s page) and set the pattern to something like %.0f % or maybe %.0f %% if that first one doesn’t work.
On OH 3.3, if an update is posted to a Number Item that has units, that Number Item will magically start to carry units and you should change the type of that Item to match the units and supply State Description metadata for that one. In OH 3.4 this behavior has been eliminated. If you have a Number Item, it will never carry units.
Awesome - thank you for that explanation. It worked.
That site does not contain any part for metadata Items | openHAB so I guess you meant this one in the concepts area: Items | openHAB?
The missing metadata entry does not explain why the item does not trigger a log-event, or does it?
I am not sure if I completely understood that … My takeaway right now is: I go through all my items with correct units and set up a State Description Metadata similar to the unit the items carries. E.g. if a temperature Item shows 21.5 °C, I need set up the metadata of that Item to %.1f °C. That is cause the Item without metadata “magically” shows the right unit but I need to tell the system explicitely what unit the item carries. Correct?
The syntax for metadata is missing from this page but you probably don’t need to refer to that page much if ever anyway because you are defining your Items through the UI. That page mostly covers the syntax of .items files.
This page does discuss Item metadata and even provides an example of the syntax for .items files.
But this is a case where the UI is mostly self documenting. Just click “Add metadata” on the Item you want to add metadata for and select the metadata you want to add. The forms presented either link to the docs you need to reference or document each field in place.
No. The only reason you wouldn’t see logs en events.log are:
the Item is not changing
there is a filter put in place to stop OH from logging the event
Also check the Item type. Number should not carry units (and in fact is prevented from that in 3.4). Number:X should carry units. You would do well to specify the state description for all those Items.
The Channel often will tell you what type of Item should be linked to the Channel (e.g. if it provides units for a temperature reading, it’ll tell you to link to a Number:Temperature Item.
If what ever is providing the update supplies units, in OH 3.3 it will apply those units no matter what type of Number Item it is.
To have the best results:
Always match the type that the Channel says it should be linked to. If it just says Number, use Number. If it says Number:Temperature, use Number:Temperature.
For those Items that are Number:X, you would do well to provide a State Description metadata to tell OH what units you really want to see. If the binding supplies °F, you can specify °C here and your Item will be converted to °C.
Alright, thanks again for all the information. I will do the homework today
What I just saw this morning is that the humidity now has a value of 4900% – probably due to a “wrong” transformation from raw 49 to percent (same as in excel I guess). Is it enough to try to shift the decimal point? Or is there an other, deeper issue? If shifting is enough, how can I achieve it? Can I just write `%.0f %%/100’?
The value of the item is changing so the reason might be the second point. I am pretty sure that I never set up such a filter. Where do I need to look for that?