From 76e9767840e043b3d06bbde3643162b7d20865d7 Mon Sep 17 00:00:00 2001 From: iranl Date: Tue, 15 Oct 2024 17:02:15 +0200 Subject: [PATCH 1/3] Fix opener electronic strike actuation in HA --- src/NukiNetwork.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NukiNetwork.cpp b/src/NukiNetwork.cpp index 1aff483..e400742 100644 --- a/src/NukiNetwork.cpp +++ b/src/NukiNetwork.cpp @@ -880,7 +880,11 @@ void NukiNetwork::publishHASSConfig(char* deviceType, const char* baseTopic, cha uint32_t aclPrefs[17]; _preferences->getBytes(preference_acl, &aclPrefs, sizeof(aclPrefs)); - if((int)aclPrefs[2]) json["pl_open"] = openAction; + +` if((strcmp(deviceType, "SmartLock") != 0 && (int)aclPrefs[2]) || (strcmp(deviceType, "SmartLock") == 0 && (int)aclPrefs[11])) + { + json["pl_open"] = openAction; + } json["stat_t"] = String("~") + mqtt_topic_lock_ha_state; json["stat_jam"] = "jammed"; From 03d6baf3893d28e7167f45a2f0553f0d2d5da30b Mon Sep 17 00:00:00 2001 From: iranl Date: Tue, 15 Oct 2024 17:17:18 +0200 Subject: [PATCH 2/3] Update src/NukiNetwork.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David GirĂ³n --- src/NukiNetwork.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NukiNetwork.cpp b/src/NukiNetwork.cpp index e400742..f38c4f7 100644 --- a/src/NukiNetwork.cpp +++ b/src/NukiNetwork.cpp @@ -881,7 +881,7 @@ void NukiNetwork::publishHASSConfig(char* deviceType, const char* baseTopic, cha uint32_t aclPrefs[17]; _preferences->getBytes(preference_acl, &aclPrefs, sizeof(aclPrefs)); -` if((strcmp(deviceType, "SmartLock") != 0 && (int)aclPrefs[2]) || (strcmp(deviceType, "SmartLock") == 0 && (int)aclPrefs[11])) + if((strcmp(deviceType, "SmartLock") != 0 && (int)aclPrefs[2]) || (strcmp(deviceType, "SmartLock") == 0 && (int)aclPrefs[11])) { json["pl_open"] = openAction; } From f61a51fcc44429325dec87caf65e6f5018e13449 Mon Sep 17 00:00:00 2001 From: iranl Date: Tue, 15 Oct 2024 17:22:01 +0200 Subject: [PATCH 3/3] Update NukiNetwork.cpp --- src/NukiNetwork.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NukiNetwork.cpp b/src/NukiNetwork.cpp index f38c4f7..96e6cbf 100644 --- a/src/NukiNetwork.cpp +++ b/src/NukiNetwork.cpp @@ -881,7 +881,7 @@ void NukiNetwork::publishHASSConfig(char* deviceType, const char* baseTopic, cha uint32_t aclPrefs[17]; _preferences->getBytes(preference_acl, &aclPrefs, sizeof(aclPrefs)); - if((strcmp(deviceType, "SmartLock") != 0 && (int)aclPrefs[2]) || (strcmp(deviceType, "SmartLock") == 0 && (int)aclPrefs[11])) + if((strcmp(deviceType, "SmartLock") == 0 && (int)aclPrefs[2]) || (strcmp(deviceType, "SmartLock") != 0 && (int)aclPrefs[11])) { json["pl_open"] = openAction; }