Confusion about UOM on my energy-measurement in Wh displayed in kWh

Hi all,
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 :wink:

So what it the preferedd way without making javascript-Transformations (and also without proxy-items)?
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

Best thanks for solving my confusions

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.

Hi Rich,
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:
before change
11, 12, 13, 14, 15, 16
after change
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.

… ok, thank you. then i will wait for OH4 and in the meantime i have a proxyitem and a rule which is deviding by 1000.

So in reason i summarize for the problem is that knx not giving the correct units in addition to the values and thats why openhab cannot make the conversion to kilo =dividing by 1000 automaticly,

Don’t misunderstand.

even OH 4 can’t handle that and has a warning in the UI when changing the units for an Item.

You can’t just change the units of an Item even in OH 4 without manually adjusting the old database values.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.