From 8d6be1a9ef63a0a8f6ac9e1ea1c1f0899aaf1b87 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 5 Aug 2024 07:57:57 +0200 Subject: [PATCH 1/7] ADD: Permit_join_time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Nall-chan Habe mal das permit_join_time mit aufgenommen und der Aktivierung eine Laufzeit von 4:14 (wie im original) hinzugefügt, da es entsprechend der Vorgaben nicht mehr zulässig ist, das Zigbee-Netzwerk unbegrenzt geöffnet zu lassen. Die Restzeit der Öffnung wird jetzt als Variable angelegt und angezeigt. Ich hoffe, dass ist okay für Dich. --- Bridge/module.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Bridge/module.php b/Bridge/module.php index 0953650..f6de350 100644 --- a/Bridge/module.php +++ b/Bridge/module.php @@ -76,6 +76,7 @@ public function ApplyChanges() $this->EnableAction('log_level'); $this->RegisterVariableBoolean('permit_join', $this->Translate('Allow joining the network'), '~Switch'); $this->EnableAction('permit_join'); + $this->RegisterVariableInteger('permit_join_timeout', $this->Translate('Permit Join Timeout')); $this->RegisterVariableBoolean('restart_required', $this->Translate('Restart Required')); $this->RegisterVariableInteger('restart_request', $this->Translate('Perform a restart'), 'Z2M.bridge.restart'); $this->EnableAction('restart_request'); @@ -130,6 +131,9 @@ public function ReceiveData($JSONString) if (isset($Payload['permit_join'])) { $this->SetValue('permit_join', $Payload['permit_join']); } + if (isset($Payload['permit_join_timeout'])) { + $this->SetValue('permit_join_timeout', $Payload['permit_join_timeout']); + } if (isset($Payload['restart_required'])) { $this->SetValue('restart_required', $Payload['restart_required']); } @@ -239,7 +243,7 @@ public function SetLastSeen() public function SetPermitJoin(bool $PermitJoin) { $Topic = '/bridge/request/permit_join'; - $Payload = ['value'=>$PermitJoin]; + $Payload = ['value'=>$PermitJoin, 'time'=> 254]; $Result = $this->SendData($Topic, $Payload); if ($Result) { //todo check the Response return true; From ac83247bec00b0eba864b9ab81c5e362e7e47a02 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 5 Aug 2024 08:01:13 +0200 Subject: [PATCH 2/7] Update locale.json --- Bridge/locale.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Bridge/locale.json b/Bridge/locale.json index 776ef6d..104296e 100644 --- a/Bridge/locale.json +++ b/Bridge/locale.json @@ -19,7 +19,8 @@ "Wrong last_seen setting in Zigbee2MQTT. Please set last_seen to epoch.": "Falsche Einstellung für last_seen in Zigbee2MQTT. Bitte last_seen auf epoch einstellen.", "Symcon Extension in Zigbee2MQTT is outdated. Please update the extension.": "Symcon Erweiterung in Zigbee2MQTT ist veraltet. Bitte Erweiterung updaten.", "No Symcon Extension in Zigbee2MQTT installed. Please install the extension.": "Symcon Erweiterung in Zigebee2MQTT nicht installiert. Bitte die Erweiterung installieren.", - "Extension Loaded": "Erweiterung geladen" + "Extension Loaded": "Erweiterung geladen", + "Permit Join Time", "Restzeit Netzwerk geöffnet" } } -} \ No newline at end of file +} From 536e1f0d9835a6eed191d151c881ab6c9d108d4f Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 5 Aug 2024 17:56:50 +0200 Subject: [PATCH 3/7] Update locale.json --- Bridge/locale.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bridge/locale.json b/Bridge/locale.json index 104296e..21c2753 100644 --- a/Bridge/locale.json +++ b/Bridge/locale.json @@ -20,7 +20,7 @@ "Symcon Extension in Zigbee2MQTT is outdated. Please update the extension.": "Symcon Erweiterung in Zigbee2MQTT ist veraltet. Bitte Erweiterung updaten.", "No Symcon Extension in Zigbee2MQTT installed. Please install the extension.": "Symcon Erweiterung in Zigebee2MQTT nicht installiert. Bitte die Erweiterung installieren.", "Extension Loaded": "Erweiterung geladen", - "Permit Join Time", "Restzeit Netzwerk geöffnet" + "Permit Join Timeout", "Restzeit Netzwerk geöffnet" } } } From bc105500304afa125b62aabc82827e2634b06029 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 5 Aug 2024 19:49:30 +0200 Subject: [PATCH 4/7] ADD: profile "seconds" for 'permit_join_timeout' --- Bridge/module.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bridge/module.php b/Bridge/module.php index f6de350..1437d64 100644 --- a/Bridge/module.php +++ b/Bridge/module.php @@ -68,6 +68,7 @@ public function ApplyChanges() ['info', $this->Translate('Information'), '', 0x00FF00], ['debug', $this->Translate('Debug'), '', 0x00FF00], ]); + $this->RegisterProfileInteger('Z2M.seconds', '', '', ' s', 0, 0, 1, 0); $this->RegisterVariableBoolean('state', $this->Translate('State')); $this->RegisterVariableBoolean('extension_loaded', $this->Translate('Extension Loaded')); $this->RegisterVariableString('extension_version', $this->Translate('Extension Version')); @@ -76,7 +77,7 @@ public function ApplyChanges() $this->EnableAction('log_level'); $this->RegisterVariableBoolean('permit_join', $this->Translate('Allow joining the network'), '~Switch'); $this->EnableAction('permit_join'); - $this->RegisterVariableInteger('permit_join_timeout', $this->Translate('Permit Join Timeout')); + $this->RegisterVariableInteger('permit_join_timeout', $this->Translate('Permit Join Timeout'), 'Z2M.seconds'); $this->RegisterVariableBoolean('restart_required', $this->Translate('Restart Required')); $this->RegisterVariableInteger('restart_request', $this->Translate('Perform a restart'), 'Z2M.bridge.restart'); $this->EnableAction('restart_request'); From 9f1e8d57f6be5a23295575b99179a5237b31538f Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 5 Aug 2024 19:50:20 +0200 Subject: [PATCH 5/7] FIX: locale.json --- Bridge/locale.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bridge/locale.json b/Bridge/locale.json index 21c2753..f6cc431 100644 --- a/Bridge/locale.json +++ b/Bridge/locale.json @@ -20,7 +20,7 @@ "Symcon Extension in Zigbee2MQTT is outdated. Please update the extension.": "Symcon Erweiterung in Zigbee2MQTT ist veraltet. Bitte Erweiterung updaten.", "No Symcon Extension in Zigbee2MQTT installed. Please install the extension.": "Symcon Erweiterung in Zigebee2MQTT nicht installiert. Bitte die Erweiterung installieren.", "Extension Loaded": "Erweiterung geladen", - "Permit Join Timeout", "Restzeit Netzwerk geöffnet" + "Permit Join Timeout": "Restzeit Netzwerk geöffnet" } } } From 4753dc9f5ad504537249264b38dc4696a8f1f0b9 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Thu, 8 Aug 2024 06:06:48 +0200 Subject: [PATCH 6/7] ADD: Herdsman & converters Version --- Bridge/module.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Bridge/module.php b/Bridge/module.php index 1437d64..f4c72fc 100644 --- a/Bridge/module.php +++ b/Bridge/module.php @@ -82,6 +82,8 @@ public function ApplyChanges() $this->RegisterVariableInteger('restart_request', $this->Translate('Perform a restart'), 'Z2M.bridge.restart'); $this->EnableAction('restart_request'); $this->RegisterVariableString('version', $this->Translate('Version')); + $this->RegisterVariableString('zigbee_herdsman_converters', $this->Translate('Zigbee Herdsman Converters Version')); + $this->RegisterVariableString('zigbee_herdsman', $this->Translate('Zigbee Herdsman Version')); $this->RegisterVariableInteger('network_channel', $this->Translate('Network Channel')); } @@ -141,6 +143,12 @@ public function ReceiveData($JSONString) if (isset($Payload['version'])) { $this->SetValue('version', $Payload['version']); } + if (isset($Payload['zigbee_herdsman_converters']['version'])) { + $this->SetValue('zigbee_herdsman_converters', $Payload['zigbee_herdsman_converters']['version']); + } + if (isset($Payload['zigbee_herdsman']['version'])) { + $this->SetValue('zigbee_herdsman', $Payload['zigbee_herdsman']['version']); + } if (isset($Payload['config']['advanced']['last_seen'])) { $this->SendDebug('last_seen', $Payload['config']['advanced']['last_seen'], 0); $this->ConfigLastSeen = $Payload['config']['advanced']['last_seen']; From 1802a312a6356bff28de27f8b2b773533bd77ab1 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Thu, 8 Aug 2024 06:20:17 +0200 Subject: [PATCH 7/7] FIX: permit_join_timeout set to 0, if permit_join false --- Bridge/module.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Bridge/module.php b/Bridge/module.php index f4c72fc..c6ec71c 100644 --- a/Bridge/module.php +++ b/Bridge/module.php @@ -133,6 +133,9 @@ public function ReceiveData($JSONString) } if (isset($Payload['permit_join'])) { $this->SetValue('permit_join', $Payload['permit_join']); + if ($Payload['permit_join'] === false) { + $this->SetValue('permit_join_timeout', 0); + } } if (isset($Payload['permit_join_timeout'])) { $this->SetValue('permit_join_timeout', $Payload['permit_join_timeout']);