Hallo Luca,
bitte lade das Homematic Extended Modul von Nall-chan.
Ein tolles Modul VIELEN DANK an Nall-chan !!!
Ich verwende die Systemvariablen u. das RemoteScript Interface (neue Instanz) siehe Screenshot:
In den Systemvariablen sind auch die Servicemeldungen enthalten.
Bediensperre (ToggleButton):
Wichtig: Den ObjektNamen bei mir „Thermostat Nr.1“ findest du im Homematic Webmenü!
> <?php
>
> $Status = GetValueBoolean(XXXXX);
>
> if ($Status == true) {
> $HMScript = 'object obj = devices.Get("Thermostat Nr.1");' . PHP_EOL
> .'xmlrpc.PutParamset (obj.Interface(), obj.Address()#":0", "MASTER", "GLOBAL_BUTTON_LOCK", "true");' . PHP_EOL;
>
> $HMScriptResult = HM_RunScript(XXXXX /*[HomeMatic RemoteScript Interface]*/, $HMScript);
> var_dump(json_decode($HMScriptResult));
> }
> else {
> $HMScript = 'object obj = devices.Get("Thermostat Nr.1");' . PHP_EOL
> .'xmlrpc.PutParamset (obj.Interface(), obj.Address()#":0", "MASTER", "GLOBAL_BUTTON_LOCK", "false");' . PHP_EOL;
>
> $HMScriptResult = HM_RunScript(XXXXX /*[HomeMatic RemoteScript Interface]*/, $HMScript);
> var_dump(json_decode($HMScriptResult));
> }
>
> ?>
Die Wochenprofile sind von
Author: Heiko Wilknitz (@Pitti)
Basierend auf Zapp (2011) for the IPS Community
Erweitert von Swifty (Heizungs_Scripte v 0.1 - 15.02.2014)
Wochenprofile Webfront
Klasse Arbeit an alle VIELEN DANK!!!
Habe etwas Code verändert damit auch das BWTH und WTH-1 funktioniert:
//lesen
// HmIP-WTH-2 || HMIP-eTRV || HmIP-eTRV-2 || HmIP-eTRV-B-2 R4M Profil auslesen (1-3 von 6)
if($type == "HmIP-WTH-2" or $type =="HmIP-eTRV-2" or $type == "HMIP-eTRV" or $type =="HmIP-eTRV-B-2 R4M") {
$params = ReadParamSet($if, $serial, $channel);
// 3 Profile
for ($p=1; $p<=3; $p++) {
foreach($days as $day) {
$thisEndTimes = array();
$thisValues = array();
$timePrevious = "00:00";
for($index = 1; $index <= 13; $index++) {
$keyTemp = "P". $p ."_TEMPERATURE_".strtoupper($day)."_".$index;
$keyTO = "P". $p ."_ENDTIME_".strtoupper($day)."_".$index;
$thisTemp = $params[$keyTemp];
$thisTO = $params[$keyTO];
$thisTime = date('H:i', mktime(0, $thisTO)); // $timePassed + TO
if ($thisTO >= 1440) $thisTime = "24:00";
$timePrevious = $thisTime;
array_push($thisEndTimes, $thisTime);
array_push($thisValues, $thisTemp);
if($thisTO >= 1440) break;
}
$temp["P".$p][$day]['EndTimes'] = $thisEndTimes;
$temp["P".$p][$day]['Values'] = $thisValues;
}
}
if($weekprofil > 0 and $weekprofil <= 3) {
return $temp["P".$weekprofil];
}
else {
return $temp;
}
}
// HmIP-BWTH 18.10.22
if($type == "HmIP-BWTH" or $type =="HmIP-WTH-1") {
$params = ReadParamSet($if, $serial, $channel);
// 6 Profile
for ($p=1; $p<=6; $p++) {
foreach($days as $day) {
$thisEndTimes = array();
$thisValues = array();
$timePrevious = "00:00";
for($index = 1; $index <= 13; $index++) {
$keyTemp = "P". $p ."_TEMPERATURE_".strtoupper($day)."_".$index;
$keyTO = "P". $p ."_ENDTIME_".strtoupper($day)."_".$index;
$thisTemp = $params[$keyTemp];
$thisTO = $params[$keyTO];
$thisTime = date('H:i', mktime(0, $thisTO)); // $timePassed + TO
if ($thisTO >= 1440) $thisTime = "24:00";
$timePrevious = $thisTime;
array_push($thisEndTimes, $thisTime);
array_push($thisValues, $thisTemp);
if($thisTO >= 1440) break;
}
$temp["P".$p][$day]['EndTimes'] = $thisEndTimes;
$temp["P".$p][$day]['Values'] = $thisValues;
}
}
if($weekprofil > 0 and $weekprofil <= 6) {
return $temp["P".$weekprofil];
}
else {
return $temp;
}
} //Ende 18.10.22
echo $type;
if($type != "HM-CC-RT-DN" and $type != "HM-CC-TC" and $type != "HM-TC-IT-WM-W-EU" and $type != "HmIP-WTH-2" and $type != "HMIP-eTRV" and $type != "HmIP-eTRV-2") {
die("Error: ReadTempProfile() Device $device is not of Type HM-CC-TC,HM-CC-RT-DN, HM-TC-IT-WM-W-EU, HmIP-WTH-2, HMIP-eTRV or HmIP-eTRV-2!");
}
}
//schreiben
// HmIP-WTH-2 || HMIP-eTRV || HmIP-eTRV-2 Profil schreiben (1-3 von 6)
if($type == "HmIP-WTH-2" or $type =="HmIP-eTRV-2" or $type == "HMIP-eTRV" or $type =="HmIP-eTRV-B-2 R4M") {
$prefix="P".$weekprofile."_";
$params = new xmlrpcval();
foreach ($profile as $day => $values) {
$timePrevious = "00:00";
for ($index=1; $index <= count($values['EndTimes']); $index++) {
$key = $prefix ."TEMPERATURE_".strtoupper($day)."_".$index;
$temp = array($key => new xmlrpcval($values['Values'][$index-1], "double"));
$params->addStruct($temp);
$key = $prefix ."ENDTIME_".strtoupper($day)."_".$index;
if ($index>13) break; // nur 13 Tages - Timeslots
if ($values['EndTimes'][$index-1] > $timePrevious) {
// Convert end time to Timeout
$thisDayStart = mktime(0, 0);
$timeEndArray = explode(":", $values['EndTimes'][$index-1]);
if ($timeEndArray[1] % 5) die("Error: Invalid End Time (must be 10mn increments) for $day at index $index in HMXML_setTempProfile()<br>
");
$timeEndts = mktime($timeEndArray[0], $timeEndArray[1]);
$timeout = (($timeEndts - $thisDayStart)/60); // TODO, works ?
$paramTime = array($key => new xmlrpcval("$timeout", "int")); // i4
$params->addStruct($paramTime);
}
else {
die("Error: Invalid End Time for $day at index $index in WriteTempProfile()!");
}
$timePrevious = $values['EndTimes'][$index-1];
}
}
$request = new xmlrpcmsg("putParamset",
array(new xmlrpcval("$serial:$channel", "string"),
new xmlrpcval("MASTER", "string"), $params));
//var_dump($params);
$result = Send($request, $if);
return true;
}
// HmIP-BWT 18.08.22 schreiben (1-6)
if($type == "HmIP-BWTH" or $type =="HmIP-WTH-1") {
$prefix="P".$weekprofile."_";
$params = new xmlrpcval();
foreach ($profile as $day => $values) {
$timePrevious = "00:00";
for ($index=1; $index <= count($values['EndTimes']); $index++) {
$key = $prefix ."TEMPERATURE_".strtoupper($day)."_".$index;
$temp = array($key => new xmlrpcval($values['Values'][$index-1], "double"));
$params->addStruct($temp);
$key = $prefix ."ENDTIME_".strtoupper($day)."_".$index;
if ($index>13) break; // nur 13 Tages - Timeslots
if ($values['EndTimes'][$index-1] > $timePrevious) {
// Convert end time to Timeout
$thisDayStart = mktime(0, 0);
$timeEndArray = explode(":", $values['EndTimes'][$index-1]);
if ($timeEndArray[1] % 5) die("Error: Invalid End Time (must be 10mn increments) for $day at index $index in HMXML_setTempProfile()<br>
");
$timeEndts = mktime($timeEndArray[0], $timeEndArray[1]);
$timeout = (($timeEndts - $thisDayStart)/60); // TODO, works ?
$paramTime = array($key => new xmlrpcval("$timeout", "int")); // i4
$params->addStruct($paramTime);
}
else {
die("Error: Invalid End Time for $day at index $index in WriteTempProfile()!");
}
$timePrevious = $values['EndTimes'][$index-1];
}
}
$request = new xmlrpcmsg("putParamset",
array(new xmlrpcval("$serial:$channel", "string"),
new xmlrpcval("MASTER", "string"), $params));
//var_dump($params);
$result = Send($request, $if);
return true;
} //Ende 18.08.22
if($type != "HM-CC-RT-DN" and $type != "HM-CC-TC" and $type != "HM-TC-IT-WM-W-EU" and $type != "HmIP-WTH-2" and $type != "HMIP-eTRV" and $type != "HmIP-eTRV-2") {
die("Error: WriteTempProfile() Device $device is not of Type HM-CC-TC,HM-CC-RT-DN, HM-TC-IT-WM-W-EU, HmIP-WTH-2, HMIP-eTRV or HmIP-eTRV-2!");
}
}