From fd4fe68b89106f1267be06b4cf98dd9a657c5f6d Mon Sep 17 00:00:00 2001 From: technyon Date: Mon, 21 Oct 2024 14:15:34 +0200 Subject: [PATCH 1/5] add feature comparison to the readme --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 3c25bde..215ed09 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,32 @@ See the "[Connecting via Ethernet](#connecting-via-ethernet-optional)" section f The ESP32-S3 is a dual-core CPU with many GPIO's, ability to enlarge RAM using PSRAM, ability to connect Ethernet modules over SPI and optionally power the device with a PoE splitter. The only functions missing from the ESP32-S3 as compared to other ESP devices is the ability to use some Ethernet modules only supported by the original ESP32 and the ability to connect over WIFI6 (C6) +## Feature comparison Nuki Hub vs. Nuki Bridge + +| Feature | Nuki Hub | Nuki Bridge | +|---|---|---| +| Bridge API | | x | +| Smart Lock remote control | (optional via smarthome solution) | x | +| Smart Home integration via Matter | | x | +| Apple HomeKit integration via Matter | | x | +| MQTT API | x | x (only for SL > 3, Pro models) | +| Wired LAN support | x | | +| WLAN support | x | x (only for SL > 3, Pro Models) || Home Assistant integration | x (full integration of most Nuki features) | x | +| Home Automation platform integration | x | x | +| Cloud support | (optional via smarthome solution) | x | +| Cloud-less operation | x | x (since fw 3.8.2, to be tested) | +| Smarthome app integration | | x | +| Nuki Smartlocks all models | x | x | +| Nuki opener | x | x | +| Nuki Keypad (1.0 and 2.0) | x | x | +| MQTT encryption | x | | +| Fine-grained access control of MQTT API | x | | +| Export of lock actions via MQTT API | x | | +| Control via GPIO | x | | +| Hybrid mode for Pro locks | x | | + + + ## Support Nuki Hub development If you haven't ordered your Nuki product yet, you can support me by using my referrer code when placing your order:
From 53c119275322af2bbbe2afc1de0e781e44cbb5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Ole=20Sch=C3=BCmann?= Date: Mon, 21 Oct 2024 21:04:08 +0700 Subject: [PATCH 2/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 215ed09..542d1e1 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ The ESP32-S3 is a dual-core CPU with many GPIO's, ability to enlarge RAM using P | Apple HomeKit integration via Matter | | x | | MQTT API | x | x (only for SL > 3, Pro models) | | Wired LAN support | x | | +| Power over Ethernet (PoE) | x (if supported by LAN/ESP module) | | | WLAN support | x | x (only for SL > 3, Pro Models) || Home Assistant integration | x (full integration of most Nuki features) | x | | Home Automation platform integration | x | x | | Cloud support | (optional via smarthome solution) | x | From e25d642ad92dab6525d8802b23e5aa7ef7842a01 Mon Sep 17 00:00:00 2001 From: iranl Date: Tue, 22 Oct 2024 22:42:06 +0200 Subject: [PATCH 3/5] Fix AllowedUntil --- src/NukiOpenerWrapper.cpp | 4 ++-- src/NukiWrapper.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NukiOpenerWrapper.cpp b/src/NukiOpenerWrapper.cpp index 56b7733..bfa9352 100644 --- a/src/NukiOpenerWrapper.cpp +++ b/src/NukiOpenerWrapper.cpp @@ -2672,7 +2672,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value) if(allowedUntil.length() > 0) { - if(allowedUntil.length() > 0 == 19) + if(allowedUntil.length() == 19) { allowedUntilAr[0] = (uint16_t)allowedUntil.substring(0, 4).toInt(); allowedUntilAr[1] = (uint8_t)allowedUntil.substring(5, 7).toInt(); @@ -3478,7 +3478,7 @@ void NukiOpenerWrapper::onAuthCommandReceived(const char *value) if(allowedUntil.length() > 0) { - if(allowedUntil.length() > 0 == 19) + if(allowedUntil.length() == 19) { allowedUntilAr[0] = (uint16_t)allowedUntil.substring(0, 4).toInt(); allowedUntilAr[1] = (uint8_t)allowedUntil.substring(5, 7).toInt(); diff --git a/src/NukiWrapper.cpp b/src/NukiWrapper.cpp index 8c7e2ef..8888ef7 100644 --- a/src/NukiWrapper.cpp +++ b/src/NukiWrapper.cpp @@ -2785,7 +2785,7 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value) if(allowedUntil.length() > 0) { - if(allowedUntil.length() > 0 == 19) + if(allowedUntil.length() == 19) { allowedUntilAr[0] = (uint16_t)allowedUntil.substring(0, 4).toInt(); allowedUntilAr[1] = (uint8_t)allowedUntil.substring(5, 7).toInt(); @@ -3594,7 +3594,7 @@ void NukiWrapper::onAuthCommandReceived(const char *value) if(allowedUntil.length() > 0) { - if(allowedUntil.length() > 0 == 19) + if(allowedUntil.length() == 19) { allowedUntilAr[0] = (uint16_t)allowedUntil.substring(0, 4).toInt(); allowedUntilAr[1] = (uint8_t)allowedUntil.substring(5, 7).toInt(); From 2404e5bf317d80bf9ef354b149212b06c5550f35 Mon Sep 17 00:00:00 2001 From: iranl Date: Tue, 22 Oct 2024 22:53:32 +0200 Subject: [PATCH 4/5] Fix for JSON commands --- src/NukiOpenerWrapper.cpp | 46 +++++++++++++++++++-------------------- src/NukiWrapper.cpp | 46 +++++++++++++++++++-------------------- src/WebCfgServer.cpp | 2 +- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/NukiOpenerWrapper.cpp b/src/NukiOpenerWrapper.cpp index bfa9352..374215e 100644 --- a/src/NukiOpenerWrapper.cpp +++ b/src/NukiOpenerWrapper.cpp @@ -2530,7 +2530,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value) String allowedFromTime; String allowedUntilTime; - if(json["code"].is()) + if(json["code"].is()) { code = json["code"].as(); } @@ -2539,7 +2539,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value) code = 12; } - if(json["enabled"].is()) + if(json["enabled"].is()) { enabled = json["enabled"].as(); } @@ -2548,7 +2548,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value) enabled = 2; } - if(json["timeLimited"].is()) + if(json["timeLimited"].is()) { timeLimited = json["timeLimited"].as(); } @@ -2557,27 +2557,27 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value) timeLimited = 2; } - if(json["name"].is()) + if(json["name"].is()) { name = json["name"].as(); } - if(json["allowedFrom"].is()) + if(json["allowedFrom"].is()) { allowedFrom = json["allowedFrom"].as(); } - if(json["allowedUntil"].is()) + if(json["allowedUntil"].is()) { allowedUntil = json["allowedUntil"].as(); } - if(json["allowedWeekdays"].is()) + if(json["allowedWeekdays"].is()) { allowedWeekdays = json["allowedWeekdays"].as(); } - if(json["allowedFromTime"].is()) + if(json["allowedFromTime"].is()) { allowedFromTime = json["allowedFromTime"].as(); } - if(json["allowedUntilTime"].is()) + if(json["allowedUntilTime"].is()) { allowedUntilTime = json["allowedUntilTime"].as(); } @@ -3047,7 +3047,7 @@ void NukiOpenerWrapper::onTimeControlCommandReceived(const char *value) String lockAction; NukiOpener::LockAction timeControlLockAction; - if(json["enabled"].is()) + if(json["enabled"].is()) { enabled = json["enabled"].as(); } @@ -3056,15 +3056,15 @@ void NukiOpenerWrapper::onTimeControlCommandReceived(const char *value) enabled = 2; } - if(json["weekdays"].is()) + if(json["weekdays"].is()) { weekdays = json["weekdays"].as(); } - if(json["time"].is()) + if(json["time"].is()) { time = json["time"].as(); } - if(json["lockAction"].is()) + if(json["lockAction"].is()) { lockAction = json["lockAction"].as(); } @@ -3337,7 +3337,7 @@ void NukiOpenerWrapper::onAuthCommandReceived(const char *value) String allowedFromTime; String allowedUntilTime; - if(json["remoteAllowed"].is()) + if(json["remoteAllowed"].is()) { remoteAllowed = json["remoteAllowed"].as(); } @@ -3346,7 +3346,7 @@ void NukiOpenerWrapper::onAuthCommandReceived(const char *value) remoteAllowed = 2; } - if(json["enabled"].is()) + if(json["enabled"].is()) { enabled = json["enabled"].as(); } @@ -3355,7 +3355,7 @@ void NukiOpenerWrapper::onAuthCommandReceived(const char *value) enabled = 2; } - if(json["timeLimited"].is()) + if(json["timeLimited"].is()) { timeLimited = json["timeLimited"].as(); } @@ -3364,28 +3364,28 @@ void NukiOpenerWrapper::onAuthCommandReceived(const char *value) timeLimited = 2; } - if(json["name"].is()) + if(json["name"].is()) { name = json["name"].as(); } - //if(json["sharedKey"].is()) sharedKey = json["sharedKey"].as(); - if(json["allowedFrom"].is()) + //if(json["sharedKey"].is()) sharedKey = json["sharedKey"].as(); + if(json["allowedFrom"].is()) { allowedFrom = json["allowedFrom"].as(); } - if(json["allowedUntil"].is()) + if(json["allowedUntil"].is()) { allowedUntil = json["allowedUntil"].as(); } - if(json["allowedWeekdays"].is()) + if(json["allowedWeekdays"].is()) { allowedWeekdays = json["allowedWeekdays"].as(); } - if(json["allowedFromTime"].is()) + if(json["allowedFromTime"].is()) { allowedFromTime = json["allowedFromTime"].as(); } - if(json["allowedUntilTime"].is()) + if(json["allowedUntilTime"].is()) { allowedUntilTime = json["allowedUntilTime"].as(); } diff --git a/src/NukiWrapper.cpp b/src/NukiWrapper.cpp index 8888ef7..7a5721a 100644 --- a/src/NukiWrapper.cpp +++ b/src/NukiWrapper.cpp @@ -2643,7 +2643,7 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value) String allowedFromTime; String allowedUntilTime; - if(json["code"].is()) + if(json["code"].is()) { code = json["code"].as(); } @@ -2652,7 +2652,7 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value) code = 12; } - if(json["enabled"].is()) + if(json["enabled"].is()) { enabled = json["enabled"].as(); } @@ -2661,7 +2661,7 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value) enabled = 2; } - if(json["timeLimited"].is()) + if(json["timeLimited"].is()) { timeLimited = json["timeLimited"].as(); } @@ -2670,27 +2670,27 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value) timeLimited = 2; } - if(json["name"].is()) + if(json["name"].is()) { name = json["name"].as(); } - if(json["allowedFrom"].is()) + if(json["allowedFrom"].is()) { allowedFrom = json["allowedFrom"].as(); } - if(json["allowedUntil"].is()) + if(json["allowedUntil"].is()) { allowedUntil = json["allowedUntil"].as(); } - if(json["allowedWeekdays"].is()) + if(json["allowedWeekdays"].is()) { allowedWeekdays = json["allowedWeekdays"].as(); } - if(json["allowedFromTime"].is()) + if(json["allowedFromTime"].is()) { allowedFromTime = json["allowedFromTime"].as(); } - if(json["allowedUntilTime"].is()) + if(json["allowedUntilTime"].is()) { allowedUntilTime = json["allowedUntilTime"].as(); } @@ -3160,7 +3160,7 @@ void NukiWrapper::onTimeControlCommandReceived(const char *value) String lockAction; NukiLock::LockAction timeControlLockAction; - if(json["enabled"].is()) + if(json["enabled"].is()) { enabled = json["enabled"].as(); } @@ -3169,15 +3169,15 @@ void NukiWrapper::onTimeControlCommandReceived(const char *value) enabled = 2; } - if(json["weekdays"].is()) + if(json["weekdays"].is()) { weekdays = json["weekdays"].as(); } - if(json["time"].is()) + if(json["time"].is()) { time = json["time"].as(); } - if(json["lockAction"].is()) + if(json["lockAction"].is()) { lockAction = json["lockAction"].as(); } @@ -3452,7 +3452,7 @@ void NukiWrapper::onAuthCommandReceived(const char *value) String allowedFromTime; String allowedUntilTime; - if(json["remoteAllowed"].is()) + if(json["remoteAllowed"].is()) { remoteAllowed = json["remoteAllowed"].as(); } @@ -3461,7 +3461,7 @@ void NukiWrapper::onAuthCommandReceived(const char *value) remoteAllowed = 2; } - if(json["enabled"].is()) + if(json["enabled"].is()) { enabled = json["enabled"].as(); } @@ -3470,7 +3470,7 @@ void NukiWrapper::onAuthCommandReceived(const char *value) enabled = 2; } - if(json["timeLimited"].is()) + if(json["timeLimited"].is()) { timeLimited = json["timeLimited"].as(); } @@ -3479,28 +3479,28 @@ void NukiWrapper::onAuthCommandReceived(const char *value) timeLimited = 2; } - if(json["name"].is()) + if(json["name"].is()) { name = json["name"].as(); } - //if(json["sharedKey"].is()) sharedKey = json["sharedKey"].as(); - if(json["allowedFrom"].is()) + //if(json["sharedKey"].is()) sharedKey = json["sharedKey"].as(); + if(json["allowedFrom"].is()) { allowedFrom = json["allowedFrom"].as(); } - if(json["allowedUntil"].is()) + if(json["allowedUntil"].is()) { allowedUntil = json["allowedUntil"].as(); } - if(json["allowedWeekdays"].is()) + if(json["allowedWeekdays"].is()) { allowedWeekdays = json["allowedWeekdays"].as(); } - if(json["allowedFromTime"].is()) + if(json["allowedFromTime"].is()) { allowedFromTime = json["allowedFromTime"].as(); } - if(json["allowedUntilTime"].is()) + if(json["allowedUntilTime"].is()) { allowedUntilTime = json["allowedUntilTime"].as(); } diff --git a/src/WebCfgServer.cpp b/src/WebCfgServer.cpp index 0c97b2d..43298d9 100644 --- a/src/WebCfgServer.cpp +++ b/src/WebCfgServer.cpp @@ -3068,7 +3068,7 @@ bool WebCfgServer::processImport(PsychicRequest *request, String& message) for(const auto& key : bytePrefs) { - if(!doc[key].isNull() && doc[key].is()) + if(!doc[key].isNull() && doc[key].is()) { String value = doc[key].as(); unsigned char tmpchar[32]; From a834380b2edcda967d464f689f84aa8e2b0a036f Mon Sep 17 00:00:00 2001 From: iranl Date: Mon, 28 Oct 2024 20:06:42 +0100 Subject: [PATCH 5/5] Update pioarduino and enlarge mqtt stack size --- README.md | 2 +- platformio.ini | 2 +- src/Config.h | 3 ++- src/NukiNetwork.cpp | 1 + src/WebCfgServer.cpp | 2 +- updater/platformio.ini | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 542d1e1..09bda8e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Feel free to join us on Discord: https://discord.gg/9nPq85bP4p ## Supported devices Supported ESP32 devices: -- Nuki Hub is compiled against all ESP32 models with Wi-Fi and Bluetooh Low Energy (BLE) which are supported by ESP-IDF 5.1.4 and Arduino Core 3.0.4. +- Nuki Hub is compiled against all ESP32 models with Wi-Fi and Bluetooh Low Energy (BLE) which are supported by ESP-IDF 5.1.4 and Arduino Core 3.0.7. - Tested stable builds are provided for the ESP32, ESP32-S3 and ESP32-C3. - Untested builds are provided for the ESP32-Solo1. - Support for the ESP32-C6 and ESP32-H2 is experimental. There could be more frequent crashes than on other ESP32 devices and connections with the Nuki device could be slower than on other ESP32 devices. diff --git a/platformio.ini b/platformio.ini index a357b42..2538d4e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ default_envs = esp32 boards_dir = boards [env] -platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip +platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip platform_packages = framework = arduino, espidf board_build.embed_txtfiles = diff --git a/src/Config.h b/src/Config.h index ef6633d..ebe9ada 100644 --- a/src/Config.h +++ b/src/Config.h @@ -4,7 +4,7 @@ #define NUKI_HUB_VERSION "9.02" #define NUKI_HUB_BUILD "unknownbuildnr" -#define NUKI_HUB_DATE "2024-10-20" +#define NUKI_HUB_DATE "2024-10-28" #define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest" #define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json" @@ -110,6 +110,7 @@ #define MQTT_QOS_LEVEL 1 #define MQTT_CLEAN_SESSIONS false #define MQTT_KEEP_ALIVE 60 +#define MQTT_STACK_SIZE 12288 #define GPIO_DEBOUNCE_TIME 200 #define CHAR_BUFFER_SIZE 4096 #define NUKI_TASK_SIZE 8192 diff --git a/src/NukiNetwork.cpp b/src/NukiNetwork.cpp index dd73ca4..6d46b1a 100644 --- a/src/NukiNetwork.cpp +++ b/src/NukiNetwork.cpp @@ -206,6 +206,7 @@ bool NukiNetwork::update() #else void NukiNetwork::initialize() { + _mqtt_cfg.task.stack_size = MQTT_STACK_SIZE; _hostname = _preferences->getString(preference_hostname, ""); if(_hostname == "") diff --git a/src/WebCfgServer.cpp b/src/WebCfgServer.cpp index 43298d9..90e8e70 100644 --- a/src/WebCfgServer.cpp +++ b/src/WebCfgServer.cpp @@ -2945,7 +2945,7 @@ bool WebCfgServer::processArgs(PsychicRequest *request, String& message) { _preferences->putBytes(preference_conf_opener_advanced_acl, (byte*)(&advancedOpenerConfigAclPrefs), sizeof(advancedOpenerConfigAclPrefs)); Log->print(F("Setting changed: ")); - Log->println("ACLCONFBADVANCEDOPENER"); + Log->println("ACLCONFADVANCEDOPENER"); //configChanged = true; break; } diff --git a/updater/platformio.ini b/updater/platformio.ini index 41ca4ca..4b98f2a 100644 --- a/updater/platformio.ini +++ b/updater/platformio.ini @@ -13,7 +13,7 @@ default_envs = updater_esp32 boards_dir = ../boards [env] -platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip +platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip platform_packages = framework = arduino, espidf board_build.embed_txtfiles =