From a646fe34e05b7fca53339834ffa72c9d5d33fcb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Vyb=C3=ADral?= Date: Sat, 1 Oct 2022 13:45:35 +0200 Subject: [PATCH] [nuki] Fixed nukiId migration for devices with shorter nukiId (#13088) (#13470) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Vybíral --- bundles/org.openhab.binding.nuki/README.md | 9 +++++++++ .../nuki/internal/handler/AbstractNukiDeviceHandler.java | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.nuki/README.md b/bundles/org.openhab.binding.nuki/README.md index e4611d3f3..c3b751e66 100644 --- a/bundles/org.openhab.binding.nuki/README.md +++ b/bundles/org.openhab.binding.nuki/README.md @@ -169,6 +169,15 @@ If secureToken property is enabled, make sure that time on device running openHA is enabled, all requests contain timestamp and bridge will only accept requests with small time difference. If it is not possible to keep time synchronized, disable secureToken feature. +### NukiId conversion when migrating from old binding version + +Older versions of binding used nukiId in hexadecimal format (as displayed in Nuki app, e.g. 5C4BC4B3). The new version +expects nukiId to be in decimal format (e.g. 1548469427), since that's the format returned from API. +The binding does the conversion automatically, but only if your nukiId contains any letters A-F, otherwise the binding +has no way to tell whether the id is in hexadecimal or decimal format. If your nukiId in hexadecimal format +contains only numbers, you'll have to convert it to decimal format manually, or preferably delete the old Thing +and use discovery to recreate it. + ## Full Example A manual setup through files could look like this: diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/AbstractNukiDeviceHandler.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/AbstractNukiDeviceHandler.java index 23387dcd7..b2f9f1eb3 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/AbstractNukiDeviceHandler.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/AbstractNukiDeviceHandler.java @@ -63,7 +63,8 @@ public abstract class AbstractNukiDeviceHandler reInitJob;