Skip to content

Commit

Permalink
Beta 3.60
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Dec 10, 2023
1 parent d571b58 commit 807f431
Show file tree
Hide file tree
Showing 12 changed files with 398 additions and 265 deletions.
102 changes: 102 additions & 0 deletions ClimacontrolRegulator/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,108 @@
"type": "ValidationTextBox",
"caption": "Address"
},
{
"visible": false,
"type": "ExpansionPanel",
"caption": "Schedule",
"expanded": true,
"items": [
{
"name": "enable_SCHEDULE",
"type": "CheckBox",
"caption": "Schedule",
"width": "250px"
},
{
"type": "RowLayout",
"items": [
{
"name": "ScheduleMinTemp",
"type": "NumberSpinner",
"caption": "lowest temperature",
"digits": 0,
"minimum": 5,
"maximum": 17,
"suffix": " °C",
"width": "250px"
},
{
"name": "ScheduleMaxTemp",
"type": "NumberSpinner",
"caption": "highest temperature",
"digits": 0,
"minimum": 18,
"maximum": 30,
"suffix": " °C",
"width": "250px"
},
{
"name": "ScheduleStepsTemp",
"type": "Select",
"caption": "temperature steps",
"options": [
{
"caption": "0,5 °C",
"value": 1
},
{
"caption": "1,0 °C",
"value": 2
},
{
"caption": "2 °C",
"value": 4
},
{
"caption": "3 °C",
"value": 6
},
{
"caption": "4 °C",
"value": 8
},
{
"caption": "5 °C",
"value": 10
},
{
"caption": "6 °C",
"value": 12
},
{
"caption": "7 °C",
"value": 14
},
{
"caption": "8 °C",
"value": 16
}
],
"width": "250px"
}
]
},
{
"type": "RowLayout",
"items": [
{
"name": "ScheduleMinColor",
"type": "SelectColor",
"caption": "lowest temperature color",
"allowTransparent ": false,
"width": "250px"
},
{
"name": "ScheduleMaxColor",
"type": "SelectColor",
"caption": "highest temperature color",
"allowTransparent ": false,
"width": "250px"
}
]
}
]
},
{
"type": "ExpansionPanel",
"caption": "Optional status variables",
Expand Down
33 changes: 16 additions & 17 deletions ClimacontrolRegulator/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
require_once __DIR__ . '/../libs/HMDeviceBase.php'; // HMBase Klasse

/**
* ParaInterface ist die Klasse für das IPS-Modul 'HomeMatic Paraset Interface'.
* Erweitert HMBase.
* HomeMaticClimateControlRegulator
* Erweitert HMDeviceBase. Gerät: HM-CC-TC
*
*/
class HomeMaticClimateControlRegulator extends HMDeviceBase
{
const DeviceTyp = \HMExtended\DeviceType::ClimacontrolRegulator;
const ValuesChannel = \HMExtended\Channels::Second;
const ParamChannel = \HMExtended\Channels::Second;
public const DeviceTyp = \HMExtended\DeviceType::ClimacontrolRegulator;
public const ValuesChannel = \HMExtended\Channels::Second;
public const ParamChannel = \HMExtended\Channels::Second;
/**
* Interne Funktion des SDK.
*/
Expand Down Expand Up @@ -53,12 +53,12 @@ public function RequestAction($Ident, $Value)
switch ($Ident) {
case 'SETPOINT':
$this->SetValue($Ident, $Value);
if ($Value == 4.5) {
$Value = 0;
}
if ($Value == 30.5) {
$Value = 100;
}
if ($Value == 4.5) {
$Value = 0;
}
if ($Value == 30.5) {
$Value = 100;
}
}
$Paramset = [$this->ReadPropertyString('Address') . static::ValuesChannel, $Ident];
return $this->SendRPC('setValue', $Paramset, $Value, true);
Expand All @@ -68,13 +68,13 @@ public function RequestAction($Ident, $Value)
$this->FixValueType(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][0], $Value);
switch ($Ident) {
case 'DECALCIFICATION_TIME':
$d = (new DateTime())->setTimestamp($Value);
$d = (new DateTime())->setTimestamp((int) $Value);
$CalcMin = (int) $d->format('i');
$CalcHour = (int) $d->format('H');
if ($this->PutParamSet(
[
'DECALCIFICATION_MINUTE'=>($CalcMin > 50) ? 50 : $CalcMin,
'DECALCIFICATION_HOUR'=>$CalcHour
'DECALCIFICATION_MINUTE'=> ($CalcMin > 50) ? 50 : $CalcMin,
'DECALCIFICATION_HOUR' => $CalcHour
]
)) {
$this->SetValue($Ident, $Value);
Expand All @@ -87,7 +87,7 @@ public function RequestAction($Ident, $Value)
return false;
}

$d = (new DateTime())->setTimestamp($Value);
$d = (new DateTime())->setTimestamp((int) $Value);
$CalcMin = (int) $d->format('i');
$CalcHour = (int) $d->format('H');
$d->setTime(0, 0, 0, 0);
Expand All @@ -110,7 +110,6 @@ public function RequestAction($Ident, $Value)
$this->SetValue('PARTY_END_TIME', $d->getTimestamp());
return true;
}

}
if ($this->PutParamSet([$Ident=>$Value])) {
$this->SetValue($Ident, $Value);
Expand Down Expand Up @@ -148,7 +147,7 @@ protected function SetVariable(string $Ident, $Value)
break;
default:
@$this->SetValue($Ident, $Value);
break;
break;
}
}
//################# PRIVATE
Expand Down
10 changes: 6 additions & 4 deletions HeatingGroup/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"width": "250px"
},
{
"visible": false,
"name": "enable_SCHEDULE",
"type": "CheckBox",
"caption": "Schedule",
Expand All @@ -28,24 +29,24 @@
]
},
{
"visible": false,
"type": "RowLayout",
"items": [
{
"name": "ScheduleMinTemp",
"type": "NumberSpinner",
"caption": "lowest temperature",
"digits": 1,
"digits": 0,
"minimum": 5,
"maximum": 17,
"suffix": " °C",
"width": "250px",
"onChange": "echo '1:'.$ScheduleMinTemp;"
"width": "250px"
},
{
"name": "ScheduleMaxTemp",
"type": "NumberSpinner",
"caption": "highest temperature",
"digits": 1,
"digits": 0,
"minimum": 18,
"maximum": 30,
"suffix": " °C",
Expand Down Expand Up @@ -98,6 +99,7 @@
]
},
{
"visible": false,
"type": "RowLayout",
"items": [
{
Expand Down
52 changes: 26 additions & 26 deletions HeatingGroup/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
require_once __DIR__ . '/../libs/HMDeviceBase.php'; // HMBase Klasse

/**
* ParaInterface ist die Klasse für das IPS-Modul 'HomeMatic Paraset Interface'.
* Erweitert HMBase.
* HomeMaticHeatingGroup
* Erweitert HMDeviceBase Virtuelles Gerät: HM-CC-VG-1
*/
class HomeMaticHeatingGroup extends HMDeviceBase
{
const DeviceTyp = \HMExtended\DeviceType::HeatingGroup;
const ValuesChannel = \HMExtended\Channels::First;
const ParamChannel = \HMExtended\Channels::Device;
public const DeviceTyp = \HMExtended\DeviceType::HeatingGroup;
public const ValuesChannel = \HMExtended\Channels::First;
public const ParamChannel = \HMExtended\Channels::Device;
/**
* Interne Funktion des SDK.
*/
Expand Down Expand Up @@ -73,21 +73,21 @@ public function RequestAction($Ident, $Value)
return true;
case 'CONTROL_MODE':
switch ($Value) {
case 2:
case 2:

$Start = (new DateTime())->setTimestamp($this->GetValue('PARTY_TIME_START'));
$End = (new DateTime())->setTimestamp($this->GetValue('PARTY_TIME_END'));
$Start = (new DateTime())->setTimestamp((int) $this->GetValue('PARTY_TIME_START'));
$End = (new DateTime())->setTimestamp((int) $this->GetValue('PARTY_TIME_END'));

return $this->PutValueSet(
[
'SET_POINT_MODE' => 2,
'SET_POINT_TEMPERATURE' => $this->GetValue('PARTY_SET_POINT_TEMPERATURE'),
'PARTY_TIME_START' => $Start->format('Y_m_d H:i'),
'PARTY_TIME_END' => $End->format('Y_m_d H:i')
]);
return $this->PutValueSet(
[
'SET_POINT_MODE' => 2,
'SET_POINT_TEMPERATURE' => $this->GetValue('PARTY_SET_POINT_TEMPERATURE'),
'PARTY_TIME_START' => $Start->format('Y_m_d H:i'),
'PARTY_TIME_END' => $End->format('Y_m_d H:i')
]
);
}
break;

}
return $this->PutValue($Ident, $Value);
}
Expand All @@ -96,7 +96,7 @@ public function RequestAction($Ident, $Value)
$this->FixValueType(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][0], $Value);
switch ($Ident) {
case 'DECALCIFICATION_TIME':
$d = (new DateTime())->setTimestamp($Value);
$d = (new DateTime())->setTimestamp((int) $Value);
$CalcMin = (int) $d->format('i');
$CalcHour = (int) $d->format('H');
$Value = ($CalcHour * 2) + ($CalcMin > 30 ? 1 : 0);
Expand All @@ -105,7 +105,7 @@ public function RequestAction($Ident, $Value)
return true;
}
return false;
}
}
if ($this->PutParamSet([$Ident=>$Value])) {
$this->SetValue($Ident, $Value);
return true;
Expand All @@ -128,15 +128,15 @@ protected function SetParamVariable(array $Params)
protected function SetVariable(string $Ident, $Value)
{
switch ($Ident) {
case 'PARTY_TIME_START':
case 'PARTY_TIME_END':
$d = DateTime::createFromFormat('Y_m_d H:i', $Value);
@$this->SetValue($Ident, $d->getTimestamp());
case 'PARTY_TIME_START':
case 'PARTY_TIME_END':
$d = DateTime::createFromFormat('Y_m_d H:i', $Value);
@$this->SetValue($Ident, $d->getTimestamp());
break;
default:
@$this->SetValue($Ident, $Value);
break;
}
default:
@$this->SetValue($Ident, $Value);
break;
}
}
//################# PRIVATE
}
Expand Down
10 changes: 6 additions & 4 deletions HeatingGroupHmIP/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"width": "250px"
},
{
"visible": false,
"name": "enable_SCHEDULE",
"type": "CheckBox",
"caption": "Schedule",
Expand All @@ -28,24 +29,24 @@
]
},
{
"visible": false,
"type": "RowLayout",
"items": [
{
"name": "ScheduleMinTemp",
"type": "NumberSpinner",
"caption": "lowest temperature",
"digits": 1,
"digits": 0,
"minimum": 5,
"maximum": 17,
"suffix": " °C",
"width": "250px",
"onChange": "echo '1:'.$ScheduleMinTemp;"
"width": "250px"
},
{
"name": "ScheduleMaxTemp",
"type": "NumberSpinner",
"caption": "highest temperature",
"digits": 1,
"digits": 0,
"minimum": 18,
"maximum": 30,
"suffix": " °C",
Expand Down Expand Up @@ -98,6 +99,7 @@
]
},
{
"visible": false,
"type": "RowLayout",
"items": [
{
Expand Down
Loading

0 comments on commit 807f431

Please sign in to comment.