diff --git a/Device/locale.json b/Device/locale.json index e31dbe32..613a0e49 100644 --- a/Device/locale.json +++ b/Device/locale.json @@ -533,6 +533,7 @@ "Occupancy Timeout": "Bewegung Timeout", "Occupancy": "Bewegung", "Occupancy Sensitivity": "Bewegungserkennungsempfindlichkeit", + "Occupied Cooling Setpoint": "Besetzter Kühlsollwert", "Occupied Heating Setpoint Scheduled": "Geplanter Heizsollwert für Belegt", "Occupied Heating Setpoint": "Besetzter Heizungssollwert", "Ocean Dawn": "Ozean-Dämmerung", diff --git a/libs/Zigbee2MQTTHelper.php b/libs/Zigbee2MQTTHelper.php index 2004fbf7..f636efbd 100644 --- a/libs/Zigbee2MQTTHelper.php +++ b/libs/Zigbee2MQTTHelper.php @@ -11,6 +11,12 @@ public function RequestAction($Ident, $Value) $variableID = $this->GetIDForIdent($Ident); $variableType = IPS_GetVariable($variableID)['VariableType']; switch ($Ident) { + case 'Z2M_OccupiedCoolingMode': + $Payload['occupied_cooling_mode'] = $Value; + break; + case 'Z2M_OperatingMode': + $payload['operating_mode'] = strval($Value); + break; case 'Z2M_OperationMode': $payload['operation_mode'] = strval($Value); break; @@ -877,6 +883,12 @@ 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('occupied_cooling_setpoint', $Payload)) { + $this->SetValue('Z2M_OccupiedCoolingSetpoint', $Payload['occupied_cooling_setpoint']); + } + if (array_key_exists('operating_mode', $Payload)) { + $this->SetValue('Z2M_OperatingMode', $Payload['operating_mode']); + } if (array_key_exists('operation_mode', $Payload)) { $this->SetValue('Z2M_OperationMode', $Payload['operation_mode']); } @@ -3753,6 +3765,15 @@ private function registerVariableProfile($expose) ]); } break; + case 'Z2M.system_mode.f25194a5': + if (!IPS_VariableProfileExists($ProfileName)) { + $this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [ + ['heat', $this->Translate('Heat'), '', 0x00FF00], + ['cool', $this->Translate('Cool'), '', 0x00FF00], + ['off', $this->Translate('Off'), '', 0x00FF00], + ]); + } + break; case 'Z2M.system_mode.ba44e6f8': if (!IPS_VariableProfileExists($ProfileName)) { $this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [ @@ -4796,6 +4817,7 @@ private function registerVariableProfile($expose) case 'remote_temperature': case 'current_heating_setpoint_auto': case 'current_heating_setpoint': + case 'occupied_cooling_setpoint': case 'occupied_heating_setpoint': case 'occupied_heating_setpoint_scheduled': $ProfileName .= $expose['value_min'] . '_' . $expose['value_max']; @@ -5312,6 +5334,13 @@ private function mapExposesToVariables(array $exposes) break; //Climate binaray break; case 'numeric': switch ($feature['property']) { + case 'occupied_cooling_setpoint': + $ProfileName = $this->registerVariableProfile($feature); + if ($ProfileName != false) { + $this->RegisterVariableFloat('Z2M_OccupiedCoolingSetpoint', $this->Translate('Occupied Cooling Setpoint'), $ProfileName); + $this->EnableAction('Z2M_OccupiedCoolingSetpoint'); + } + break; case 'current_heating_setpoint': $ProfileName = $this->registerVariableProfile($feature); if ($ProfileName != false) { @@ -5807,6 +5836,13 @@ private function mapExposesToVariables(array $exposes) break; //binary break case 'enum': switch ($expose['property']) { + case 'operating_mode': + $ProfileName = $this->registerVariableProfile($expose); + if ($ProfileName != false) { + $this->RegisterVariableString('Z2M_OperatingMode', $this->Translate('Operating Mode'), $ProfileName); + $this->EnableAction('Z2M_OperatingMode'); + } + break; case 'operation_mode': $ProfileName = $this->registerVariableProfile($expose); if ($ProfileName != false) {