From 554139cb37777e99fb8bae85186763a339454bb1 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 23 Oct 2023 07:09:16 +0200 Subject: [PATCH 1/9] ADD: Z2M_ScaleProtection --- libs/Zigbee2MQTTHelper.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index 0c8bccd3..1452f289 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -7,6 +7,9 @@ public function RequestAction($Ident, $Value) $variableID = $this->GetIDForIdent($Ident); $variableType = IPS_GetVariable($variableID)['VariableType']; switch ($Ident) { + case 'Z2M_ScaleProtection': + $Payload['scale_protection'] = strval($this->OnOff($Value)); + break; case 'Z2M_LearnIRCode': $Payload['learn_ir_code'] = strval($this->OnOff($Value)); break; @@ -630,6 +633,19 @@ public function ReceiveData($JSONString) $this->RegisterVariableInteger('Z2M_LastSeen', $this->Translate('Last Seen'), '~UnixTimestamp'); $this->SetValue('Z2M_LastSeen', ($Payload['last_seen'] / 1000)); } + if (array_key_exists('scale_protection', $Payload)) { + switch ($Payload['scale_protection']) { + case 'ON': + $this->SetValue('Z2M_ScaleProtection', true); + break; + case 'OFF': + $this->SetValue('Z2M_ScaleProtection', false); + break; + default: + $this->SendDebug('Z2M_ScaleProtection', 'Undefined State: ' . $Payload['scale_protection'], 0); + break; + } + } if (array_key_exists('learn_ir_code', $Payload)) { switch ($Payload['learn_ir_code']) { case 'ON': @@ -4302,6 +4318,10 @@ private function mapExposesToVariables(array $exposes) break; //Lock break case 'binary': switch ($expose['property']) { + case 'scale_protection': + $this->RegisterVariableBoolean('Z2M_ScaleProtection', $this->Translate('Scale Protection'), '~Switch'); + $this->EnableAction('Z2M_ScaleProtection'); + break; case 'charge_state': $this->RegisterVariableBoolean('Z2M_ChargeState', $this->Translate('Charge State'), 'Z2M.ChargeState'); break; From 29c7b78b08c5815682a771825b3ad2238f01d73b Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 23 Oct 2023 07:12:29 +0200 Subject: [PATCH 2/9] Update locale.json --- Device/locale.json | 1 + 1 file changed, 1 insertion(+) diff --git a/Device/locale.json b/Device/locale.json index dd193e11..fe1d7a95 100644 --- a/Device/locale.json +++ b/Device/locale.json @@ -490,6 +490,7 @@ "Runy Glow": "Flüssiges Glühen", "Saturday": "Samstag", "Savanna Sunset": "Savanna Sonnenuntergang", + "Scale Protection": "Ventil Schutz", "Scarlet Dream": "Scarlets Traum", "Scene": "Szene", "Schedule": "Geplant", From 94edf95c4ab30a4c406023658407672a0f93f1b7 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 23 Oct 2023 07:23:10 +0200 Subject: [PATCH 3/9] ADD: Z2M_TRVError belongs to: https://community.symcon.de/t/modul-zigbee2mqtt/49507/2530?u=burki24 --- libs/Zigbee2MQTTHelper.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index 0c8bccd3..94205f05 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -643,6 +643,9 @@ public function ReceiveData($JSONString) break; } } + if (array_key_exists('error', $Payload)) { + $this->SetValue('Z2M_TRVError', $Payload['error']); + } if (array_key_exists('learned_ir_code', $Payload)) { $this->SetValue('Z2M_LearnedIRCode', $Payload['learned_ir_code']); } @@ -3493,6 +3496,11 @@ private function registerVariableProfile($expose) break; case 'numeric': switch ($expose['property']) { + case 'error': + if (!IPS_VariableProfileExists($ProfileName)) { + $this->RegisterProfileInteger($ProfileName, 'Alert', '', ' ', 0, 0, 0); + } + break; case 'alarm_time': $ProfileName .= $expose['value_min'] . '_' . $expose['value_max']; $ProfileName = str_replace(',', '.', $ProfileName); @@ -4912,6 +4920,12 @@ private function mapExposesToVariables(array $exposes) break; //enum break case 'numeric': switch ($expose['property']) { + case 'error': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableInteger('Z2M_TRVError', $this->Translate('Error'), $ProfileName); + } + break; case 'alarm_time': $ProfileName = $this->registerVariableProfile($expose); if ($ProfileName != false) { From 69157d5b2ffedfea0b72ec16b8c2266ab03b06e6 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Mon, 23 Oct 2023 07:24:09 +0200 Subject: [PATCH 4/9] Update locale.json --- Device/locale.json | 1 + 1 file changed, 1 insertion(+) diff --git a/Device/locale.json b/Device/locale.json index dd193e11..221f3bc9 100644 --- a/Device/locale.json +++ b/Device/locale.json @@ -249,6 +249,7 @@ "Emergency": "Notfall", "Energy": "Energie", "Enrolled": "Enrolled", + "Error": "Fehler", "Excellent": "Exzellent", "External Measured Room Sensor": "Extern gemessener Raumfühler", "Externally": "Extern", From 0d173a73d881c876bb8253dfe152242f88a8a0b3 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Tue, 24 Oct 2023 21:44:42 +0200 Subject: [PATCH 5/9] ADD: Z2M.action.a3d14936 --- libs/Zigbee2MQTTHelper.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index 0c8bccd3..ef7ea190 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -2459,11 +2459,14 @@ private function registerVariableProfile($expose) } break; case 'Z2M.action.d9f7f4ac': + case 'Z2M.action.a3d14936': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [ ['single', $this->Translate('Single'), '', 0x00FF00], ['double', $this->Translate('Double'), '', 0x00FF00], ['hold', $this->Translate('Hold'), '', 0x00FF00], + ['long', $this->Translate('Long'), '', 0x00FF00], + ]); } break; From a438bf323db82c335d8569a8d64bb76ede5e790d Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Tue, 24 Oct 2023 21:46:28 +0200 Subject: [PATCH 6/9] Update locale.json --- Device/locale.json | 1 + 1 file changed, 1 insertion(+) diff --git a/Device/locale.json b/Device/locale.json index dd193e11..85e5e4fe 100644 --- a/Device/locale.json +++ b/Device/locale.json @@ -342,6 +342,7 @@ "Local Temperature": "Lokale Temperatur", "Lock 1": "Sperre 1", "Lock 2": "Sperre 2", + "Long": "Lange", "Lost": "Verloren", "Lovebirds": "Liebesvögel", "Low": "Niedrig", From ca9240f59f37b564d464592cefeaac48cf5ed978 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Tue, 24 Oct 2023 21:48:29 +0200 Subject: [PATCH 7/9] ADD: Z2M.action.dc7fd161 --- libs/Zigbee2MQTTHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index 0c8bccd3..921195f4 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -2534,6 +2534,7 @@ private function registerVariableProfile($expose) ]); } break; + case 'Z2M.action.dc7fd161': case 'Z2M.action.dc7fd161': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [ From 9ee3930fddd223e593c0cb544886f5c9fe49dfbb Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Tue, 24 Oct 2023 21:56:56 +0200 Subject: [PATCH 8/9] ADD: Z2M.action.e87c79ad --- libs/Zigbee2MQTTHelper.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index 0c8bccd3..836b40a3 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -2704,7 +2704,21 @@ private function registerVariableProfile($expose) ]); } break; - + case 'Z2M.action.e87c79ad': + if (!IPS_VariableProfileExists($ProfileName)) { + $this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [ + ['left_hold', $this->Translate('Left Hold'), '', 0x00FF00], + ['left_hold_release', $this->Translate('Left Hold Release'), '', 0x00FF00], + ['left_press', $this->Translate('Left Press'), '', 0x00FF00], + ['left_press_release', $this->Translate('Left Press Release'), '', 0x00FF00], + ['right_hold', $this->Translate('Right Hold'), '', 0x00FF00], + ['right_hold_release', $this->Translate('Right Hold Release'), '', 0x00FF00], + ['right_press', $this->Translate('Right Press'), '', 0x00FF00], + ['right_press_release', $this->Translate('Right Press Release'), '', 0x00FF00], + ['toggle', $this->Translate('Toggle'), '', 0x00FF00] + ]); + } + break; case 'Z2M.action.85b816e8': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [ From 5d08ba12194fec49eae83ebc4ea47ec99d1d1cf5 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Tue, 24 Oct 2023 22:03:26 +0200 Subject: [PATCH 9/9] Update locale.json --- Device/locale.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Device/locale.json b/Device/locale.json index dd193e11..683afc60 100644 --- a/Device/locale.json +++ b/Device/locale.json @@ -330,6 +330,10 @@ "LED disable night": "LED NAchtabschaltung", "LED Enable": "LED Status", "LED State": "LED-Status", + "Left Hold": "Links Halten", + "Left Hold Release": "Links Halten beendet", + "Left Press": "Links Gedrückt", + "Left Press Release": "Links Drücken beendet", "Level": "Stufe", "Lily": "Lilie", "Linkage Alarm State": "Verknüpfungsalarmzustand", @@ -480,6 +484,10 @@ "Resplendent": "Strahlend", "Restore Reports": "Restore Reports", "restore": "Wiederherstellen", + "Right Hold": "Rechts Halten", + "Right Hold Release": "Rechts Halten Beendet", + "Right Press", "Rechts Gedrückt", + "Right Press Release", "Rechts Gedrückt Beendet", "Rio": "Rio", "Rosy Sparkle": "Rosiger Glanz", "Rotate Left": "Links drehen",