HI Leute Habe mir im Forum ein fertiges Script zur Heizungssteuerung heraus gesucht
Leider habe ich anscheinend etwas fergessen oder falsch gemacht und brauche mal eure hilfe
Die FHT Heizungssteuerung besteht aus 4 Scripten die ich nacheinander mal rein stellen werde
Also erstmal habe ich ein GLOBAL_ARRAY Script
<?
/*
*******************************
IP-SYMCON Event Scripting
*******************************
File : GLOBAL_ARRAY.ips.php
Trigger :
Interval :
*/
$Room_id = array(
'WOHN'
);
?>
Das scheint auch Richtig zu sein gut ich habe ja auch erst einen Raum
Dann kommt der LOOP
Dort habe ich anscheinend etwas fergessen oder falsch gemacht
<?
/*
*******************************
IP-SYMCON Event Scripting
*******************************
File : LOOP.ips.php
Trigger :
Interval :
*/
// Load common arrays
include_once ('GLOBAL_ARRAY.ips.php');
// -----------------------------------------------------------------------------
// Loop
$fht_loop = GetValueInteger('FHT_LOOP_COUNTER');
if ($fht_loop < 12) $fht_loop = $fht_loop + 1;
else ($fht_loop = 2);
include_once($Room_id[$fht_loop].'GLOBDEF.ips.php');
include(IPS_GetScriptFile('FHT'));
// -----------------------------------------------------------------------------
// Write Loop Value back to Variable
SetValueInteger('FHT_LOOP_COUNTER', $fht_loop);
?>
Ich erhalte beim ausführen folgende meldung
Notice: Undefined offset: 8 in C:\Programme\IP-Symcon\scripts.currentscript on line 21
Warning: fopen(C:/Programme/IP-Symcon/DATA/WOHNWOHN_FHT.par) [function.fopen]: failed to open stream: No such file or directory in C:\Programme\IP-Symcon\scripts\FHT.ips.php on line 27
Warning: fgets(): supplied argument is not a valid stream resource in C:\Programme\IP-Symcon\scripts\FHT.ips.php on line 33
Warning: fclose(): supplied argument is not a valid stream resource in C:\Programme\IP-Symcon\scripts\FHT.ips.php on line 43
Notice: Undefined variable: newtemp in C:\Programme\IP-Symcon\scripts\FHT.ips.php on line 46
Notice: Undefined variable: memo_temp in C:\Programme\IP-Symcon\scripts\FHT.ips.php on line 46
Notice: Undefined variable: memo_temp in C:\Programme\IP-Symcon\scripts\FHT.ips.php on line 55
Dann habe ich den GLOBAL_DEF
// Global defines for WOHN
// Global
$room = "WOHN";
$room_status = GetValueBoolean("WOHN_ROOM_STATUS");
$day_status = GetValueBoolean("WOHN_DAY_STATUS");
// FHT
$FHT_id = 59020;
$FHT_actual_temp = GetValueFloat("WOHN_FHT_ACTUAL_TEMP");
$FHT_actual_vpos = GetValueFloat("WOHN_FHT_ACTUAL_VPOS");
$FHT_actual_window = GetValueBoolean("WOHN_FHT_ACTUAL_WINDOW");
$FHT_target_mode = GetValueInteger("WOHN_FHT_TARGET_MODE");
$FHT_target_temp = GetValueFloat("WOHN_FHT_TARGET_TEMP");
$FHT_target_ips_t = GetValueFloat("WOHN_FHT_IPS_TEMP");
$FHT_target_ips_m = GetValueInteger("WOHN_FHT_IPS_MODE");
$FHT_low_batt = GetValueBoolean("WOHN_FHT_LOW_BAT");
?>
Der ist anscheinend auch OK
Und zu Letzt noch den FHT
Wo wieder der Wurm drinnen is
<?
/*
*******************************
IP-SYMCON Event Scripting
*******************************
File : FHT.ips.php
Trigger :
Interval :
*/
// --- Execute Automatic only when Window closed and Mode = Automatic ----------
if (($FHT_actual_window == False) AND ($FHT_target_mode == 0))
{
// Script will only be executed when:
// 1. the window in the room is closed
// 2. the FHT is on Automatic
// Load common arrays
include_once("GLOBAL_ARRAY.ips.php");
$time = date("H:i");
$day_parameter = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","");
$actual_day = date("w");
// Select the Parameters for FHT
if ($room_status == False)
$handle = fopen("C:/Programme/IP-Symcon/DATA/".$room."WOHN_FHT.par","r");
else
$handle = fopen("C:/Programme/IP-SYMCON/DATA/".$room."WOHN_FHT_HOL.par","r");
// Find the right parameter to adjust the target if necessary
while ($line = fgets($handle, 1000))
{
$parameter = explode(";", $line); //[0]-Day, [1]-Start Time, [2]-Temperature
$day = $parameter[0];
$switchtime = $parameter[1];
$temp = $parameter[2];
if (($day == $day_parameter[$actual_day]) AND ($time > $switchtime))
$newtemp = substr($temp, 0, 4); // extract the "
" from the file
}
fclose($handle);
// When Value changes -> Send the new Value to the Unit
if ($memo_temp != $newtemp)
{
FHT_SetTemperature($FHT_id, (float)$newtemp);
SetValueFloat($room."_FHT_MEMO_TEMP", (float)$newtemp);
}
// If Actual and Target Values don´t match
else
if ($FHT_target_temp != $memo_temp)
{
// If IPS Request has been updated recently, but IPS Request
// has not been sent yet to FHT, don't send Value again
// But if Target has been changed manually, the Value will
// be sent again
$update_ips_request = IPS_GetUpdateTime($room.'_FHT_IPS_TEMP');
$update_ips_target = IPS_GetUpdateTime($room.'_FHT_TARGET_TEMP');
if ($update_ips_target > $update_ips_request)
{
SetValueString('HMI_LOG_NEW_MESSAGE', $Room_id_text[$room].chr(9).': Wrong Target Temp. according to Parameters ('.$FHT_target_temp.' °C)');
FHT_SetTemperature($FHT_id, (float)$newtemp);
}
}
}
?>
Ich erhalte folgende meldung
<br />
<b>Notice</b>: Undefined variable: FHT_actual_window in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>11</b><br />
<br />
<b>Notice</b>: Undefined variable: FHT_target_mode in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>11</b><br />
<br />
<b>Notice</b>: Undefined variable: room_status in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>26</b><br />
<br />
<b>Notice</b>: Undefined variable: room in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>27</b><br />
<br />
<b>Notice</b>: Undefined variable: memo_temp in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>46</b><br />
<br />
<b>Notice</b>: Undefined variable: FHT_id in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>48</b><br />
<br />
<b>Warning</b>: fht_settemperature: Instance ( 0 ) not found! in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>48</b><br />
<br />
<b>Notice</b>: Undefined variable: room in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>49</b><br />
<br />
<b>Warning</b>: Unable to locate IPSVariable: _FHT_MEMO_TEMP in <b>C:\Programme\IP-Symcon\scripts.currentscript</b> on line <b>49</b><br />
Ich Hoffe ihr könnt mir weiter helfen
MFG KEN