Ich habe ein Script geschrieben, dass Ernies Heizungsscript automatisch installiert. Damit spart man sich einiges an Arbeit. Das Script kann mehrfach ausgeführt werden (wenn man weitere Änderungen benötigt). Bereits angelegte Variablen werden aber nicht mehr gelöscht. Dies muss man gegebenfalls manuell tun.
Das Script patched auch die Datei „config.class.ips.php“ und schreibt dort alle relevanten Variablen rein.
<?
//############################
$typ = HeizungsKomponenten::EinsWireWagoKombination; // Art der Hardware (HomeMatic | HomeMaticHeizenJaNein | EinsWireWagoKombination)
$scriptRootCategoryId = 0; // Root-Category für die Scripte von Ernie
$useOrCreateProgramCategory = true; // Legt fest, ob in der Root-Category eine zusätzliche Category "Program" angelegt werden soll.
$scriptPathOnHdd = "ErniesHeizungssteuerung"; // Pfad zu den entpackten Dateien aus dem Ernie-Archiv auf der Festplatte
// Beginnend im Script-Verzeichnis von IPS (z.B. C":\IP-Symcon\scripts")
$heizungRootCategoryId = 32834 /*[Ernie]*/; // Category in welcher die Variablen für die Heizungssteuerung angelegt werden sollen
$raeume = array(); // Array für Raum-Definitionen
$raeume[0] = array(
"name" => "Wohnzimmer",
//"readRaumSollTemeratur" => 10001, // Nur erforderlich wenn $Typ = HeizungsKomponenten::HomeMatic;
//"writeRaumSollTemeratur" => 10002, // Erforderlich wenn $Typ = HeizungsKomponenten::HomeMatic oder $Typ = HeizungsKomponenten::HomeMaticHeizenJaNein
"readRaumIstTemeratur" => 40482 ,
//"heizStatiRaeume" => 10004,
//"rootNodesFenster" => array(10005 /*[Objekt #10005 existiert nicht]*/, 10006),
"zeitProfile" => Zeitprofile::Bad,
"raumSteuerungsTechnik" => "\"SIMPLE-DELTA\"",
"simpleDeltaTemperatur" => 0.5
);
//############################
BackupConfigFile($scriptPathOnHdd);
CreateVariableProfiles();
$temp = CreateScripts($scriptRootCategoryId, $scriptPathOnHdd, $useOrCreateProgramCategory);
$configScriptId = $temp[0];
$webfrontScriptId = $temp[1];
CreateHeizplaeneMondayToSunday($heizungRootCategoryId, $configScriptId);
CreateTemperaturProfiles($raeume, $heizungRootCategoryId, $configScriptId, $webfrontScriptId);
$raeume = CreateHeizSollTemperaturVariablen($raeume, $typ, $heizungRootCategoryId, $configScriptId);
CreateZeitprofile($raeume, $configScriptId);
SetIds($raeume, $configScriptId);
CreateFensterNodes($raeume, $configScriptId);
class HeizungsKomponenten {
const HomeMatic = 0;
const HomeMaticHeizenJaNein = 1;
const EinsWireWagoKombination = 2;
}
class Zeitprofile {
const Bad = 1;
const Buero = 2;
const Kinderzimmer = 3;
const Schlafzimmer = 4;
const Wohnzimmer = 5;
}
function BackupConfigFile($scriptPathOnHdd) {
$currentScriptFile = IPS_GetKernelDir()."scripts\\".$scriptPathOnHdd."\\Heizungssteuerung\\config.class.ips.php";
$originalScriptFile = IPS_GetKernelDir()."scripts\\".$scriptPathOnHdd."\\Heizungssteuerung\\config.class.ips.php.org";
$backupScriptFile = IPS_GetKernelDir()."scripts\\".$scriptPathOnHdd."\\Heizungssteuerung\\config.class.ips.org.php.bak".date("YmdHis");
copy ($currentScriptFile , $backupScriptFile);
if(!file_exists($originalScriptFile)) {
copy ($currentScriptFile , $originalScriptFile);
} else {
copy ($originalScriptFile , $currentScriptFile);
}
}
function CreateScripts($rootCategoryId, $scriptPathOnHdd, $useProgramCategorieId) {
$pathAddOn = "/Heizungssteuerung";
if($useProgramCategorieId) {
$rootCategoryId = GetOrCreateCategory("Program", $rootCategoryId);
}
$scriptRootCategoryId = GetOrCreateCategory("Ernie", $rootCategoryId);
$scriptCategoryId = GetOrCreateCategory("Heizungssteuerung", $scriptRootCategoryId);
$configScriptId = AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "config.class.ips.php");
$webFrontScriptId = AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "aktionsScripte-changeWebfrontVariable.ips.php");
SetWebFrontChangeVariableScriptObjectID($webFrontScriptId, $configScriptId);
$scriptId = AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "aktionsScripte-createHeizplan.ips.php");
AddEventCyclicTimeBounds($scriptId, mktime(0, 1, 0));
$scriptId = AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "aktionsScripte-trigger.class.ips.php");
AddEventCyclicXSeconds($scriptId, 2);
AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "createHeizplan.class.ips.php");
AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "createHeizplanForOneWeek.ips.php");
AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "includes.ips.php");
AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "INTERFACES_Heizungskomponenten.ips.php");
AddScript($scriptPathOnHdd.$pathAddOn, $scriptCategoryId, "trigger.class.ips.php");
AddScript($scriptPathOnHdd, $scriptRootCategoryId, "debugger.class.ips.php");
return array($configScriptId, $webFrontScriptId);
}
function SetIds($raeume, $configScriptId) {
SetIds4Region("readRaumSollTemeratur", $raeume, $configScriptId);
SetIds4Region("writeRaumSollTemeratur", $raeume, $configScriptId);
SetIds4Region("readRaumIstTemeratur", $raeume, $configScriptId);
SetIds4Region("heizStatiRaeume", $raeume, $configScriptId);
SetIds4Region("raumSteuerungsTechnik", $raeume, $configScriptId);
SetIds4Region("simpleDeltaTemperatur", $raeume, $configScriptId);
}
function SetIds4Region($region, $raeume, $configScriptId) {
$str = "";
for($i = 0; $i < count($raeume); $i++) {
if(array_key_exists($region, $raeume[$i])) {
$str = $str." \$this->heizungssteuerung['".$region."']['".$raeume[$i]["name"]."'] = ".$raeume[$i][$region].";
";
}
}
ReplaceRegionInConfigScript($region, $configScriptId, $str);
}
function SetWebFrontChangeVariableScriptObjectID($id, $configScriptId) {
PatchIdInConfigScript("\$this->heizungssteuerung['createHeizplanConstants']['WebFrontChangeVariableScriptObjectID']", $id, $configScriptId);
}
function CreateHeizSollTemperaturVariablen($raeume, $typ, $heizungRootCategoryId, $configScriptId) {
$heizplanCategoryId = GetOrCreateCategory("Heizplan", $heizungRootCategoryId);
$catId = GetOrCreateCategory("Heiz-Soll-Temperatur", $heizplanCategoryId);
if($typ != HeizungsKomponenten::HomeMatic) {
for($i = 0; $i < count($raeume); $i++) {
$pin = createRaumSollVariable($raeume[$i]["name"], $catId);
$raeume[$i]["readRaumSollTemeratur"] = $pin;
if($typ == HeizungsKomponenten::EinsWireWagoKombination) {
$raeume[$i]["writeRaumSollTemeratur"] = $pin;
}
}
}
return $raeume;
}
function CreateTemperaturProfiles($raeume, $heizungRootCategoryId, $configScriptId, $webfrontScriptId) {
$heizplanCategoryId = GetOrCreateCategory("Heizplan", $heizungRootCategoryId);
$profileCategoryId = GetOrCreateCategory("00-Wunsch-Temperaturen", $heizplanCategoryId);
$str = "";
for($i = 0; $i < count($raeume); $i++) {
$pinAbwesend = createTemperaturVariable($raeume[$i]["name"]." - Abwesend", 16, $profileCategoryId);
IPS_SetVariableCustomAction($pinAbwesend, $webfrontScriptId);
$pinAnwesend = createTemperaturVariable($raeume[$i]["name"]." - Anwesend", 21, $profileCategoryId);
IPS_SetVariableCustomAction($pinAnwesend, $webfrontScriptId);
$str = $str." \$this->heizungssteuerung['temperaturProfile']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['temperaturProfile']['".$raeume[$i]["name"]."']['Anwesend'] = ".$pinAbwesend."; // cAOIDs ok
\$this->heizungssteuerung['temperaturProfile']['".$raeume[$i]["name"]."']['Abwesend'] = ".$pinAnwesend."; // cAOIDs ok
";
//echo "Str: ".$str;
ReplaceRegionInConfigScript("temperaturProfile", $configScriptId, $str);
}
}
function CreateHeizplaeneMondayToSunday($parentId, $configScriptId) {
$heizplanCategoryId = GetOrCreateCategory("Heizplan", $parentId);
$result = array();
$result[1] = GetOrCreateCategory("01-Montag", $heizplanCategoryId);
$result[2] = GetOrCreateCategory("02-Dienstag", $heizplanCategoryId);
$result[3] = GetOrCreateCategory("03-Mittwoch", $heizplanCategoryId);
$result[4] = GetOrCreateCategory("04-Donnerstag", $heizplanCategoryId);
$result[5] = GetOrCreateCategory("05-Freitag", $heizplanCategoryId);
$result[6] = GetOrCreateCategory("06-Samstag", $heizplanCategoryId);
$result[7] = GetOrCreateCategory("07-Sonntag", $heizplanCategoryId);
GetOrCreateCategory("08-Ist-Temperaturen", $heizplanCategoryId);
for($i = 1; $i <= 7; $i++) {
PatchIdInConfigScript("\$this->heizungssteuerung['rootNodesHeizplan'][".$i."]", $result[$i], $configScriptId);
}
return $result;
}
function ReplaceRegionInConfigScript($region, $configScriptId, $newRegionText) {
$scriptFileName = IPS_GetKernelDir()."/scripts/".IPS_GetScriptFile($configScriptId);
$scriptFileAsString = file_get_contents($scriptFileName);
preg_match_all("#^\s*\\\$this->heizungssteuerung\['".$region."'\]\['.+'\].*\s*=\s*.+$#m", $scriptFileAsString, $ausgabe);
$result = $pos1 = strpos($scriptFileAsString, $ausgabe[0][0]);
for($i = 0; $i < count($ausgabe[0]); $i++) {
$pos1 = strpos($scriptFileAsString, $ausgabe[0][$i]);
$len = strlen($ausgabe[0][$i]);
//echo $ausgabe[0][$i]."
";
//echo $pos1."
";
//echo $len."
";
//echo "***".substr($scriptFileAsString, $pos1, $len)."***
";
$scriptFileAsString = substr_replace($scriptFileAsString, "", $pos1, $len+1);
}
//echo $newRegionText;
$scriptFileAsString = substr_replace($scriptFileAsString, $newRegionText, $result, 0);
//echo $scriptFileAsString;
file_put_contents($scriptFileName, $scriptFileAsString);
return $result;
}
function PatchIdInConfigScript($variable, $id, $configScriptId) {
$scriptFileName = IPS_GetKernelDir()."/scripts/".IPS_GetScriptFile($configScriptId);
$scriptFileAsString = file_get_contents($scriptFileName);
$pos1 = strpos($scriptFileAsString, $variable);
$pos2 = strpos($scriptFileAsString, ";", $pos1);
//echo "Pos1: ".$pos1."
";
//echo "Pos2: ".$pos2."
";
//echo "Found: ".substr($scriptFileAsString, $pos1+51, $pos2 - $pos1-51)."
";
$scriptFileAsString = substr_replace($scriptFileAsString, " = ".$id, $pos1+strlen($variable), $pos2 - $pos1-strlen($variable));
//echo "id: ".$result[1]."
";
//echo "Found: ".substr($scriptFileAsString, $pos1+51, $pos2 - $pos1-51)."
";
file_put_contents($scriptFileName, $scriptFileAsString);
}
function AddScript($path, $parent, $ScriptName) {
$ScriptID = @IPS_GetObjectIDByName($ScriptName, $parent);
if ($ScriptID === false) {
$ScriptID = IPS_CreateScript(0);
IPS_SetParent($ScriptID, $parent);
IPS_SetName($ScriptID, $ScriptName);
$Script = IPS_GetScript($ScriptID);
unlink(IPS_GetKernelDir() . "/scripts/" . $Script["ScriptFile"]);
IPS_SetScriptFile($ScriptID, $path . "/". $ScriptName);
}
return $ScriptID;
}
function AddEventCyclicTimeBounds($scriptId, $time) {
$events = IPS_GetScriptEventList($scriptId);
if( count($events) == 0) {
$eid = IPS_CreateEvent(1);
IPS_SetEventCyclicTimeBounds($eid, $time, 0);
IPS_SetEventCyclic($eid, 2, 1, 0, 0, 0, 0);
IPS_SetParent($eid, $scriptId);
IPS_SetEventActive($eid, true);
}
}
function AddEventCyclicXSeconds($scriptId, $seconds) {
$events = IPS_GetScriptEventList($scriptId);
if( count($events) == 0) {
$eid = IPS_CreateEvent(1);
IPS_SetEventCyclic($eid, 0, 0, 0, 2, 1 ,$seconds);
IPS_SetParent($eid, $scriptId);
IPS_SetEventActive($eid, true);
}
}
function CreateCategory($name, $parent) {
$CatID = IPS_CreateCategory();
IPS_SetParent ($CatID, $parent);
IPS_SetName($CatID, $name);
return $CatID;
}
function GetOrCreateCategory($name, $parentId) {
$catId = @IPS_GetCategoryIDByName($name, $parentId);
if ($catId === false) {
$catId = CreateCategory($name, $parentId);
}
return $catId;
}
function createTemperaturVariable($name, $defaultTemperatur, $parent) {
$pinTemperatur = @IPS_GetVariableIDByName ($name, $parent);
if ($pinTemperatur === false) {
$pinTemperatur = IPS_CreateVariable(2);
IPS_SetParent($pinTemperatur, $parent);
IPS_SetName($pinTemperatur, $name);
IPS_SetVariableCustomProfile($pinTemperatur, "f_Raumtemperatur");
SetValueFloat($pinTemperatur, $defaultTemperatur);
}
return $pinTemperatur;
}
function createRaumSollVariable($name, $parent) {
$pin = @IPS_GetVariableIDByName ($name, $parent);
if ($pin === false) {
$pin = IPS_CreateVariable(0);
IPS_SetParent($pin, $parent);
IPS_SetName($pin, $name);
IPS_SetVariableCustomProfile($pin, "b_Heizen-Abkuehlen");
}
return $pin;
}
function CreateVariableProfiles() {
if (IPS_VariableProfileExists("b_Anwesend-Abwesend")) {
IPS_DeleteVariableProfile ("b_Anwesend-Abwesend");
}
IPS_CreateVariableProfile ("b_Anwesend-Abwesend", 0);
IPS_SetVariableProfileIcon("b_Anwesend-Abwesend", "Motion");
IPS_SetVariableProfileAssociation("b_Anwesend-Abwesend", 1, "Anwesend", "", 0x00ff00);
IPS_SetVariableProfileAssociation("b_Anwesend-Abwesend", 0, "Abwesend", "", 0xff0000);
if (IPS_VariableProfileExists("b_Heizen-Abkuehlen")) {
IPS_DeleteVariableProfile ("b_Heizen-Abkuehlen");
}
IPS_CreateVariableProfile ("b_Heizen-Abkuehlen", 0);
IPS_SetVariableProfileAssociation("b_Heizen-Abkuehlen", 1, "Heizen", "", 0x00ff00);
IPS_SetVariableProfileAssociation("b_Heizen-Abkuehlen", 0, "Abkühlen", "", 0xff0000);
if (IPS_VariableProfileExists("f_Raumtemperatur")) {
IPS_DeleteVariableProfile ("f_Raumtemperatur");
}
IPS_CreateVariableProfile ("f_Raumtemperatur", 2);
IPS_SetVariableProfileIcon("f_Raumtemperatur", "Temperature");
IPS_SetVariableProfileValues("f_Raumtemperatur", 1, 30, 0.5);
IPS_SetVariableProfileDigits("f_Raumtemperatur", 1);
IPS_SetVariableProfileText("f_Raumtemperatur", "", " °C");
}
function CreateZeitprofile($raeume, $configScriptId) {
$str = "";
for($i = 0; $i < count($raeume); $i++) {
switch($raeume[$i]["zeitProfile"]) {
case Zeitprofile::Bad:
$str = $str.
" // ### Raum Definitionen - ".$raeume[$i]["name"]."
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][0] = \"06:00 bis 07:00 Uhr - Frühmorgens\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][1] = \"07:00 bis 09:00 Uhr - Morgens\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][2] = \"09:00 bis 10:30 Uhr - Spätmorgens\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][3] = \"10:30 bis 21:00 Uhr - Tagsüber\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][4] = \"21:00 bis 23:00 Uhr - Spätabends\";
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"06:00 bis 07:00 Uhr - Frühmorgens\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"07:00 bis 09:00 Uhr - Morgens\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"09:00 bis 10:30 Uhr - Spätmorgens\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"10:30 bis 21:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"21:00 bis 23:00 Uhr - Spätabends\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"06:00 bis 07:00 Uhr - Frühmorgens\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"07:00 bis 09:00 Uhr - Morgens\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"09:00 bis 10:30 Uhr - Spätmorgens\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"10:30 bis 21:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"21:00 bis 23:00 Uhr - Spätabends\"] = TRUE;
";
break;
case Zeitprofile::Buero:
$str = $str.
" // ### Raum Definitionen - ".$raeume[$i]["name"]."
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][0] = \"06:00 bis 12:00 Uhr - Morgens\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][1] = \"12:00 bis 16:00 Uhr - Tagsüber\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][2] = \"16:00 bis 19:30 Uhr - Nachmittags\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][3] = \"19:30 bis 23:00 Uhr - Abends\";
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"06:00 bis 12:00 Uhr - Morgens\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"12:00 bis 16:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"16:00 bis 19:30 Uhr - Nachmittags\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"19:30 bis 23:00 Uhr - Abends\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"06:00 bis 12:00 Uhr - Morgens\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"12:00 bis 16:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"16:00 bis 19:30 Uhr - Nachmittags\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"19:30 bis 23:00 Uhr - Abends\"] = FALSE;
";
break;
case Zeitprofile::Kinderzimmer:
$str = $str.
" // ### Raum Definitionen - ".$raeume[$i]["name"]."
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][0] = \"08:00 bis 10:00 Uhr - Morgens\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][1] = \"10:00 bis 21:00 Uhr - Tagsüber\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][2] = \"21:00 bis 22:00 Uhr - Abends\";
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"08:00 bis 10:00 Uhr - Morgens\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"10:00 bis 21:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"21:00 bis 22:00 Uhr - Abends\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"08:00 bis 10:00 Uhr - Morgens\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"10:00 bis 21:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"21:00 bis 22:00 Uhr - Abends\"] = TRUE;
";
break;
case Zeitprofile::Schlafzimmer:
$str = $str.
" // ### Raum Definitionen - ".$raeume[$i]["name"]."
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][0] = \"07:00 bis 19:00 Uhr - Tagsüber\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][1] = \"19:00 bis 22:00 Uhr - Abends\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][2] = \"22:00 bis 23:59 Uhr - Nachts\";
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"07:00 bis 19:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"19:00 bis 22:00 Uhr - Abends\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"22:00 bis 23:59 Uhr - Nachts\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"07:00 bis 19:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"19:00 bis 22:00 Uhr - Abends\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"22:00 bis 23:59 Uhr - Nachts\"] = FALSE;
";
break;
case Zeitprofile::Wohnzimmer:
$str = $str.
" // ### Raum Definitionen - ".$raeume[$i]["name"]."
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][0] = \"07:00 bis 10:00 Uhr - Morgens\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][1] = \"10:00 bis 13:00 Uhr - Spätmorgens\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][2] = \"13:00 bis 19:00 Uhr - Tagsüber\";
\$this->heizungssteuerung['zeitProfile']['".$raeume[$i]["name"]."'][3] = \"19:00 bis 23:00 Uhr - Abends\";
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'] = array();
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"07:00 bis 10:00 Uhr - Morgens\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"10:00 bis 13:00 Uhr - Spätmorgens\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"13:00 bis 19:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Werktags'][\"19:00 bis 23:00 Uhr - Abends\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"07:00 bis 10:00 Uhr - Morgens\"] = TRUE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"10:00 bis 13:00 Uhr - Spätmorgens\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"13:00 bis 19:00 Uhr - Tagsüber\"] = FALSE;
\$this->heizungssteuerung['standardZuordnung']['".$raeume[$i]["name"]."']['Wochenende'][\"19:00 bis 23:00 Uhr - Abends\"] = TRUE;
";
break;
}
ReplaceRegionInConfigScript("standardZuordnung", $configScriptId, "");
ReplaceRegionInConfigScript("zeitProfile", $configScriptId, $str);
}
}
function CreateFensterNodes($raeume, $configScriptId) {
$str = "";
for($i = 0; $i < count($raeume); $i++) {
$str = $str . " \$this->heizungssteuerung['rootNodesFenster']['".$raeume[$i]["name"]."'] = array();
";
if(array_key_exists("rootNodesFenster", $raeume[$i])) {
for($j = 0; $j < count($raeume[$i]["rootNodesFenster"]); $j++) {
$str = $str . " \$this->heizungssteuerung['rootNodesFenster']['".$raeume[$i]["name"]."'][".$j."] = ".$raeume[$i]["rootNodesFenster"][$j].";
";
}
}
}
ReplaceRegionInConfigScript("rootNodesFenster", $configScriptId, $str);
}
?>