From 188efe54bbcb05bd2df1700749cdedd75fe249b6 Mon Sep 17 00:00:00 2001 From: Burkhard Kneiseler Date: Sat, 13 Apr 2024 15:13:00 +0200 Subject: [PATCH 1/3] ADD: case 'Z2M.action.ebc86fda': --- libs/Zigbee2MQTTHelper.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index d765dcf..e74d34b 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -2910,6 +2910,7 @@ private function registerVariableProfile($expose) case 'Z2M.action.815b927a': case 'Z2M.action.b918bcb2': case 'Z2M.action.555bdfc4': + case 'Z2M.action.ebc86fda': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [ ['1_single', $this->Translate('1 Single'), '', 0x00FF00], @@ -2924,6 +2925,12 @@ private function registerVariableProfile($expose) ['4_single', $this->Translate('4 Single'), '', 0x00FF00], ['4_double', $this->Translate('4 Double'), '', 0x00FF00], ['4_hold', $this->Translate('4 Hold'), '', 0x00FF00], + ['5_single', $this->Translate('5 Single'), '', 0x00FF00], + ['5_double', $this->Translate('5 Double'), '', 0x00FF00], + ['5_hold', $this->Translate('5 Hold'), '', 0x00FF00], + ['6_single', $this->Translate('6 Single'), '', 0x00FF00], + ['6_double', $this->Translate('6 Double'), '', 0x00FF00], + ['6_hold', $this->Translate('6 Hold'), '', 0x00FF00], ]); } break; From 45b5c8edb16c15ac02e215e421f18fe5b7dcb11d Mon Sep 17 00:00:00 2001 From: Burki24 Date: Fri, 3 May 2024 06:13:13 +0200 Subject: [PATCH 2/3] ADD: Z2M.effect.91c72ab5 --- Device/locale.json | 3 +++ libs/Zigbee2MQTTHelper.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Device/locale.json b/Device/locale.json index c0aba4e..366867b 100644 --- a/Device/locale.json +++ b/Device/locale.json @@ -331,6 +331,7 @@ "Gas": "Gas", "Gas Value": "Gas Wert", "Get Device Infos": "Geräteinformationen abrufen", + "Glisten": "Glitzern", "Glitz And Glam": "Glanz und Glamour", "Golden Pond": "Goldener Teich", "Golden Star": "goldener Stern", @@ -522,6 +523,7 @@ "On 2": "An 2", "On/Off": "An/Aus", "Online": "Online", + "Opal": "Opal", "Open window detected": "Offenes Fenster entdeckt", "Open Window Temperature": "Geöffnetes Fenster Temperatur", "Open Window": "Geöffnetes Fenster", @@ -687,6 +689,7 @@ "Soho": "Soho", "Soil Moisture": "Bodenfeuchtigkeit", "Success": "Erfolgreich", + "Sparkle": "Flüssiges Glühen", "Spring Blossom": "Frühlingsblüte", "Spring Lake": "Frühlingssee", "Standard": "Standard", diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index e74d34b..6b2c9a4 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -3682,15 +3682,19 @@ private function registerVariableProfile($expose) case 'Z2M.effect.efbfc77e': case 'Z2M.effect.dd503500': case 'Z2M.effect.5b9efbea': + case 'Z2M.effect.91c72ab5': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileStringEx($ProfileName, 'Menu', '', '', [ ['blink', $this->Translate('Blink'), '', 0x0000FF], + ['glisten', $this->Translate('Glisten'), '', 0x0000FF], ['breathe', $this->Translate('Breathe'), '', 0x0000FF], ['okay', $this->Translate('Okay'), '', 0x0000FF], + ['opal', $this->Translate('Opal'), '', 0x0000FF], ['channel_change', $this->Translate('Channel Change'), '', 0x0000FF], ['candle', $this->Translate('Candle'), '', 0x0000FF], ['fireplace', $this->Translate('Fireplace'), '', 0x0000FF], ['colorloop', $this->Translate('Colorloop'), '', 0x0000FF], + ['sparkle', $this->Translate('Sparkle'), '', 0x0000FF], ['sunrise', $this->Translate('Sunrise'), '', 0x0000FF], ['stop_hue_effect', $this->Translate('Stop Hue Effect'), '', 0x0000FF], ['finish_effect', $this->Translate('Finish Effect'), '', 0x0000FF], From 79ca5c95fe16eec9ac7786017812441f1636426e Mon Sep 17 00:00:00 2001 From: Burki24 Date: Fri, 3 May 2024 06:48:29 +0200 Subject: [PATCH 3/3] ADD: Aqara Smart pet feeder C1 --- Device/locale.json | 8 +++ libs/Zigbee2MQTTHelper.php | 110 +++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) diff --git a/Device/locale.json b/Device/locale.json index 366867b..a8d0e83 100644 --- a/Device/locale.json +++ b/Device/locale.json @@ -309,6 +309,9 @@ "Fan Speed": "Lüftergeschwindigkeit", "Fan State": "Lüfterstatus", "Far": "Weit", + "Feed": "Fütterung", + "Feeding Size": "Futtergröße", + "Feeding Source": "Futterquelle", "Festive Fun": "Festlicher Spaß", "Filter Age": "Filter Alter", "Fire Panic": "Feuer-Panik", @@ -544,6 +547,8 @@ "Play Pause": "Abspielen pausieren", "Police Panic": "Polizei-Panik", "Poor": "Schlecht", + "Portions Per Day": "Portionen pro Tag", + "Portion Weight": "Portionsgewicht", "Position Left": "Position Links", "Position Right": "Position Rechts", "Position": "Position", @@ -617,6 +622,7 @@ "Release 3": "Freigabe 3", "Release 4": "Freigabe 4", "Release": "Loslassen", + "Remote Control": "Fernsteuerung", "Remote Temperature": "Ferntemperatur", "Replace Filter": "Ersetze Filter", "Requested Brightness Level": "gewünschte Helligkeitsstufe", @@ -659,6 +665,7 @@ "Sensor": "Sensor", "Sensitivity": "Empfindlichkeit", "Seperated": "Getrennt", + "Serving Size": "Verteilungsgröße", "Set": "Setzen", "Set Upper Limit": "Obergrenze festlegen", "Set Bottom Limit": "Untergrenze festlegen", @@ -802,6 +809,7 @@ "Water Leak": "Wasserleck", "Wednesday": "Mittwoch", "Week Day": "Wochentag", + "Weight Per Day": "Gewicht pro Tag", "Window Detection": "Fenstererkennung", "Window Open External": "Fenster offen extern", "Window Open Feature": "Fensteröffnungsfunktion", diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index 6b2c9a4..dbab01e 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -11,6 +11,15 @@ public function RequestAction($Ident, $Value) $variableID = $this->GetIDForIdent($Ident); $variableType = IPS_GetVariable($variableID)['VariableType']; switch ($Ident) { + case 'Z2M_Feed': + $Payload['feed'] = strval($Value); + break; + case 'Z2M_ServingSize': + $Payload['serving_size'] = $Value; + break; + case 'Z2M_PortionWeight': + $Payload['portion_weight'] = $Value; + break; case 'Z2M_OccupancySensitivity': $Payload['occupancy_sensitivity'] = $Value; break; @@ -829,6 +838,36 @@ 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('feed', $Payload)) { + $this->SetValue('Z2M_Feed', $Payload['feed']); + } + if (array_key_exists('feeding_source', $Payload)) { + $this->SetValue('Z2M_FeedingSource', $Payload['feeding_source']); + } + if (array_key_exists('feeding_size', $Payload)) { + $this->SetValue('Z2M_FeedingSize', $Payload['feeding_size']); + } + if (array_key_exists('portions_per_day', $Payload)) { + $this->SetValue('Z2M_PortionsPerDay', $Payload['portions_per_day']); + } + + if (array_key_exists('weight_per_day', $Payload)) { + $this->SetValue('Z2M_WeightPerDay', $Payload['weight_per_day']); + } + if (array_key_exists('serving_size', $Payload)) { + $this->SetValue('Z2M_ServeingSize', $Payload['serving_size']); + } + if (array_key_exists('portion_weight', $Payload)) { + $this->SetValue('Z2M_PortionWeight', $Payload['portion_weight']); + } + if (array_key_exists('portions_per_day', $Payload)) { + $this->SetValue('Z2M_PortionsPerDay', $Payload['portions_per_day']); + } + + + + + if (array_key_exists('execute_if_off', $Payload)) { $this->handleStateChange('execute_if_off', 'Z2M_ExecuteIfOff', 'Execute If Off', $Payload); } @@ -2427,6 +2466,22 @@ private function registerVariableProfile($expose) $ProfileName .= '.'; $ProfileName .= dechex(crc32($tmpProfileName)); switch ($ProfileName) { + case 'Z2M.feeding_source.00000000': + if (!IPS_VariableProfileExists($ProfileName)) { + $this->RegisterProfileStringEx($ProfileName, 'Feeding Source', '', '', [ + ['schadule', $this->Translate('Schedule'), '', 0x00FF00], + ['manual', $this->Translate('Manual'), '', 0x00FF00], + ['remote', $this->Translate('Remote'), '', 0x00FF00], + ]); + } + break; + case 'Z2M.feed.00000000': + if (!IPS_VariableProfileExists($ProfileName)) { + $this->RegisterProfileStringEx($ProfileName, 'Feed', '', '', [ + ['START', $this->Translate('Start'), '', 0x00FF00], + ]); + } + break; case 'Z2M.occupancy_sensitivity.b8421401': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileStringEx($ProfileName, 'Intensity', '', '', [ @@ -4166,7 +4221,15 @@ private function registerVariableProfile($expose) $this->RegisterProfileFloat($ProfileName, 'Shuffle', '', ' ', 0, 0, 0, 2); } break; + case 'serving_size': + case 'portion_weight': + if (!IPS_VariableProfileExists($ProfileName)) { + $this->RegisterProfileInteger($ProfileName, 'Information', '', ' ' . $expose['unit'], $expose['value_min'], $expose['value_max'], 1); + } + break; case 'ac_frequency': + case 'feeding_size': + case 'weight_per_day': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileFloat($ProfileName, 'Information', '', ' ' . $expose['unit'], 0, 0, 0, 2); } @@ -4212,6 +4275,7 @@ private function registerVariableProfile($expose) case 'action_rate': case 'action_level': case 'action_transition_time': + case 'portions_per_day': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileInteger($ProfileName, 'Information', '', ' ', 0, 0, 0); } @@ -5352,6 +5416,19 @@ private function mapExposesToVariables(array $exposes) break; //binary break case 'enum': switch ($expose['property']) { + case 'feeding_source': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableString('Z2M_FeedingSource', $this->Translate('Feeding Source'), $ProfileName); + } + break; + case 'feed': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableString('Z2M_Feed', $this->Translate('Feed'), $ProfileName); + $this->EnableAction('Z2M_Feed'); + } + break; case 'occupancy_sensitivity': $ProfileName = $this->registerVariableProfile($expose); if ($ProfileName != false) { @@ -5856,6 +5933,39 @@ private function mapExposesToVariables(array $exposes) break; //enum break case 'numeric': switch ($expose['property']) { + case 'portions_per_day': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableInteger('Z2M_PortionsPerDay', $this->Translate('Portions Per Day'), $ProfileName); + } + break; + case 'weight_per_day': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableInteger('Z2M_WeightPerDay', $this->Translate('Weight Per Day'), $ProfileName); + } + break; + case 'serving_size': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableInteger('Z2M_ServingSize', $this->Translate('Serving Size'), $ProfileName); + $this->EnableAction('Z2M_ServingSize'); + } + break; + case 'portion_weight': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableInteger('Z2M_PortionWeight', $this->Translate('Portion Weight'), $ProfileName); + $this->EnableAction('Z2M_PortionWeight'); + } + break; + case 'feeding_size': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableInteger('Z2M_FeedingSize', $this->Translate('Feeding Size'), $ProfileName); + $this->EnableAction('Z2M_FeedingSize'); + } + break; case 'voc_index': $ProfileName = $this->registerVariableProfile($expose); if ($ProfileName != false) {