From 54ccf847dab8fd6f644f31f2b4962162d4fb65da Mon Sep 17 00:00:00 2001 From: Martin Herbst Date: Thu, 3 Nov 2022 19:21:13 +0100 Subject: [PATCH] Some HM devices are using relative humidity (% rH/rF) as units (#13626) Fix #13553 Signed-off-by: Martin Herbst --- .../internal/converter/type/QuantityTypeConverter.java | 2 ++ .../openhab/binding/homematic/internal/type/MetadataUtils.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/QuantityTypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/QuantityTypeConverter.java index d1647c0315d..2e6ca6ae00d 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/QuantityTypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/QuantityTypeConverter.java @@ -104,6 +104,8 @@ public class QuantityTypeConverter extends AbstractTypeConverter(number, SIUnits.CELSIUS); case "V": return new QuantityType<>(number, Units.VOLT); + case "% rH": + case "% rF": case "%": return new QuantityType<>(number, Units.PERCENT); case "mHz": diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java index 8f62c70fcc2..11e2481e015 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java @@ -311,6 +311,8 @@ public class MetadataUtils { case "V": return ITEM_TYPE_NUMBER + ":ElectricPotential"; case "100%": + case "% rH": + case "% rF": case "%": return ITEM_TYPE_NUMBER + ":Dimensionless"; case "mHz":