KNX OH 4.0.0 M3 and percentages

Hello,

since the update to OH 4 M3 I have a problem with percentages.

My configuration working with OH 3.4 was:

knx.things:

Type dimmer: Feuchtigkeit "Luftfeuchtigkeit EG_01_HWR" [ position="9.001:<13/1/10"]

knx.items:

 Number:Dimensionless EG_01_HWR_Feuchtigkeit "Luftfeuchtigkeit HWR [%d %%]" <humidity> (gKNX, gGrafana, gHWR) {channel="knx:device:bridge:EG_01_HWR_TA:Feuchtigkeit"}

With OH 4 M3 I get the following warning:

[WARN ] [ding.knx.internal.channel.KNXChannel] - Configured DPT '9.001' is incompatible with accepted types '[class org.openhab.core.library.types.PercentType, class org.openhab.core.library.types.OnOffType, class org.openhab.core.library.types.IncreaseDecreaseType]' for channel 'knx:device:bridge:EG_01_HWR_TA:Feuchtigkeit'

If I change the DPT to 5.001 the error message disappears, but I get a value, e.g. 0.09, which does not match the actual KNX value 0.6168.

Only with the following configuration I get the values, but not as percent, but only the decimal number.

knx.things:

Type number: Feuchtigkeit "Luftfeuchtigkeit EG_01_HWR" [ ga="9.007:<13/1/10"]

In OH 4 UI the number is then represented as percent. But I also write the values into an InfluxDB and display them with Grafana. Of course only the decimal number ends up there and is displayed. How can I solve this problem?

Thanks a lot!

I think it is related to UoM handling updates in OH 4, try adding unit metadata property. I saw this advice in other topic.

Thank you so much for pointing me in the right direction.

I just had to append a

, unit="%"

to the channel and the values are correctly displayed and transferred to InfluxDB.

Thanks a lot!

1 Like