From 36d0f0302d7e383356d6632d534e8020c735da6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Tr=C3=B6ger?= Date: Fri, 15 Dec 2023 19:50:53 +0100 Subject: [PATCH] no message --- ClimacontrolRegulator/form.json | 6 + ClimacontrolRegulator/locale.json | 1 + ClimacontrolRegulator/module.php | 101 +++--- ExtendedConfigurator/module.php | 5 + HeatingGroup/form.json | 119 ++----- HeatingGroup/locale.json | 38 +- HeatingGroup/module.php | 225 +++++++++--- HeatingGroupHmIP/form.json | 27 +- HeatingGroupHmIP/locale.json | 3 +- HeatingGroupHmIP/module.php | 111 +++--- Programme/locale.json | 1 + README.md | 20 ++ libs/HMDeviceBase.php | 172 +++++---- libs/HMTypes.php | 570 ++++++++++++++++++++++++------ 14 files changed, 930 insertions(+), 469 deletions(-) diff --git a/ClimacontrolRegulator/form.json b/ClimacontrolRegulator/form.json index 0f2cc18..52c1c39 100644 --- a/ClimacontrolRegulator/form.json +++ b/ClimacontrolRegulator/form.json @@ -116,6 +116,12 @@ "caption": "Holiday/Party", "expanded": true, "items": [ + { + "name": "enable_TEMPERATUR_PARTY_VALUE", + "type": "CheckBox", + "caption": "Holiday/Party set point temperature", + "width": "250px" + }, { "name": "enable_PARTY_END_TIME", "type": "CheckBox", diff --git a/ClimacontrolRegulator/locale.json b/ClimacontrolRegulator/locale.json index f516633..d58ba6b 100644 --- a/ClimacontrolRegulator/locale.json +++ b/ClimacontrolRegulator/locale.json @@ -27,6 +27,7 @@ "Open": "Geöffnet", "Lowering temperature": "Absenktemperatur", "Comfort temperature": "Komforttemperatur", + "Holiday/Party set point temperature": "Urlaub/Party Solltemperatur", "Holiday/Party end": "Urlaub/Party Ende", "Time cannot be in the past": "Zeitpunkt kann nicht in der Vergangenheit liegen", "Time too far in the future": "Zeitpunkt zu weit in der Zukunft", diff --git a/ClimacontrolRegulator/module.php b/ClimacontrolRegulator/module.php index 7a9019d..edd40e5 100644 --- a/ClimacontrolRegulator/module.php +++ b/ClimacontrolRegulator/module.php @@ -50,104 +50,105 @@ public function RequestAction($Ident, $Value) if (array_key_exists($Ident, \HMExtended\ValuesSet::$Variables[static::DeviceTyp])) { $Ident = is_string(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2] : $Ident; $this->FixValueType(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][0], $Value); + $SendValue = $Value; switch ($Ident) { - case \HMExtended\ClimacontrolRegulator\SETPOINT: - $this->SetValue($Ident, $Value); - if ($Value == 4.5) { - $Value = 0; - } - if ($Value == 30.5) { - $Value = 100; + case \HMExtended\ClimacontrolRegulator::SETPOINT: + if ($this->GetValue(\HMExtended\ClimacontrolRegulator::MODE_TEMPERATUR_REGULATOR) != 0) { + $this->PutParamSet([\HMExtended\ClimacontrolRegulator::MODE_TEMPERATUR_REGULATOR => 0], true); } + break; } - $Paramset = [$this->ReadPropertyString(\HMExtended\Device\Property::Address) . static::ValuesChannel, $Ident]; - return $this->SendRPC('setValue', $Paramset, $Value, true); + $this->PutValue($Ident, $SendValue, true); + return; } if (array_key_exists($Ident, \HMExtended\ParamSet::$Variables[static::DeviceTyp])) { $Ident = is_string(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][2]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2] : $Ident; $this->FixValueType(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][0], $Value); + $SendValue = $Value; switch ($Ident) { - case 'DECALCIFICATION_TIME': + case \HMExtended\ClimacontrolRegulator::DECALCIFICATION_TIME: // Sonderfall Entkalkung $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 - ] + \HMExtended\ClimacontrolRegulator::DECALCIFICATION_MINUTE => ($CalcMin > 50) ? 50 : $CalcMin, + \HMExtended\ClimacontrolRegulator::DECALCIFICATION_HOUR => $CalcHour + ], + true )) { $this->SetValue($Ident, $Value); - return true; } - return false; - case 'PARTY_END_TIME': + return; + case \HMExtended\ClimacontrolRegulator::PARTY_END_TIME: // Sonderfall Party Variablen if ($Value < time()) { trigger_error($this->Translate('Time cannot be in the past')); - return false; + return; } - $d = (new DateTime())->setTimestamp((int) $Value); $CalcMin = (int) $d->format('i'); $CalcHour = (int) $d->format('H'); $d->setTime(0, 0, 0, 0); $days = ((new DateTime())->setTime(0, 0, 0, 0))->diff($d); - if ($days > 200) { + if ($days->days > 200) { trigger_error($this->Translate('Time too far in the future')); - return false; + return; } - $d->setTime($CalcHour, ($CalcMin >= 30) ? 1 : 0, 0, 0); - + $d->setTime($CalcHour, ($CalcMin >= 30) ? 30 : 0, 0, 0); if ($this->PutParamSet( [ - 'MODE_TEMPERATUR_REGULATOR'=> 3, - 'PARTY_END_DAY' => $days->format('%a'), - 'PARTY_END_MINUTE' => ($CalcMin >= 30) ? 1 : 0, - 'PARTY_END_HOUR' => $CalcHour - ] + \HMExtended\ClimacontrolRegulator::MODE_TEMPERATUR_REGULATOR => 3, + \HMExtended\ClimacontrolRegulator::PARTY_END_DAY => $days->format('%a'), + \HMExtended\ClimacontrolRegulator::PARTY_END_MINUTE => ($CalcMin >= 30) ? 1 : 0, + \HMExtended\ClimacontrolRegulator::PARTY_END_HOUR => $CalcHour + ], + true )) { - $this->SetValue('MODE_TEMPERATUR_REGULATOR', 3); - $this->SetValue('PARTY_END_TIME', $d->getTimestamp()); - return true; + $this->SetValue(\HMExtended\ClimacontrolRegulator::MODE_TEMPERATUR_REGULATOR, 3); + $this->SetValue(\HMExtended\ClimacontrolRegulator::PARTY_END_TIME, $d->getTimestamp()); } + return; } - if ($this->PutParamSet([$Ident=>$Value])) { + if ($this->PutParamSet([$Ident => $SendValue], true)) { $this->SetValue($Ident, $Value); - return true; } + return; } - trigger_error('Invalid Ident.', E_USER_NOTICE); - return false; + trigger_error($this->Translate('Invalid Ident.'), E_USER_NOTICE); + return; } + protected function SetParamVariable(array $Params) { $d = new DateTime(); - $d->setTime($Params['DECALCIFICATION_HOUR'], $Params['DECALCIFICATION_MINUTE'], 0, 0); - $Params['DECALCIFICATION_TIME'] = $d->getTimestamp(); + $d->setTime( + $Params[\HMExtended\ClimacontrolRegulator::DECALCIFICATION_HOUR], + $Params[\HMExtended\ClimacontrolRegulator::DECALCIFICATION_MINUTE], + 0, + 0 + ); + $Params[\HMExtended\ClimacontrolRegulator::DECALCIFICATION_TIME] = $d->getTimestamp(); $d = new DateTime(); - $d->setTime($Params['PARTY_END_HOUR'], ($Params['PARTY_END_MINUTE'] == 0 ? 0 : 30), 0, 0); - $i = new DateInterval('P' . $Params['PARTY_END_DAY'] . 'D'); - $Params['PARTY_END_TIME'] = $d->add($i)->getTimestamp(); + $d->setTime( + $Params[\HMExtended\ClimacontrolRegulator::PARTY_END_HOUR], + ($Params[\HMExtended\ClimacontrolRegulator::PARTY_END_MINUTE] == 0 ? 0 : 30), + 0, + 0 + ); + $i = new DateInterval('P' . $Params[\HMExtended\ClimacontrolRegulator::PARTY_END_DAY] . 'D'); + $Params[\HMExtended\ClimacontrolRegulator::PARTY_END_TIME] = $d->add($i)->getTimestamp(); foreach ($Params as $Ident => $Value) { @$this->SetValue($Ident, $Value); } } + protected function SetVariable(string $Ident, $Value) { + @$this->SetValue($Ident, $Value); switch ($Ident) { - case \HMExtended\ClimacontrolRegulator\SETPOINT: - if ($Value == 0) { - $Value = 4.5; - } - if ($Value == 100) { - $Value = 30.5; - } - @$this->SetValue($Ident, $Value); + case \HMExtended\ClimacontrolRegulator::SETPOINT: IPS_RunScriptText('IPS_RequestAction(' . $this->InstanceID . ',"getParam",0);'); break; - default: - @$this->SetValue($Ident, $Value); - break; } } //################# PRIVATE diff --git a/ExtendedConfigurator/module.php b/ExtendedConfigurator/module.php index 2c6270f..8bfa85e 100644 --- a/ExtendedConfigurator/module.php +++ b/ExtendedConfigurator/module.php @@ -56,6 +56,7 @@ public function Test(string $MethodName, int $Protocol, array $Data) { return $this->SendRPC($MethodName, $Protocol, $Data); } + /** * Interne Funktion des SDK. */ @@ -188,6 +189,7 @@ protected function GetConfigParam(&$item1, $InstanceID, $ConfigParam) { $item1 = IPS_GetProperty($InstanceID, $ConfigParam); } + private function GetConfigRows(int $Protocol, string $GUID) { $CreateParams = [ @@ -231,6 +233,7 @@ private function GetConfigRows(int $Protocol, string $GUID) } return $Devices; } + private function GetDeviceData(int $Protocol, array &$Device) { $InterfaceString = \HMExtended\CCU::$Interfaces[$Protocol]; @@ -249,6 +252,7 @@ private function GetDeviceData(int $Protocol, array &$Device) $Device['name'] = $Device['type']; } } + private function GetDevices(int $Protocol, string $Type) { $Result = $this->SendRPC('listDevices', $Protocol, []); @@ -301,6 +305,7 @@ private function LoadDeviceData() } return $Values; } + private function SendRPC(string $MethodName, int $Protocol, array $Data) { if (!$this->HasActiveParent()) { diff --git a/HeatingGroup/form.json b/HeatingGroup/form.json index f45bc89..d0bc133 100644 --- a/HeatingGroup/form.json +++ b/HeatingGroup/form.json @@ -14,7 +14,7 @@ "type": "RowLayout", "items": [ { - "name": "enable_ACTIVE_PROFILE", + "name": "enable_WEEK_PROGRAM_POINTER", "type": "CheckBox", "caption": "Active profile", "width": "250px" @@ -133,15 +133,15 @@ "type": "RowLayout", "items": [ { - "name": "enable_SET_POINT_MODE", + "name": "enable_COMFORT_MODE", "type": "CheckBox", - "caption": "Target temperature mode", + "caption": "Set to comfort temperature", "width": "250px" }, { - "name": "enable_HEATING_COOLING", + "name": "enable_LOWERING_MODE", "type": "CheckBox", - "caption": "Operation mode", + "caption": "Set to lowering temperature", "width": "250px" } ] @@ -153,23 +153,6 @@ "caption": "Boost", "expanded": true, "items": [ - { - "type": "RowLayout", - "items": [ - { - "name": "enable_BOOST_MODE", - "type": "CheckBox", - "caption": "Boost", - "width": "250px" - }, - { - "name": "enable_BOOST_TIME", - "type": "CheckBox", - "caption": "Boost remaining time", - "width": "250px" - } - ] - }, { "type": "RowLayout", "items": [ @@ -195,27 +178,10 @@ "expanded": true, "items": [ { - "name": "enable_PARTY_SET_POINT_TEMPERATURE", + "name": "enable_PARTY", "type": "CheckBox", - "caption": "Holiday/Party set point temperature", + "caption": "Holiday/Party control", "width": "250px" - }, - { - "type": "RowLayout", - "items": [ - { - "name": "enable_PARTY_TIME_START", - "type": "CheckBox", - "caption": "Holiday/Party start", - "width": "250px" - }, - { - "name": "enable_PARTY_TIME_END", - "type": "CheckBox", - "caption": "Holiday/Party end", - "width": "250px" - } - ] } ] }, @@ -240,40 +206,36 @@ "width": "250px" } ] - }, + } + ] + }, + { + "type": "ExpansionPanel", + "caption": "Window", + "expanded": true, + "items": [ { "type": "RowLayout", "items": [ { - "name": "enable_TEMPERATURE_COMFORT_COOLING", + "name": "enable_TEMPERATUREFALL_WINDOW_OPEN", "type": "CheckBox", - "caption": "Comfort temperature cooling", + "caption": "Window open temperature", "width": "250px" }, { - "name": "enable_TEMPERATURE_LOWERING_COOLING", + "name": "enable_TEMPERATUREFALL_WINDOW_OPEN_TIME_PERIOD", "type": "CheckBox", - "caption": "Lowering temperature cooling", + "caption": "Window open duration", "width": "250px" } ] }, { - "type": "RowLayout", - "items": [ - { - "name": "enable_TEMPERATURE_WINDOW_OPEN", - "type": "CheckBox", - "caption": "Window open temperature", - "width": "250px" - }, - { - "name": "enable_WINDOW_STATE", - "type": "CheckBox", - "caption": "Window state", - "width": "250px" - } - ] + "name": "enable_BOOST_AFTER_WINDOW_OPEN", + "type": "CheckBox", + "caption": "Boost when window was closed", + "width": "500px" } ] }, @@ -303,48 +265,31 @@ }, { "type": "ExpansionPanel", - "caption": "Valve", + "caption": "Locks", "expanded": true, "items": [ { - "type": "RowLayout", - "items": [ - { - "name": "enable_VALVE_ADAPTION", - "type": "CheckBox", - "caption": "Valve adaption", - "width": "250px" - }, - { - "name": "enable_VALVE_STATE", - "type": "CheckBox", - "caption": "Valve state", - "width": "250px" - } - ] + "name": "enable_BUTTON_LOCK", + "type": "CheckBox", + "caption": "Button lock", + "width": "250px" }, { "type": "RowLayout", "items": [ { - "name": "enable_LEVEL", + "name": "enable_MODUS_BUTTON_LOCK", "type": "CheckBox", - "caption": "Valve opening", + "caption": "Mode locked", "width": "250px" }, { - "name": "enable_FROST_PROTECTION", + "name": "enable_GLOBAL_BUTTON_LOCK", "type": "CheckBox", - "caption": "Frost protection", + "caption": "Device lock", "width": "250px" } ] - }, - { - "name": "enable_SWITCH_POINT_OCCURED", - "type": "CheckBox", - "caption": "Switch point occurred", - "width": "250px" } ] } diff --git a/HeatingGroup/locale.json b/HeatingGroup/locale.json index 6e14a21..e38eb1b 100644 --- a/HeatingGroup/locale.json +++ b/HeatingGroup/locale.json @@ -7,41 +7,22 @@ "Schedule": "Zeitplan", "On": "An", "Off": "Aus", + "Start": "Ausführen", + "Set to comfort temperature": "Setze auf Komfort Temperatur", + "Set to lowering temperature": "Setze auf Absenktemperatur", "Active profile": "Aktives Zeitprofil", "Temperature": "Temperatur", - "Boost remaining time": "Boost Restlaufzeit", - " seconds": " Sekunden", - "Frost protection": "Frostschutz", - "Operation mode": "Betriebsmodus", - "Heat": "Heizen", - "Cool": "Kühlen", "Humidity": "Feuchtigkeit", - "Valve opening": "Ventilöffnung", + "Holiday/Party": "Urlaub/Party", + "Holiday/Party control": "Urlaub/Party Steuerung", "Holiday/Party set point temperature": "Urlaub/Party Solltemperatur", "Holiday/Party start": "Urlaub/Party Anfang", "Holiday/Party end": "Urlaub/Party Ende", "Target temperature mode": "Modus Solltemperatur", "Automatic": "Automatik", "Manually": "Manuell", - "Holiday/Party": "Urlaub/Party", "Boost": "Boost", "Setpoint temperature": "Solltemperatur", - "Switch point occurred": "Schaltpunkt erreicht", - "Valve": "Ventil", - "Valve adaption": "Ventilanpassung", - "Valve state": "Ventilzustand", - "Status unknown": "Status unbekannt", - "not installed": "nicht installiert", - "wait for adaptation": "warte auf Adaptionsfahrt", - "Adaptation in progress": "Adaptionsfahrt läuft", - "Adaptation done": "Adaptionsfahrt ausgeführt", - "Valve too tight": "Ventil schwergängig", - "Range too big": "Stellbereich zu groß", - "Range too small": "Stellbereich zu klein", - "Error position": "Notbetrieb", - "Window state": "Fensterzustand", - "Closed": "Geschlossen", - "Open": "Geöffnet", "Decalcification": "Entkalkung", "Decalcification day": "Entkalkung Wochentag", "Saturday": "Samstag", @@ -56,10 +37,15 @@ "Boost duration": "Boostdauer", "Lowering temperature": "Absenktemperatur", "Comfort temperature": "Komforttemperatur", - "Comfort temperature cooling": "Komforttemperatur kühlen", - "Lowering temperature cooling": "Absenktemperatur kühlen", + "Window": "Fenster", + "Boost when window was closed": "Boost wenn Fenster geschlossen wurde", "Window open temperature": "Fenster offen Temperatur", + "Window open duration": "Fenster offen Dauer", " minutes": " Minuten", + "Locks": "Sperren", + "Button lock": "Tastensperre", + "Device lock": "Gerätesperre", + "Mode locked": "Modus gesperrt", "This module is free for non-commercial use,\r\nDonations in support of the author are accepted here:": "Dieses Modul ist für die nicht kommerzielle Nutzung kostenlos,\r\nSchenkungen als Unterstützung für den Autor werden hier akzeptiert:" } } diff --git a/HeatingGroup/module.php b/HeatingGroup/module.php index 41de5a5..0953a16 100644 --- a/HeatingGroup/module.php +++ b/HeatingGroup/module.php @@ -49,76 +49,166 @@ public function RequestAction($Ident, $Value) if (array_key_exists($Ident, \HMExtended\ValuesSet::$Variables[static::DeviceTyp])) { $Ident = is_string(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2] : $Ident; $this->FixValueType(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][0], $Value); - switch (\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][0]) { - case VARIABLETYPE_BOOLEAN: - $Value = (bool) $Value; - break; - case VARIABLETYPE_INTEGER: - $Value = (int) $Value; - break; - case VARIABLETYPE_FLOAT: - $Value = (float) $Value; + $SendValue = $Value; + switch ($Ident) { + case \HMExtended\HeatingGroup::PARTY_START_TIME: + $d = (new DateTime())->setTimestamp((int) $Value); + $CalcMin = (int) $d->format('i'); + $CalcHour = (int) $d->format('H'); + $Time = ($CalcHour * 60) + ($CalcMin > 30 ? 30 : 0); + $d->setTime($CalcHour, ($CalcMin > 30 ? 30 : 0), 0, 0); + if ($this->PutValueSet( + [ + \HMExtended\HeatingGroup::PARTY_START_TIME => $Time, + \HMExtended\HeatingGroup::PARTY_START_DAY => (int) $d->format('j'), + \HMExtended\HeatingGroup::PARTY_START_MONTH => (int) $d->format('n'), + \HMExtended\HeatingGroup::PARTY_START_YEAR => (int) $d->format('y'), + ] + )) { + $this->SetValue($Ident, $d->getTimestamp()); + } + return; + case \HMExtended\HeatingGroup::PARTY_STOP_TIME: + $d = (new DateTime())->setTimestamp((int) $Value); + $CalcMin = (int) $d->format('i'); + $CalcHour = (int) $d->format('H'); + $Time = ($CalcHour * 60) + ($CalcMin > 30 ? 30 : 0); + $d->setTime($CalcHour, ($CalcMin > 30 ? 30 : 0), 0, 0); + if ($this->PutValueSet( + [ + \HMExtended\HeatingGroup::PARTY_STOP_TIME => $Time, + \HMExtended\HeatingGroup::PARTY_STOP_DAY => (int) $d->format('j'), + \HMExtended\HeatingGroup::PARTY_STOP_MONTH => (int) $d->format('n'), + \HMExtended\HeatingGroup::PARTY_STOP_YEAR => (int) $d->format('y'), + ] + )) { + $this->SetValue($Ident, $d->getTimestamp()); + } + return; + case \HMExtended\HeatingGroup::PARTY_TEMPERATURE: + if ($this->GetValue(\HMExtended\HeatingGroup::CONTROL_MODE) != 2) { + $start = (new DateTime())->setTimestamp((int) $this->GetValue(\HMExtended\HeatingGroup::PARTY_START_TIME)); + $StartTime = ((int) $start->format('H') * 60) + ((int) $start->format('i') > 30 ? 30 : 0); + $stop = (new DateTime())->setTimestamp((int) $this->GetValue(\HMExtended\HeatingGroup::PARTY_STOP_TIME)); + $StopTime = ((int) $stop->format('H') * 60) + ((int) $stop->format('i') > 30 ? 30 : 0); + $this->PutValueSet( + [ + \HMExtended\HeatingGroup::PARTY_START_TIME => $StartTime, + \HMExtended\HeatingGroup::PARTY_START_DAY => (int) $start->format('j'), + \HMExtended\HeatingGroup::PARTY_START_MONTH => (int) $start->format('n'), + \HMExtended\HeatingGroup::PARTY_START_YEAR => (int) $start->format('y'), + \HMExtended\HeatingGroup::PARTY_STOP_TIME => $StopTime, + \HMExtended\HeatingGroup::PARTY_STOP_DAY => (int) $stop->format('j'), + \HMExtended\HeatingGroup::PARTY_STOP_MONTH => (int) $stop->format('n'), + \HMExtended\HeatingGroup::PARTY_STOP_YEAR => (int) $stop->format('y') + ] + ); + } break; - case VARIABLETYPE_STRING: - $Value = (string) $Value; + case \HMExtended\HeatingGroup::SET_TEMPERATURE: + $Mode = $this->GetValue(\HMExtended\HeatingGroup::CONTROL_MODE); + switch ($Mode) { + case 0: + case 3: + $Ident = \HMExtended\HeatingGroup::MANU_MODE; + break; + case 2: + $Ident = \HMExtended\HeatingGroup::PARTY_TEMPERATURE; + break; + } break; - } - switch ($Ident) { - case 'PARTY_TIME_START': - case 'PARTY_TIME_END': - $this->SetValue($Ident, $Value); - return true; - case 'PARTY_SET_POINT_TEMPERATURE': - $this->SetValue($Ident, $Value); - return true; - case 'CONTROL_MODE': + case \HMExtended\HeatingGroup::CONTROL_MODE: switch ($Value) { + case 0: + $Ident = \HMExtended\HeatingGroup::AUTO_MODE; + $SendValue = true; + break; + case 1: + $Ident = \HMExtended\HeatingGroup::MANU_MODE; + $SendValue = (float) $this->GetValue(\HMExtended\HeatingGroup::SET_TEMPERATURE); + break; case 2: - - $Start = (new DateTime())->setTimestamp((int) $this->GetValue('PARTY_TIME_START')); - $End = (new DateTime())->setTimestamp((int) $this->GetValue('PARTY_TIME_END')); - - return $this->PutValueSet( + if (!$this->ReadPropertyBoolean('enable_PARTY')) { + trigger_error('Party is disabled in config.', E_USER_NOTICE); + return; + } + if ($this->GetValue(\HMExtended\HeatingGroup::CONTROL_MODE) == 2) { + return; + } + $Value = (float) $this->GetValue(\HMExtended\HeatingGroup::SET_TEMPERATURE); + $start = (new DateTime())->setTimestamp((int) $this->GetValue(\HMExtended\HeatingGroup::PARTY_START_TIME)); + $StartTime = ((int) $start->format('H') * 60) + ((int) $start->format('i') > 30 ? 30 : 0); + $stop = (new DateTime())->setTimestamp((int) $this->GetValue(\HMExtended\HeatingGroup::PARTY_STOP_TIME)); + $StopTime = ((int) $stop->format('H') * 60) + ((int) $stop->format('i') > 30 ? 30 : 0); + $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') + \HMExtended\HeatingGroup::PARTY_START_TIME => $StartTime, + \HMExtended\HeatingGroup::PARTY_START_DAY => (int) $start->format('j'), + \HMExtended\HeatingGroup::PARTY_START_MONTH => (int) $start->format('n'), + \HMExtended\HeatingGroup::PARTY_START_YEAR => (int) $start->format('y'), + \HMExtended\HeatingGroup::PARTY_STOP_TIME => $StopTime, + \HMExtended\HeatingGroup::PARTY_STOP_DAY => (int) $stop->format('j'), + \HMExtended\HeatingGroup::PARTY_STOP_MONTH => (int) $stop->format('n'), + \HMExtended\HeatingGroup::PARTY_STOP_YEAR => (int) $stop->format('y'), + \HMExtended\HeatingGroup::PARTY_TEMPERATURE => $Value ] ); + return; + case 3: + $Ident = \HMExtended\HeatingGroup::BOOST_MODE; + $SendValue = true; + break; } break; + case \HMExtended\HeatingGroup::COMFORT_MODE: + case \HMExtended\HeatingGroup::LOWERING_MODE: + $SendValue = true; + break; } - return $this->PutValue($Ident, $Value); + $this->PutValue($Ident, $SendValue); + return; } if (array_key_exists($Ident, \HMExtended\ParamSet::$Variables[static::DeviceTyp])) { $Ident = is_string(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][2]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2] : $Ident; $this->FixValueType(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][0], $Value); + $SendValue = $Value; switch ($Ident) { - case 'DECALCIFICATION_TIME': + case \HMExtended\HeatingGroup::DECALCIFICATION_TIME: $d = (new DateTime())->setTimestamp((int) $Value); $CalcMin = (int) $d->format('i'); $CalcHour = (int) $d->format('H'); - $Value = ($CalcHour * 2) + ($CalcMin > 30 ? 1 : 0); - if ($this->PutParamSet([$Ident=>(int) $Value])) { - $this->SetValue($Ident, $Value); - return true; - } - return false; + $SendValue = ($CalcHour * 60) + ($CalcMin > 30 ? 30 : 0); + $Value = ($d->setTime($CalcHour, ($CalcMin > 30 ? 30 : 0), 0, 0))->getTimestamp(); + break; + case \HMExtended\HeatingGroup::BOOST_TIME_PERIOD: + $SendValue = intdiv((int) $Value, 5); + break; + case \HMExtended\HeatingGroup::WEEK_PROGRAM_POINTER: + $SendValue--; + break; } - if ($this->PutParamSet([$Ident=>$Value])) { + if ($this->PutParamSet([$Ident=>$SendValue], true)) { $this->SetValue($Ident, $Value); - return true; } + return; } - trigger_error('Invalid Ident.', E_USER_NOTICE); - return false; + trigger_error($this->Translate('Invalid Ident.') . ' (' . $Ident . ')', E_USER_NOTICE); + return; } + protected function SetParamVariable(array $Params) { $d = new DateTime(); - $d->setTime(intdiv($Params['DECALCIFICATION_TIME'], 2), ($Params['DECALCIFICATION_TIME'] % 2) == 1 ? 30 : 0, 0, 0); - $Params['DECALCIFICATION_TIME'] = $d->getTimestamp(); + $d->setTime( + intdiv($Params[\HMExtended\HeatingGroup::DECALCIFICATION_TIME], 60), + ($Params[\HMExtended\HeatingGroup::DECALCIFICATION_TIME] % 60), + 0, + 0 + ); + $Params[\HMExtended\HeatingGroup::DECALCIFICATION_TIME] = $d->getTimestamp(); + $Params[\HMExtended\HeatingGroup::BOOST_TIME_PERIOD] = + $Params[\HMExtended\HeatingGroup::BOOST_TIME_PERIOD] * 5; + $Params[\HMExtended\HeatingGroup::WEEK_PROGRAM_POINTER]++; foreach ($Params as $Ident => $Value) { @$this->SetValue($Ident, $Value); @@ -127,16 +217,49 @@ protected function SetParamVariable(array $Params) protected function SetVariable(string $Ident, $Value) { + if ($this->ReadPropertyBoolean('enable_PARTY')) { + switch ($Ident) { + case \HMExtended\HeatingGroup::PARTY_START_DAY: + case \HMExtended\HeatingGroup::PARTY_STOP_DAY: + $Ident = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2]; + $d = (new DateTime())->setTimestamp((int) $this->GetValue($Ident)); + $d->setDate((int) $d->format('Y'), (int) $d->format('n'), $Value); + $Value = $d->getTimestamp(); + break; + case \HMExtended\HeatingGroup::PARTY_START_MONTH: + case \HMExtended\HeatingGroup::PARTY_STOP_MONTH: + $Ident = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2]; + $d = (new DateTime())->setTimestamp((int) $this->GetValue($Ident)); + $d->setDate((int) $d->format('Y'), $Value, (int) $d->format('j')); + $Value = $d->getTimestamp(); + break; + case \HMExtended\HeatingGroup::PARTY_START_YEAR: + case \HMExtended\HeatingGroup::PARTY_STOP_YEAR: + $Ident = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2]; + $d = (new DateTime())->setTimestamp((int) $this->GetValue($Ident)); + $d->setDate(2000 + $Value, (int) $d->format('n'), (int) $d->format('j')); + $Value = $d->getTimestamp(); + if ($Value < 946767600) { + $d = new DateTime(); + $d->setTime((int) $d->format('H'), ((int) $d->format('i') > 30 ? 30 : 0), 0, 0); + $Value = $d->getTimestamp(); + } + break; + case \HMExtended\HeatingGroup::PARTY_START_TIME: + case \HMExtended\HeatingGroup::PARTY_STOP_TIME: + $d = (new DateTime())->setTimestamp((int) $this->GetValue($Ident)); + $d->setTime(intdiv($Value, 60), ($Value % 60), 0, 0); + $Value = $d->getTimestamp(); + break; + } + } switch ($Ident) { - 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); + case \HMExtended\HeatingGroup::COMFORT_MODE: + case \HMExtended\HeatingGroup::LOWERING_MODE: + $Value = 0; break; } + @$this->SetValue($Ident, $Value); } //################# PRIVATE } diff --git a/HeatingGroupHmIP/form.json b/HeatingGroupHmIP/form.json index 0daab0b..0b354cb 100644 --- a/HeatingGroupHmIP/form.json +++ b/HeatingGroupHmIP/form.json @@ -132,12 +132,6 @@ { "type": "RowLayout", "items": [ - { - "name": "enable_SET_POINT_MODE", - "type": "CheckBox", - "caption": "Target temperature mode", - "width": "250px" - }, { "name": "enable_HEATING_COOLING", "type": "CheckBox", @@ -195,27 +189,10 @@ "expanded": true, "items": [ { - "name": "enable_PARTY_SET_POINT_TEMPERATURE", + "name": "enable_PARTY", "type": "CheckBox", - "caption": "Holiday/Party set point temperature", + "caption": "Holiday/Party control", "width": "250px" - }, - { - "type": "RowLayout", - "items": [ - { - "name": "enable_PARTY_TIME_START", - "type": "CheckBox", - "caption": "Holiday/Party start", - "width": "250px" - }, - { - "name": "enable_PARTY_TIME_END", - "type": "CheckBox", - "caption": "Holiday/Party end", - "width": "250px" - } - ] } ] }, diff --git a/HeatingGroupHmIP/locale.json b/HeatingGroupHmIP/locale.json index 6e14a21..2d4d5db 100644 --- a/HeatingGroupHmIP/locale.json +++ b/HeatingGroupHmIP/locale.json @@ -17,13 +17,14 @@ "Cool": "Kühlen", "Humidity": "Feuchtigkeit", "Valve opening": "Ventilöffnung", + "Holiday/Party": "Urlaub/Party", + "Holiday/Party control": "Urlaub/Party Steuerung", "Holiday/Party set point temperature": "Urlaub/Party Solltemperatur", "Holiday/Party start": "Urlaub/Party Anfang", "Holiday/Party end": "Urlaub/Party Ende", "Target temperature mode": "Modus Solltemperatur", "Automatic": "Automatik", "Manually": "Manuell", - "Holiday/Party": "Urlaub/Party", "Boost": "Boost", "Setpoint temperature": "Solltemperatur", "Switch point occurred": "Schaltpunkt erreicht", diff --git a/HeatingGroupHmIP/module.php b/HeatingGroupHmIP/module.php index 845aa95..c225b1d 100644 --- a/HeatingGroupHmIP/module.php +++ b/HeatingGroupHmIP/module.php @@ -49,77 +49,85 @@ public function RequestAction($Ident, $Value) if (array_key_exists($Ident, \HMExtended\ValuesSet::$Variables[static::DeviceTyp])) { $Ident = is_string(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2] : $Ident; $this->FixValueType(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][0], $Value); - switch (\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][0]) { - case VARIABLETYPE_BOOLEAN: - $Value = (bool) $Value; - break; - case VARIABLETYPE_INTEGER: - $Value = (int) $Value; + $SendValue = $Value; + switch ($Ident) { // Sonderfall Party Variablen + case \HMExtended\HeatingGroupHmIP::PARTY_TIME_START: + case \HMExtended\HeatingGroupHmIP::PARTY_TIME_END: + $Time = (new DateTime())->setTimestamp((int) $Value); + $SendValue = $Time->format('Y_m_d H:i'); break; - case VARIABLETYPE_FLOAT: - $Value = (float) $Value; + case \HMExtended\HeatingGroupHmIP::PARTY_SET_POINT_TEMPERATURE: + if ($this->GetValue(\HMExtended\HeatingGroupHmIP::SET_POINT_MODE) == 2) { + $Ident = \HMExtended\HeatingGroupHmIP::SET_POINT_TEMPERATURE; + } else { + $Start = (new DateTime())->setTimestamp((int) $this->GetValue(\HMExtended\HeatingGroupHmIP::PARTY_TIME_START)); + $End = (new DateTime())->setTimestamp((int) $this->GetValue(\HMExtended\HeatingGroupHmIP::PARTY_TIME_END)); + $this->PutValueSet( + [ + \HMExtended\HeatingGroupHmIP::PARTY_TIME_START => $Start->format('Y_m_d H:i'), + \HMExtended\HeatingGroupHmIP::PARTY_TIME_END => $End->format('Y_m_d H:i') + ] + ); + $Ident = \HMExtended\HeatingGroupHmIP::SET_POINT_TEMPERATURE; + } break; - case VARIABLETYPE_STRING: - $Value = (string) $Value; + case \HMExtended\HeatingGroupHmIP::SET_POINT_TEMPERATURE: + if ($this->GetValue(\HMExtended\HeatingGroupHmIP::SET_POINT_MODE) == 0) { + $this->PutValue(\HMExtended\HeatingGroupHmIP::CONTROL_MODE, 1); + } break; - } - switch ($Ident) { // Sonderfall Party Variablen - case 'PARTY_TIME_START': - case 'PARTY_TIME_END': - $this->SetValue($Ident, $Value); - return; - case 'PARTY_SET_POINT_TEMPERATURE': - $this->SetValue($Ident, $Value); - return; - case 'CONTROL_MODE': - switch ($Value) { // Sonderfall Mode Party - case 2: - - $Start = (new DateTime())->setTimestamp((int) $this->GetValue('PARTY_TIME_START')); - $End = (new DateTime())->setTimestamp((int) $this->GetValue('PARTY_TIME_END')); - - return $this->PutValueSet( + case \HMExtended\HeatingGroupHmIP::CONTROL_MODE: + switch ($Value) { + case 2: // Sonderfall Mode Party + if (!$this->ReadPropertyBoolean('enable_PARTY')) { + trigger_error('Party is disabled in config.', E_USER_NOTICE); + return; + } + $Start = (new DateTime())->setTimestamp((int) $this->GetValue(\HMExtended\HeatingGroupHmIP::PARTY_TIME_START)); + $End = (new DateTime())->setTimestamp((int) $this->GetValue(\HMExtended\HeatingGroupHmIP::PARTY_TIME_END)); + $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') + \HMExtended\HeatingGroupHmIP::PARTY_TIME_START => $Start->format('Y_m_d H:i'), + \HMExtended\HeatingGroupHmIP::PARTY_TIME_END => $End->format('Y_m_d H:i') ] ); + break; } - break; } - $this->PutValue($Ident, $Value); + $this->PutValue($Ident, $SendValue); return; } if (array_key_exists($Ident, \HMExtended\ParamSet::$Variables[static::DeviceTyp])) { $Ident = is_string(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][2]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2] : $Ident; $this->FixValueType(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][0], $Value); - switch ($Ident) { - case 'DECALCIFICATION_TIME': + $SendValue = $Value; + switch ($Ident) { // Sonderfall Entkalkung + case \HMExtended\HeatingGroupHmIP::DECALCIFICATION_TIME: $d = (new DateTime())->setTimestamp((int) $Value); $CalcMin = (int) $d->format('i'); $CalcHour = (int) $d->format('H'); - $Value = ($CalcHour * 2) + ($CalcMin > 30 ? 1 : 0); - if ($this->PutParamSet([$Ident=>(int) $Value])) { - $this->SetValue($Ident, $Value); - } - return; + $SendValue = ($CalcHour * 2) + ($CalcMin > 30 ? 1 : 0); + break; } - if ($this->PutParamSet([$Ident=>$Value])) { + if ($this->PutParamSet([$Ident=>$SendValue])) { $this->SetValue($Ident, $Value); - return; } return; } - trigger_error('Invalid Ident.', E_USER_NOTICE); + trigger_error($this->Translate('Invalid Ident.'), E_USER_NOTICE); return; } + protected function SetParamVariable(array $Params) { $d = new DateTime(); - $d->setTime(intdiv($Params['DECALCIFICATION_TIME'], 2), ($Params['DECALCIFICATION_TIME'] % 2) == 1 ? 30 : 0, 0, 0); - $Params['DECALCIFICATION_TIME'] = $d->getTimestamp(); + $d->setTime( + intdiv($Params[\HMExtended\HeatingGroupHmIP::DECALCIFICATION_TIME], 2), + (($Params[\HMExtended\HeatingGroupHmIP::DECALCIFICATION_TIME] % 2) == 1 ? 30 : 0), + 0, + 0 + ); + $Params[\HMExtended\HeatingGroupHmIP::DECALCIFICATION_TIME] = $d->getTimestamp(); foreach ($Params as $Ident => $Value) { @$this->SetValue($Ident, $Value); @@ -129,10 +137,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 \HMExtended\HeatingGroupHmIP::PARTY_TIME_START: + case \HMExtended\HeatingGroupHmIP::PARTY_TIME_END: + if ($Value == '1999_11_30 00:00') { + $TimeStamp = time(); + } else { + $d = DateTime::createFromFormat('Y_m_d H:i', $Value); + $TimeStamp = ($d->getTimestamp() < 7200) ? time() : $d->getTimestamp(); + } + @$this->SetValue($Ident, $TimeStamp); break; default: @$this->SetValue($Ident, $Value); diff --git a/Programme/locale.json b/Programme/locale.json index 98a9dda..1a7a114 100644 --- a/Programme/locale.json +++ b/Programme/locale.json @@ -2,6 +2,7 @@ "translations": { "de": { "read CCU": "CCU auslesen", + "Start": "Ausführen", "Instance has no active parent instance!": "Keine aktive Parent Instanz!", "Error on read all CCU-Programs.": "Fehler beim lesen aller CCU-Programme.", "CCU-Program %s not found!'": "CCU-Programm %s nicht gefunden!", diff --git a/README.md b/README.md index 010ecbb..cdac1c5 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,26 @@ Erweitert IPS um die native Unterstützung von: ### 2. Changelog +Version 3.60: + +**Profile vor dem Update löschen:** +* Heating.Control.Profile.HmIP +* Heating.Control.SetPoint.Mode.HM + +Fixes für die ClimacontrolRegulator: +* Prüfung der maximalen Anzahl von Tagen für den Party/Urlaub Modus war defekt. +* Veränderungen der Solltemperatur setzen den Modus auf Manuell. + +Fixes für die HeatingGroupHmIP: +* Modus Solltemperatur ist nicht mehr optional. +* Veränderungen der Solltemperatur während des Modus Automatik setzen den Modus auf Manuell. +* Veränderungen der Solltemperatur während des Modus Party/Urlaub sind möglich. +* Alle Party/Urlaub Einstellungen als eine Konfig-Einstellung zusammengefasst. +* Sind die Start und Endwerte von Party/Urlaub nicht gesetzt, wird initial die aktuelle Zeit übernommen. + +HeatingGroup: +* Instanz funktional hinzugefügt. + Version 3.50: * Neu: HomeMatic Paraset Interface Instanz zum lesen und schreiben von Parametern von Geräten. diff --git a/libs/HMDeviceBase.php b/libs/HMDeviceBase.php index 955d8af..b19e79a 100644 --- a/libs/HMDeviceBase.php +++ b/libs/HMDeviceBase.php @@ -30,22 +30,17 @@ abstract class HMDeviceBase extends HMBase 'ENUM' => VARIABLETYPE_INTEGER, 'FLOAT' => VARIABLETYPE_FLOAT, 'STRING' => VARIABLETYPE_STRING, + 'ACTION' => \HMExtended\Variables::VARIABLETYPE_NONE, ]; + /** * Interne Funktion des SDK. */ public function Create() { parent::Create(); - foreach (\HMExtended\ValuesSet::$Variables[static::DeviceTyp] as $Ident => $VarData) { - if (isset($VarData[4])) { - $this->RegisterPropertyBoolean('enable_' . $Ident, $VarData[4]); - } - } - foreach (\HMExtended\ParamSet::$Variables[static::DeviceTyp] as $Ident => $VarData) { - if (isset($VarData[4])) { - $this->RegisterPropertyBoolean('enable_' . $Ident, $VarData[4]); - } + foreach (\HMExtended\Property::$Properties[static::DeviceTyp] as $Property => $Value) { + $this->RegisterPropertyBoolean('enable_' . $Property, $Value); } $this->RegisterPropertyBoolean('enable_SCHEDULE', false); $this->RegisterPropertyFloat('ScheduleMinTemp', 5); @@ -69,6 +64,7 @@ public function Create() ]; $this->RegisterAttributeString('ScheduleColors', json_encode($ScheduleTemps)); } + /** * Interne Funktion des SDK. */ @@ -89,18 +85,20 @@ public function ApplyChanges() { parent::ApplyChanges(); $Address = $this->ReadPropertyString(\HMExtended\Device\Property::Address); - $this->SetReceiveDataFilter($Address == '' ? '.*9999999999.*' : '.*"DeviceID":"' . $Address . '.*'); + $this->SetReceiveDataFilter($Address == '' ? '.*9999999999.*' : '.*"DeviceID":"' . $Address . static::ValuesChannel . '.*'); foreach (\HMExtended\ValuesSet::$Variables[static::DeviceTyp] as $Ident => $VarData) { - if (isset($VarData[4])) { - if (!$this->ReadPropertyBoolean('enable_' . $Ident)) { + $Property = isset($VarData[4]) ? $VarData[4] : $Ident; + if (array_key_exists($Property, \HMExtended\Property::$Properties[static::DeviceTyp])) { + if (!$this->ReadPropertyBoolean('enable_' . $Property)) { $this->UnregisterVariable($Ident); } } } - foreach (\HMExtended\ParamSet::$Variables[static::DeviceTyp] as $Ident => $VarData) { - if (isset($VarData[4])) { - if (!$this->ReadPropertyBoolean('enable_' . $Ident)) { + foreach (\HMExtended\ParamSet::$Variables[static::DeviceTyp] as $Ident => $ParaData) { + $Property = isset($ParaData[4]) ? $ParaData[4] : $Ident; + if (array_key_exists($Property, \HMExtended\Property::$Properties[static::DeviceTyp])) { + if (!$this->ReadPropertyBoolean('enable_' . $Property)) { $this->UnregisterVariable($Ident); } } @@ -110,14 +108,13 @@ public function ApplyChanges() if (IPS_GetKernelRunlevel() != KR_READY) { return; } - if ($Address != '') { + if (($Address != '') && ($this->HasActiveParent())) { $this->createVariablesFromValues(); $this->getValuesAndSetVariable(); $this->createVariablesFromParams(); $this->getParamsAndSetVariable(); } } - /* public function ReadParamset(string $Paramset) { @@ -167,6 +164,7 @@ public function WriteParamset(string $Paramset) /** * Interne Funktion des SDK. */ + /** * Interne Funktion des SDK. */ @@ -180,27 +178,40 @@ public function RequestAction($Ident, $Value) $this->getParamsAndSetVariable(); return true; } - - if (isset(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][4])) { - if (!$this->ReadPropertyBoolean('enable_' . $Ident)) { - trigger_error('Variable is disabled in config.', E_USER_NOTICE); - return true; - } + $Property = $Ident; + if (array_key_exists($Ident, \HMExtended\ValuesSet::$Variables[static::DeviceTyp])) { + $Property = isset(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][4]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][4] : $Ident; + } + if (array_key_exists($Ident, \HMExtended\ParamSet::$Variables[static::DeviceTyp])) { + $Property = isset(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][4]) ? \HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][4] : $Ident; } - if (isset(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][4])) { - if (!$this->ReadPropertyBoolean('enable_' . $Ident)) { - trigger_error('Parameter is disabled in config.', E_USER_NOTICE); + if (array_key_exists($Property, \HMExtended\Property::$Properties[static::DeviceTyp])) { + if (!$this->ReadPropertyBoolean('enable_' . $Property)) { + trigger_error('Variable is disabled in config.', E_USER_NOTICE); return true; } } return false; } + public function ReceiveData($JSONString) { $Event = json_decode($JSONString, true); $this->SendDebug('EVENT:' . $Event['VariableName'], $Event['VariableValue'], 0); $this->SetVariable($Event['VariableName'], $Event['VariableValue']); } + /** + * Wird ausgeführt wenn sich der Status vom Parent ändert. + */ + protected function IOChangeState($State) + { + if ($State == IS_ACTIVE) { + if (($this->ReadPropertyString(\HMExtended\Device\Property::Address) != '') && ($this->HasActiveParent())) { + $this->getValuesAndSetVariable(); + $this->getParamsAndSetVariable(); + } + } + } //################# PUBLIC @@ -209,41 +220,45 @@ protected function createVariablesFromValues() $AddressWithChannel = $this->ReadPropertyString(\HMExtended\Device\Property::Address) . static::ValuesChannel; $Result = $this->getParamsetDescription('VALUES', $AddressWithChannel); foreach ($Result as $Variable) { - if ($Variable['OPERATIONS'] & 0b101) { - $Ident = $Variable['ID']; - $VarType = self::$VariableTypes[$Variable['TYPE']]; - $Profile = ''; - $Name = $Variable['ID']; - $Action = ''; - if (array_key_exists($Ident, \HMExtended\ValuesSet::$Variables[static::DeviceTyp])) { - if (isset(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][4])) { - if (!$this->ReadPropertyBoolean('enable_' . $Ident)) { - continue; - } - } - $VarType = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][0]; - if ($VarType == \HMExtended\Variables::VARIABLETYPE_NONE) { - continue; - } - $Profile = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][1]; - $Action = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2]; - if (isset(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][3])) { - $Name = $this->Translate(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][3]); - } - $this->CreateProfile($Profile); + //if ($Variable['OPERATIONS'] & 0b101) { + $Ident = $Variable['ID']; + //$VarType = self::$VariableTypes[$Variable['TYPE']]; + //$Profile = ''; + $Name = $Variable['ID']; + $Action = ''; + if (!array_key_exists($Ident, \HMExtended\ValuesSet::$Variables[static::DeviceTyp])) { + continue; + } + $Property = isset(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][4]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][4] : $Ident; + if (array_key_exists($Property, \HMExtended\Property::$Properties[static::DeviceTyp])) { + if (!$this->ReadPropertyBoolean('enable_' . $Property)) { + continue; } + } + $VarType = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][0]; + if ($VarType == \HMExtended\Variables::VARIABLETYPE_NONE) { + continue; + } + $Profile = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][1]; + $Action = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2]; + if (isset(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][3])) { + $Name = $this->Translate(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][3]); + } + $this->CreateProfile($Profile); + //} - $this->MaintainVariable($Ident, $Name, $VarType, $Profile, 0, true); - if ($Action === '') { - if ($Variable['OPERATIONS'] & 0b10) { - $this->EnableAction($Ident); - } - } elseif ($Action) { + $this->MaintainVariable($Ident, $Name, $VarType, $Profile, 0, true); + if ($Action === '') { + if ($Variable['OPERATIONS'] & 0b10) { $this->EnableAction($Ident); } + } elseif ($Action) { + $this->EnableAction($Ident); } + //} } } + protected function getValuesAndSetVariable() { $AddressWithChannel = $this->ReadPropertyString(\HMExtended\Device\Property::Address) . static::ValuesChannel; @@ -252,6 +267,7 @@ protected function getValuesAndSetVariable() $this->SetVariable($Ident, $Value); } } + protected function createVariablesFromParams() { $AddressWithChannel = $this->ReadPropertyString(\HMExtended\Device\Property::Address) . static::ParamChannel; @@ -275,8 +291,10 @@ protected function createVariablesFromParams() } $VarType = \HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][0]; } - if (isset(\HMExtended\ParamSet::$Variables[static::DeviceTyp][$Ident][4])) { - if (!$this->ReadPropertyBoolean('enable_' . $Ident)) { + + $Property = isset(\HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][4]) ? \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][4] : $Ident; + if (array_key_exists($Property, \HMExtended\Property::$Properties[static::DeviceTyp])) { + if (!$this->ReadPropertyBoolean('enable_' . $Property)) { continue; } } @@ -304,7 +322,9 @@ protected function getParamsAndSetVariable() $AddressWithChannel = $this->ReadPropertyString(\HMExtended\Device\Property::Address) . static::ParamChannel; $Result = $this->getParamset('MASTER', $AddressWithChannel); $this->SendDebug(__FUNCTION__, $Result, 0); - $this->SetParamVariable($Result); + if (count($Result) != 0) { + $this->SetParamVariable($Result); + } } protected function CreateProfile($Profile) @@ -397,6 +417,7 @@ protected function CreateWeekPlan(bool $Active) } return $Event; } + //################# PRIVATE protected function FixValueType($VarType, &$Value) { @@ -415,44 +436,40 @@ protected function FixValueType($VarType, &$Value) break; } } - /** - * Liest alle Parameter des Devices aus. - * - * @return array Ein Array mit den Daten des Interface. - */ + protected function GetParamset(string $Paramset, string $AddressWithChannel) { - return $this->SendRPC('getParamset', [$AddressWithChannel, $Paramset]); + $Result = $this->SendRPC('getParamset', [$AddressWithChannel, $Paramset]); + return is_array($Result) ? $Result : []; } - /** - * Liest alle Parameter des Devices aus. - * - * @return array Ein Array mit den Daten des Interface. - */ protected function GetParamsetDescription(string $Paramset, string $AddressWithChannel) { - return $this->SendRPC('getParamsetDescription', [$AddressWithChannel, $Paramset]); + $Result = $this->SendRPC('getParamsetDescription', [$AddressWithChannel, $Paramset]); + return is_array($Result) ? $Result : []; } - protected function PutParamSet(array $Parameter) + protected function PutParamSet(array $Parameter, bool $EmulateStatus = false) { $Paramset = [$this->ReadPropertyString(\HMExtended\Device\Property::Address) . static::ParamChannel, 'MASTER']; - $Result = $this->SendRPC('putParamset', $Paramset, $Parameter, $this->ReadPropertyBoolean(\HMExtended\Device\Property::EmulateStatus)); + $Result = $this->SendRPC('putParamset', $Paramset, $Parameter, $EmulateStatus); return ($Result) ? true : false; } - protected function PutValueSet($Value) + protected function PutValueSet($Value, bool $EmulateStatus = false) { $Paramset = [$this->ReadPropertyString(\HMExtended\Device\Property::Address) . static::ValuesChannel, 'VALUES']; - $Result = $this->SendRPC('putParamset', $Paramset, $Value, $this->ReadPropertyBoolean(\HMExtended\Device\Property::EmulateStatus)); + $Result = $this->SendRPC('putParamset', $Paramset, $Value, $EmulateStatus); return ($Result) ? true : false; } - protected function PutValue(string $ValueName, $Value) + protected function PutValue(string $ValueName, $Value, bool $EmulateStatus = false) { $Paramset = [$this->ReadPropertyString(\HMExtended\Device\Property::Address) . static::ValuesChannel, $ValueName]; - $Result = $this->SendRPC('setValue', $Paramset, $Value, $this->ReadPropertyBoolean(\HMExtended\Device\Property::EmulateStatus)); + $Result = $this->SendRPC('setValue', $Paramset, $Value, $EmulateStatus); + if ($Result && $EmulateStatus) { + $this->SetVariable($ValueName, $Value); + } return ($Result) ? true : false; } @@ -466,7 +483,7 @@ protected function SendRPC(string $MethodName, array $Paramset, $Data = null, bo 'DataID' => \HMExtended\GUID::SendRpcToIO, 'Protocol' => $this->ReadPropertyInteger(\HMExtended\Device\Property::Protocol), 'MethodName' => $MethodName, - 'WaitTime' => ($EmulateStatus ? 1 : 5000), + 'WaitTime' => ($EmulateStatus ? 1 : (int) IPS_GetProperty($this->ParentID, 'WaitTimeDevice')), 'Data' => $Paramset ]; if (is_array($Data)) { @@ -475,7 +492,6 @@ protected function SendRPC(string $MethodName, array $Paramset, $Data = null, bo $ParentData['Data'][] = $Data; } $this->SendDebug('Send', $ParentData, 0); - $ResultJSON = @$this->SendDataToParent(json_encode($ParentData, JSON_PRESERVE_ZERO_FRACTION)); if ($EmulateStatus) { return true; @@ -493,6 +509,7 @@ protected function SendRPC(string $MethodName, array $Paramset, $Data = null, bo $this->SendDebug('Receive', $Result, 0); return $Result; } + private function SetColorAttribute(array $Values) { ksort($Values); @@ -501,6 +518,7 @@ private function SetColorAttribute(array $Values) } $this->WriteAttributeString('ScheduleColors', json_encode($ScheduleTemps)); } + private function GetColorAttribute() { $Values = []; diff --git a/libs/HMTypes.php b/libs/HMTypes.php index 6198f78..19c0a0b 100644 --- a/libs/HMTypes.php +++ b/libs/HMTypes.php @@ -23,6 +23,7 @@ class GUID public const SendToRFSplitter = '{2F910A05-3607-4070-A6FF-53539E5D3BBB}'; public const HmIO = '{A151ECE9-D733-4FB9-AA15-7F7DD10C58AF}'; } + class CCU { public const BidCos_RF = 'BidCos-RF'; @@ -37,6 +38,7 @@ class CCU self::Groups ]; } + class DeviceType { public const HeatingGroup = 'HM-CC-VG-1'; //'CLIMATECONTROL_RT_TRANSCEIVER'; @@ -64,33 +66,172 @@ class Channels public const First = ':1'; public const Second = ':2'; } + class ClimacontrolRegulator { + //Values public const SETPOINT = 'SETPOINT'; public const ADJUSTING_DATA = 'ADJUSTING_DATA'; public const ADJUSTING_COMMAND = 'ADJUSTING_COMMAND'; public const STATE = 'STATE'; + //Params public const MODE_TEMPERATUR_REGULATOR = 'MODE_TEMPERATUR_REGULATOR'; public const DECALCIFICATION_DAY = 'DECALCIFICATION_DAY'; public const DECALCIFICATION_TIME = 'DECALCIFICATION_TIME'; public const DECALCIFICATION_HOUR = 'DECALCIFICATION_HOUR'; + public const DECALCIFICATION_MINUTE = 'DECALCIFICATION_MINUTE'; public const MODE_TEMPERATUR_VALVE = 'MODE_TEMPERATUR_VALVE'; public const TEMPERATUR_LOWERING_VALUE = 'TEMPERATUR_LOWERING_VALUE'; public const TEMPERATUR_COMFORT_VALUE = 'TEMPERATUR_COMFORT_VALUE'; + public const TEMPERATUR_PARTY_VALUE = 'TEMPERATUR_PARTY_VALUE'; public const PARTY_END_TIME = 'PARTY_END_TIME'; public const PARTY_END_DAY = 'PARTY_END_DAY'; public const PARTY_END_HOUR = 'PARTY_END_HOUR'; public const PARTY_END_MINUTE = 'PARTY_END_MINUTE'; } + class HeatingGroupHmIP { + //Values + public const ACTIVE_PROFILE = 'ACTIVE_PROFILE'; + public const ACTUAL_TEMPERATURE = 'ACTUAL_TEMPERATURE'; + public const ACTUAL_TEMPERATURE_STATUS = 'ACTUAL_TEMPERATURE_STATUS'; + public const BOOST_MODE = 'BOOST_MODE'; + public const BOOST_TIME = 'BOOST_TIME'; + public const FROST_PROTECTION = 'FROST_PROTECTION'; + public const HEATING_COOLING = 'HEATING_COOLING'; + public const HUMIDITY = 'HUMIDITY'; + public const HUMIDITY_STATUS = 'HUMIDITY_STATUS'; + public const LEVEL = 'LEVEL'; + public const LEVEL_STATUS = 'LEVEL_STATUS'; + public const PARTY_MODE = 'PARTY_MODE'; + public const PARTY_SET_POINT_TEMPERATURE = 'PARTY_SET_POINT_TEMPERATURE'; + public const PARTY_TIME_END = 'PARTY_TIME_END'; + public const PARTY_TIME_START = 'PARTY_TIME_START'; + public const QUICK_VETO_TIME = 'QUICK_VETO_TIME'; + public const SET_POINT_MODE = 'SET_POINT_MODE'; + public const CONTROL_MODE = 'CONTROL_MODE'; + public const SET_POINT_TEMPERATURE = 'SET_POINT_TEMPERATURE'; + public const SWITCH_POINT_OCCURED = 'SWITCH_POINT_OCCURED'; + public const VALVE_ADAPTION = 'VALVE_ADAPTION'; + public const VALVE_STATE = 'VALVE_STATE'; + public const WINDOW_STATE = 'WINDOW_STATE'; + //Params + public const DECALCIFICATION_TIME = 'DECALCIFICATION_TIME'; + public const DECALCIFICATION_WEEKDAY = 'DECALCIFICATION_WEEKDAY'; + public const BOOST_POSITION = 'BOOST_POSITION'; + public const BOOST_TIME_PERIOD = 'BOOST_TIME_PERIOD'; + public const TEMPERATURE_COMFORT = 'TEMPERATURE_COMFORT'; + public const TEMPERATURE_COMFORT_COOLING = 'TEMPERATURE_COMFORT_COOLING'; + public const TEMPERATURE_LOWERING = 'TEMPERATURE_LOWERING'; + public const TEMPERATURE_LOWERING_COOLING = 'TEMPERATURE_LOWERING_COOLING'; + public const TEMPERATURE_WINDOW_OPEN = 'TEMPERATURE_WINDOW_OPEN'; + // only Property + public const PARTY = 'PARTY'; + } + + class HeatingGroup + { + //Values + public const ACTUAL_HUMIDITY = 'ACTUAL_HUMIDITY'; + public const ACTUAL_TEMPERATURE = 'ACTUAL_TEMPERATURE'; + public const AUTO_MODE = 'AUTO_MODE'; + public const BOOST_MODE = 'BOOST_MODE'; + public const COMFORT_MODE = 'COMFORT_MODE'; + public const CONTROL_MODE = 'CONTROL_MODE'; + public const LOWERING_MODE = 'LOWERING_MODE'; + public const MANU_MODE = 'MANU_MODE'; + public const PARTY_MODE_SUBMIT = 'PARTY_MODE_SUBMIT'; + public const PARTY_START_DAY = 'PARTY_START_DAY'; + public const PARTY_START_MONTH = 'PARTY_START_MONTH'; + public const PARTY_START_TIME = 'PARTY_START_TIME'; + public const PARTY_START_YEAR = 'PARTY_START_YEAR'; + public const PARTY_STOP_DAY = 'PARTY_STOP_DAY'; + public const PARTY_STOP_MONTH = 'PARTY_STOP_MONTH'; + public const PARTY_STOP_TIME = 'PARTY_STOP_TIME'; + public const PARTY_STOP_YEAR = 'PARTY_STOP_YEAR'; + public const PARTY_TEMPERATURE = 'PARTY_TEMPERATURE'; + public const SET_TEMPERATURE = 'SET_TEMPERATURE'; + //Params + public const DECALCIFICATION_TIME = 'DECALCIFICATION_TIME'; + public const DECALCIFICATION_WEEKDAY = 'DECALCIFICATION_WEEKDAY'; + public const BOOST_POSITION = 'BOOST_POSITION'; + public const BOOST_TIME_PERIOD = 'BOOST_TIME_PERIOD'; + public const BUTTON_LOCK = 'BUTTON_LOCK'; + public const GLOBAL_BUTTON_LOCK = 'GLOBAL_BUTTON_LOCK'; + public const MODUS_BUTTON_LOCK = 'MODUS_BUTTON_LOCK'; + public const BOOST_AFTER_WINDOW_OPEN = 'BOOST_AFTER_WINDOW_OPEN'; + public const TEMPERATUREFALL_WINDOW_OPEN = 'TEMPERATUREFALL_WINDOW_OPEN'; + public const TEMPERATUREFALL_WINDOW_OPEN_TIME_PERIOD = 'TEMPERATUREFALL_WINDOW_OPEN_TIME_PERIOD'; + public const TEMPERATURE_COMFORT = 'TEMPERATURE_COMFORT'; + public const TEMPERATURE_LOWERING = 'TEMPERATURE_LOWERING'; + public const WEEK_PROGRAM_POINTER = 'WEEK_PROGRAM_POINTER'; + + // only Property + public const PARTY = 'PARTY'; } + + class Property + { + public static $Properties = [ + DeviceType::ClimacontrolRegulator => [ + ClimacontrolRegulator::TEMPERATUR_PARTY_VALUE => true, + ClimacontrolRegulator::PARTY_END_TIME => true, + ClimacontrolRegulator::TEMPERATUR_COMFORT_VALUE => false, + ClimacontrolRegulator::TEMPERATUR_LOWERING_VALUE => false, + ClimacontrolRegulator::DECALCIFICATION_TIME => false, + ClimacontrolRegulator::DECALCIFICATION_DAY => false, + ClimacontrolRegulator::MODE_TEMPERATUR_VALVE => false + ], + DeviceType::HeatingGroupHmIP=> [ + HeatingGroupHmIP::ACTIVE_PROFILE => true, + HeatingGroupHmIP::BOOST_MODE => true, + HeatingGroupHmIP::BOOST_TIME => false, + HeatingGroupHmIP::FROST_PROTECTION => false, + HeatingGroupHmIP::HEATING_COOLING => false, + HeatingGroupHmIP::LEVEL => true, + HeatingGroupHmIP::PARTY => true, + HeatingGroupHmIP::SWITCH_POINT_OCCURED => false, + HeatingGroupHmIP::VALVE_ADAPTION => false, + HeatingGroupHmIP::VALVE_STATE => true, + HeatingGroupHmIP::WINDOW_STATE => true, + HeatingGroupHmIP::DECALCIFICATION_TIME => false, + HeatingGroupHmIP::DECALCIFICATION_WEEKDAY => false, + HeatingGroupHmIP::BOOST_POSITION => false, + HeatingGroupHmIP::BOOST_TIME_PERIOD => false, + HeatingGroupHmIP::TEMPERATURE_COMFORT => false, + HeatingGroupHmIP::TEMPERATURE_COMFORT_COOLING => false, + HeatingGroupHmIP::TEMPERATURE_LOWERING => false, + HeatingGroupHmIP::TEMPERATURE_LOWERING_COOLING => false, + HeatingGroupHmIP::TEMPERATURE_WINDOW_OPEN => true + ], + DeviceType::HeatingGroup=> [ + HeatingGroup::COMFORT_MODE => true, + HeatingGroup::LOWERING_MODE => true, + HeatingGroup::PARTY => true, + HeatingGroup::DECALCIFICATION_TIME => false, + HeatingGroup::DECALCIFICATION_WEEKDAY => false, + HeatingGroup::BOOST_POSITION => false, + HeatingGroup::BOOST_TIME_PERIOD => false, + HeatingGroup::BUTTON_LOCK => false, + HeatingGroup::GLOBAL_BUTTON_LOCK => false, + HeatingGroup::MODUS_BUTTON_LOCK => false, + HeatingGroup::BOOST_AFTER_WINDOW_OPEN => false, + HeatingGroup::TEMPERATUREFALL_WINDOW_OPEN => true, + HeatingGroup::TEMPERATUREFALL_WINDOW_OPEN_TIME_PERIOD => false, + HeatingGroup::TEMPERATURE_COMFORT => false, + HeatingGroup::TEMPERATURE_LOWERING => false, + HeatingGroup::WEEK_PROGRAM_POINTER => true, + ] + ]; + } + class Variables { public const VARIABLETYPE_NONE = -1; public static $Profiles = [ - 'Heating.Control.SetPoint.Temperature.HmIP'=> [ + 'Heating.Control.SetPoint.Temperature.HM'=> [ VARIABLETYPE_FLOAT, 'Temperature', '', @@ -109,9 +250,30 @@ class Variables 'Clock', '', '', - 1, - 6, - 1, + [ + [1, '1', '', -1], + [2, '2', '', -1], + [3, '3', '', -1], + [4, '4', '', -1], + [5, '5', '', -1], + [6, '6', '', -1] + ], + -1, + 0, + 0 + ], + 'Heating.Control.Profile.HM'=> [ + VARIABLETYPE_INTEGER, + 'Clock', + '', + '', + [ + [1, '1', '', -1], + [2, '2', '', -1], + [3, '3', '', -1] + ], + -1, + 0, 0 ], 'DateTime.Time.Seconds.HM' => [ @@ -138,8 +300,7 @@ class Variables 0, 0 ], - - 'Heating.Control.SetPoint.Mode.HM'=> [ + 'Heating.Control.SetPoint.Mode.HmIP'=> [ VARIABLETYPE_INTEGER, '', '', @@ -153,6 +314,21 @@ class Variables 0, 0 ], + 'Heating.Control.SetPoint.Mode.HM'=> [ + VARIABLETYPE_INTEGER, + '', + '', + '', + [ + [0, 'Automatic', 'Clock', 0x339966], + [1, 'Manually', 'Execute', 0xFF0000], + [2, 'Holiday/Party', 'Party', 0x3366FF], + [3, 'Boost', 'Flame', 0xFFFF99] + ], + -1, + 0, + 0 + ], 'Heating.Control.SetPoint.Mode.HM-CC-TC'=> [ VARIABLETYPE_INTEGER, '', @@ -274,6 +450,26 @@ class Variables 1, 0 ], + 'DateTime.Time.Minutes.30.Steps'=> [ + VARIABLETYPE_INTEGER, + 'Clock', + '', + ' minutes', + 0, + 30, + 5, + 0 + ], + 'DateTime.Time.Minutes.60.Steps'=> [ + VARIABLETYPE_INTEGER, + 'Clock', + '', + ' minutes', + 0, + 60, + 5, + 0 + ], 'Temperature.Room.Lowering.HmIP'=> [ VARIABLETYPE_FLOAT, 'Temperature', @@ -294,6 +490,18 @@ class Variables 0.5, 1 ], + 'Execute.HM' => [ + VARIABLETYPE_INTEGER, + '', + '', + '', + [ + [0, 'Start', '', -1] + ], + -1, + 0, + 0 + ] ]; } @@ -303,7 +511,7 @@ class ValuesSet DeviceType::ClimacontrolRegulator => [ ClimacontrolRegulator::SETPOINT => [ VARIABLETYPE_FLOAT, - 'Heating.Control.SetPoint.Temperature.HmIP', + '~Temperature.HM', true, 'Setpoint temperature' ], @@ -318,142 +526,228 @@ class ValuesSet ], ], DeviceType::HeatingGroupHmIP => [ - 'ACTIVE_PROFILE' => [ + HeatingGroupHmIP::ACTIVE_PROFILE => [ VARIABLETYPE_INTEGER, 'Heating.Control.Profile.HmIP', true, - 'Active profile', - true + 'Active profile' ], - 'ACTUAL_TEMPERATURE' => [ + HeatingGroupHmIP::ACTUAL_TEMPERATURE => [ VARIABLETYPE_FLOAT, '~Temperature', false, 'Temperature' ], - 'ACTUAL_TEMPERATURE_STATUS' => [ + HeatingGroupHmIP::ACTUAL_TEMPERATURE_STATUS => [ Variables::VARIABLETYPE_NONE ], - 'BOOST_MODE' => [ + HeatingGroupHmIP::BOOST_MODE => [ VARIABLETYPE_BOOLEAN, '~Switch', true, - 'Boost', - true + 'Boost' ], - 'BOOST_TIME' => [ + HeatingGroupHmIP::BOOST_TIME => [ VARIABLETYPE_INTEGER, 'DateTime.Time.Seconds.HM', false, - 'Boost remaining time', - false + 'Boost remaining time' ], - 'FROST_PROTECTION' => [ + HeatingGroupHmIP::FROST_PROTECTION => [ VARIABLETYPE_BOOLEAN, '~Switch', false, - 'Frost protection', - false + 'Frost protection' ], - 'HEATING_COOLING' => [ + HeatingGroupHmIP::HEATING_COOLING => [ VARIABLETYPE_INTEGER, 'Heating.Control.Mode.HM', true, - 'Operation mode', - false + 'Operation mode' ], - 'HUMIDITY' => [ + HeatingGroupHmIP::HUMIDITY => [ VARIABLETYPE_INTEGER, '~Humidity', false, 'Humidity' ], - 'HUMIDITY_STATUS' => [ + HeatingGroupHmIP::HUMIDITY_STATUS => [ Variables::VARIABLETYPE_NONE ], - 'LEVEL' => [ + HeatingGroupHmIP::LEVEL => [ VARIABLETYPE_FLOAT, '~Intensity.1', true, - 'Valve opening', - true + 'Valve opening' ], - 'LEVEL_STATUS' => [ + HeatingGroupHmIP::LEVEL_STATUS => [ Variables::VARIABLETYPE_NONE ], - 'PARTY_MODE' => [ + HeatingGroupHmIP::PARTY_MODE => [ Variables::VARIABLETYPE_NONE ], - 'PARTY_SET_POINT_TEMPERATURE' => [ + HeatingGroupHmIP::PARTY_SET_POINT_TEMPERATURE => [ VARIABLETYPE_FLOAT, - 'Heating.Control.SetPoint.Temperature.HmIP', + '~Temperature.HM', true, 'Holiday/Party set point temperature', - true + HeatingGroupHmIP::PARTY ], - 'PARTY_TIME_END' => [ + HeatingGroupHmIP::PARTY_TIME_END => [ VARIABLETYPE_INTEGER, '~UnixTimestamp', true, 'Holiday/Party end', - true + HeatingGroupHmIP::PARTY ], - 'PARTY_TIME_START' => [ + HeatingGroupHmIP::PARTY_TIME_START => [ VARIABLETYPE_INTEGER, '~UnixTimestamp', true, 'Holiday/Party start', - true + HeatingGroupHmIP::PARTY ], - 'QUICK_VETO_TIME' => [ + HeatingGroupHmIP::QUICK_VETO_TIME => [ Variables::VARIABLETYPE_NONE ], - 'SET_POINT_MODE' => [ + HeatingGroupHmIP::SET_POINT_MODE => [ VARIABLETYPE_INTEGER, - 'Heating.Control.SetPoint.Mode.HM', - 'CONTROL_MODE', - 'Target temperature mode', - true + 'Heating.Control.SetPoint.Mode.HmIP', + HeatingGroupHmIP::CONTROL_MODE, + 'Target temperature mode' ], - 'CONTROL_MODE'=> [ + HeatingGroupHmIP::CONTROL_MODE=> [ Variables::VARIABLETYPE_NONE ], - 'SET_POINT_TEMPERATURE' => [ + HeatingGroupHmIP::SET_POINT_TEMPERATURE => [ VARIABLETYPE_FLOAT, - 'Heating.Control.SetPoint.Temperature.HmIP', + 'Heating.Control.SetPoint.Temperature.HM', true, 'Setpoint temperature' ], - 'SWITCH_POINT_OCCURED' => [ + HeatingGroupHmIP::SWITCH_POINT_OCCURED => [ VARIABLETYPE_BOOLEAN, '~Switch', false, - 'Switch point occurred', - false + 'Switch point occurred' ], - 'VALVE_ADAPTION' => [ + HeatingGroupHmIP::VALVE_ADAPTION => [ VARIABLETYPE_BOOLEAN, '~Switch', true, - 'Valve adaption', - false + 'Valve adaption' ], - 'VALVE_STATE' => [ + HeatingGroupHmIP::VALVE_STATE => [ VARIABLETYPE_INTEGER, 'Heating.Valve.State.HmIP', false, - 'Valve state', - true + 'Valve state' ], - 'WINDOW_STATE' => [ + HeatingGroupHmIP::WINDOW_STATE => [ VARIABLETYPE_INTEGER, 'Window.Open.State.HM.Reversed', true, - 'Window state', - true + 'Window state' ] ], - DeviceType::HeatingGroup=> [ + DeviceType::HeatingGroup => [ + HeatingGroup::ACTUAL_HUMIDITY => [ + VARIABLETYPE_INTEGER, + '~Humidity', + false, + 'Humidity' + ], + HeatingGroup::ACTUAL_TEMPERATURE => [ + VARIABLETYPE_FLOAT, + '~Temperature', + false, + 'Temperature' + ], + HeatingGroup::SET_TEMPERATURE => [ + VARIABLETYPE_FLOAT, + 'Heating.Control.SetPoint.Temperature.HM', + true, + 'Setpoint temperature' + ], + HeatingGroup::MANU_MODE => [ + \HMExtended\Variables::VARIABLETYPE_NONE + ], + HeatingGroup::AUTO_MODE => [ + \HMExtended\Variables::VARIABLETYPE_NONE + ], + HeatingGroup::BOOST_MODE => [ + \HMExtended\Variables::VARIABLETYPE_NONE + ], + HeatingGroup::CONTROL_MODE => [ + VARIABLETYPE_INTEGER, + 'Heating.Control.SetPoint.Mode.HM', + true, + 'Target temperature mode' + ], + HeatingGroup::PARTY_TEMPERATURE => [ + VARIABLETYPE_FLOAT, + '~Temperature.HM', + true, + 'Holiday/Party set point temperature', + HeatingGroup::PARTY + ], + + HeatingGroup::PARTY_START_TIME => [ + VARIABLETYPE_INTEGER, + '~UnixTimestamp', + true, + 'Holiday/Party start', + HeatingGroup::PARTY + ], + HeatingGroup::PARTY_START_DAY => [ + \HMExtended\Variables::VARIABLETYPE_NONE, + '', + HeatingGroup::PARTY_START_TIME + ], + HeatingGroup::PARTY_START_MONTH => [ + \HMExtended\Variables::VARIABLETYPE_NONE, + '', + HeatingGroup::PARTY_START_TIME + ], + HeatingGroup::PARTY_START_YEAR => [ + \HMExtended\Variables::VARIABLETYPE_NONE, + '', + HeatingGroup::PARTY_START_TIME + ], + HeatingGroup::PARTY_STOP_TIME => [ + VARIABLETYPE_INTEGER, + '~UnixTimestamp', + true, + 'Holiday/Party end', + HeatingGroup::PARTY + ], + HeatingGroup::PARTY_STOP_DAY => [ + \HMExtended\Variables::VARIABLETYPE_NONE, + '', + HeatingGroup::PARTY_STOP_TIME + ], + HeatingGroup::PARTY_STOP_MONTH => [ + \HMExtended\Variables::VARIABLETYPE_NONE, + '', + HeatingGroup::PARTY_STOP_TIME + ], + HeatingGroup::PARTY_STOP_YEAR => [ + \HMExtended\Variables::VARIABLETYPE_NONE, + '', + HeatingGroup::PARTY_STOP_TIME + ], + HeatingGroup::COMFORT_MODE => [ + VARIABLETYPE_INTEGER, + 'Execute.HM', + true, + 'Set to comfort temperature' + ], + HeatingGroup::LOWERING_MODE => [ + VARIABLETYPE_INTEGER, + 'Execute.HM', + true, + 'Set to lowering temperature' + ], ] ]; } @@ -472,41 +766,36 @@ class ParamSet VARIABLETYPE_INTEGER, 'DateTime.DoW.Saturday', true, - 'Decalcification day', - false + 'Decalcification day' ], ClimacontrolRegulator::DECALCIFICATION_TIME => [ VARIABLETYPE_INTEGER, '~UnixTimestampTime', true, - 'Decalcification time', - false + 'Decalcification time' ], ClimacontrolRegulator::DECALCIFICATION_HOUR => [ Variables::VARIABLETYPE_NONE, '', - 'DECALCIFICATION_TIME' + ClimacontrolRegulator::DECALCIFICATION_TIME ], ClimacontrolRegulator::MODE_TEMPERATUR_VALVE => [ VARIABLETYPE_INTEGER, 'Heating.Control.Valve.Mode.HM', true, - 'Valve mode', - false + 'Valve mode' ], ClimacontrolRegulator::TEMPERATUR_LOWERING_VALUE=> [ VARIABLETYPE_FLOAT, '~Temperature.HM', true, - 'Lowering temperature', - true + 'Lowering temperature' ], ClimacontrolRegulator::TEMPERATUR_COMFORT_VALUE => [ VARIABLETYPE_FLOAT, '~Temperature.HM', true, - 'Comfort temperature', - true + 'Comfort temperature' ], ClimacontrolRegulator::PARTY_END_TIME => [ VARIABLETYPE_INTEGER, @@ -515,84 +804,160 @@ class ParamSet 'Holiday/Party end', true ], + ClimacontrolRegulator::TEMPERATUR_PARTY_VALUE => [ + VARIABLETYPE_FLOAT, + '~Temperature.HM', + true, + 'Holiday/Party set point temperature', + true + ], ClimacontrolRegulator::PARTY_END_DAY => [ Variables::VARIABLETYPE_NONE, '', - 'PARTY_END_TIME' + ClimacontrolRegulator::PARTY_END_TIME ], ClimacontrolRegulator::PARTY_END_HOUR => [ Variables::VARIABLETYPE_NONE ], - 'PARTY_END_MINUTE' => [ + ClimacontrolRegulator::PARTY_END_MINUTE => [ Variables::VARIABLETYPE_NONE ] ], DeviceType::HeatingGroupHmIP => [ - 'DECALCIFICATION_TIME'=> [ + HeatingGroupHmIP::DECALCIFICATION_TIME=> [ VARIABLETYPE_INTEGER, '~UnixTimestampTime', true, - 'Decalcification time', - false + 'Decalcification time' ], - 'DECALCIFICATION_WEEKDAY'=> [ + HeatingGroupHmIP::DECALCIFICATION_WEEKDAY=> [ VARIABLETYPE_INTEGER, 'DateTime.DoW.Sunday', true, - 'Decalcification day', - false + 'Decalcification day' ], - 'BOOST_POSITION'=> [ + HeatingGroupHmIP::BOOST_POSITION=> [ VARIABLETYPE_INTEGER, '~Intensity.100', true, - 'Boost valve opening', - false + 'Boost valve opening' ], - 'BOOST_TIME_PERIOD' => [ + HeatingGroupHmIP::BOOST_TIME_PERIOD => [ VARIABLETYPE_INTEGER, 'DateTime.Time.Minutes.30', true, - 'Boost duration', - false + 'Boost duration' ], - 'TEMPERATURE_COMFORT' => [ + HeatingGroupHmIP::TEMPERATURE_COMFORT => [ VARIABLETYPE_FLOAT, 'Temperature.Room.Comfort.HmIP', true, - 'Comfort temperature', - true + 'Comfort temperature' ], - 'TEMPERATURE_COMFORT_COOLING' => [ + HeatingGroupHmIP::TEMPERATURE_COMFORT_COOLING => [ VARIABLETYPE_FLOAT, 'Temperature.Room.Lowering.HmIP', true, - 'Comfort temperature cooling', - false + 'Comfort temperature cooling' ], - 'TEMPERATURE_LOWERING' => [ + HeatingGroupHmIP::TEMPERATURE_LOWERING => [ VARIABLETYPE_FLOAT, 'Temperature.Room.Lowering.HmIP', true, - 'Lowering temperature', - true + 'Lowering temperature' ], - 'TEMPERATURE_LOWERING_COOLING'=> [ + HeatingGroupHmIP::TEMPERATURE_LOWERING_COOLING => [ VARIABLETYPE_FLOAT, 'Temperature.Room.Comfort.HmIP', true, - 'Lowering temperature cooling', - false + 'Lowering temperature cooling' ], - 'TEMPERATURE_WINDOW_OPEN' => [ + HeatingGroupHmIP::TEMPERATURE_WINDOW_OPEN => [ VARIABLETYPE_FLOAT, '~Temperature.HM', true, - 'Window open temperature', - true + 'Window open temperature' ] ], - DeviceType::HeatingGroup=> [ + DeviceType::HeatingGroup => [ + HeatingGroup::WEEK_PROGRAM_POINTER => [ + VARIABLETYPE_INTEGER, + 'Heating.Control.Profile.HM', + true, + 'Active profile' + ], + HeatingGroup::DECALCIFICATION_TIME=> [ + VARIABLETYPE_INTEGER, + '~UnixTimestampTime', + true, + 'Decalcification time' + ], + HeatingGroup::DECALCIFICATION_WEEKDAY=> [ + VARIABLETYPE_INTEGER, + 'DateTime.DoW.Sunday', + true, + 'Decalcification day' + ], + HeatingGroup::BOOST_POSITION=> [ + VARIABLETYPE_INTEGER, + '~Intensity.100', + true, + 'Boost valve opening' + ], + HeatingGroup::BOOST_TIME_PERIOD => [ + VARIABLETYPE_INTEGER, + 'DateTime.Time.Minutes.30.Steps', + true, + 'Boost duration' + ], + HeatingGroup::TEMPERATURE_COMFORT => [ + VARIABLETYPE_FLOAT, + 'Temperature.Room.Comfort.HmIP', + true, + 'Comfort temperature' + ], + HeatingGroup::TEMPERATURE_LOWERING => [ + VARIABLETYPE_FLOAT, + 'Temperature.Room.Lowering.HmIP', + true, + 'Lowering temperature' + ], + HeatingGroup::BUTTON_LOCK => [ + VARIABLETYPE_BOOLEAN, + '~Switch', + true, + 'Button lock' + ], + HeatingGroup::GLOBAL_BUTTON_LOCK => [ + VARIABLETYPE_BOOLEAN, + '~Switch', + true, + 'Device lock' + ], + HeatingGroup::MODUS_BUTTON_LOCK => [ + VARIABLETYPE_BOOLEAN, + '~Switch', + true, + 'Mode locked' + ], + HeatingGroup::BOOST_AFTER_WINDOW_OPEN => [ + VARIABLETYPE_BOOLEAN, + '~Switch', + true, + 'Boost when window closed' + ], + HeatingGroup::TEMPERATUREFALL_WINDOW_OPEN => [ + VARIABLETYPE_FLOAT, + '~Temperature.HM', + true, + 'Window open temperature' + ], + HeatingGroup::TEMPERATUREFALL_WINDOW_OPEN_TIME_PERIOD => [ + VARIABLETYPE_INTEGER, + 'DateTime.Time.Minutes.60.Steps', + true, + 'Window open duration' + ] ] ]; } @@ -606,5 +971,4 @@ class Property public const Address = 'Address'; public const Protocol = 'Protocol'; } - -} +} \ No newline at end of file