Skip to content

Commit

Permalink
Merge pull request #219 from Burki24/patch-2
Browse files Browse the repository at this point in the history
ADD: Bosch-Thermostat BTH-RM fehlende Exposes
  • Loading branch information
Schnittcher authored Dec 9, 2024
2 parents 820df7f + 8addd84 commit 447deff
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions Device/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
36 changes: 36 additions & 0 deletions libs/Zigbee2MQTTHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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']);
}
Expand Down Expand Up @@ -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', '', '', [
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 447deff

Please sign in to comment.