im very confused about units and uom and hope you can help me.
Im using Openhab 3.4.3.
Base of my problem:
i used before an item filled from knx: 13.013:<4/2/3
this was delivering the kWh from a knx-measurement-actor - until here it was all fine
i changed it to 13.010:<4/2/3
which is delivering Wh.
Why i did this? Because i dont want to know all view days a change from difference 1 kWh. I want to have a change how often it really changes.
Example 13120 Wh-> 13144 Wh in an hour. Only DTP 13.010 deliveres something behind the dot 13 kWh.
The Point is, that I would like to have if the item which shown somewhere i want to see 13.144 kWh. So how it is possible to collect the Wh-item and showing Human-readable kWh?
If im entering the pattern %.1f Wh then it shows the correct Value but in Wh.
If im entering %.1f kWh then it shows me 13144000.0 kWh which is a little bit too much
There is a history existing with influxdb-persistence which i dont want to lose and which i would like to write further with the correct values
Does the binding deliver units with the value? For example, in the MQTT binding there is a field where you can set the units and when the binding updates the Item it appends those units. If so, did you remember to update that to Wh too?
I’ve never seen the conversion fail like that so the solution is going to be something along these lines. There is a miss match between what the Item thinks it’s units are, what the binding is sending, and what the state description says to show.
In OH 4 this is much easier as the definition of the units carried by the Item are now separate from the state description. So you can set the units to Wh and the state description to kWh and there won’t be any confusion. In OH 3, it’s much trickier.
from my opinion the binding deliveres only values without unit. So it seems that influx now has a big change in values in there like that:
11, 12, 13, 14, 15, 16
117000, 117200, 117300 and so on.
and if im having now pattern in there “%.1f kWh” it shows values correct now, but the graph is showing the values not nice because the big gap…
That’s to be expected. You changed the units but persistence knows nothing about units. It only ever saves the number the Item carries without any sort of conversion of units.
You’ll have to go back and manually adjust the old values. There is no way for OH to go back and change those values for you. Maybe sometime in the distant future but even OH 4 can’t handle that and has a warning in the UI when changing the units for an Item.