diff --git a/Device/locale.json b/Device/locale.json index c2942d14..f13f45e7 100644 --- a/Device/locale.json +++ b/Device/locale.json @@ -251,6 +251,7 @@ "Emergency": "Notfall", "Energy": "Energie", "Enrolled": "Enrolled", + "Error": "Fehler", "Excellent": "Exzellent", "External Measured Room Sensor": "Extern gemessener Raumfühler", "Externally": "Extern", @@ -332,6 +333,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", @@ -344,6 +349,7 @@ "Local Temperature": "Lokale Temperatur", "Lock 1": "Sperre 1", "Lock 2": "Sperre 2", + "Long": "Lange", "Lost": "Verloren", "Lovebirds": "Liebesvögel", "Low": "Niedrig", @@ -482,6 +488,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", @@ -492,6 +502,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", diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index 2a1d82d4..5b8e89f4 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -10,6 +10,9 @@ public function RequestAction($Ident, $Value) case 'Z2M_DeviceMode': $Payload['device_mode'] = $Value; break; + case 'Z2M_ScaleProtection': + $Payload['scale_protection'] = strval($this->OnOff($Value)); + break; case 'Z2M_LearnIRCode': $Payload['learn_ir_code'] = strval($this->OnOff($Value)); break; @@ -636,6 +639,19 @@ public function ReceiveData($JSONString) if (array_key_exists('device_mode', $Payload)) { $this->SetValue('Z2M_DeviceMode', $Payload['device_mode']); } + 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': @@ -649,6 +665,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']); } @@ -2475,11 +2494,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; @@ -2550,6 +2572,7 @@ private function registerVariableProfile($expose) ]); } break; + case 'Z2M.action.dc7fd161': case 'Z2M.action.dc7fd161': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [ @@ -2720,7 +2743,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', '', '', [ @@ -3509,6 +3546,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); @@ -4318,6 +4360,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; @@ -4935,6 +4981,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) {