Heizungsautomatik unterbrechen

Ich ergänze:

Wenn ich am Rad eine Temperatur einstelle, so wird diese bis zur nächsten halben Stunde gehalten, danach wird das FHT80B wieder auf den Wert eingestellt, der in der tempsettings.ini notiert ist.

Werde mal weiter forschen …

Gruß,
Christoph

Hallo Christoph,

ich habe gerade nochmal im Script nachgesehen, das der Vergleich mit der „_state“ Variable stattfindet, stimmt nicht ganz, hatte wohl mein Script im Hinterkopf… :o
Es liegt am Aufruf:
stell mal die Zeile (bei mir 384)

} elseif ($IPS_SENDER == "RunScript") {

auf

} elseif ($IPS_SENDER == "TimerEvent") {

um.
Wie man hier sehen kann:

25.01.10  12:00:00  TimerEvent/MANUAL - FHT_SetTemp for ocs1_temp  SENT due to manual-exec.

heißt der Aufruf vom Timer nicht „RunScript“ sondern „TimerEvent“.

Nachteil dieser Regelung:
wird am Abend nochmal die Temp hoch gedreht und dann vergessen, freut sich vor allem der Energieversorger. :rolleyes:

Bei mir findet ein Vergleich der Soll-Temp mit „_state“ statt. Gibt es einen Unterschied, wird geändert. Damit es aber bei manueller Änderung nicht zu einer ungewollten „Verstellung“ kommt, muss man diese sperren. Es ist leider etwas aufwändiger, als es auf den ersten Blick aussieht.
Ich führe dazu eine „_lock“ Variable (Bool) ein.
Sie wird gesetzt, wenn eine manuelle Verstellung erkannt wird. Bei jedem Durchlauf berechnet das Script die Zeit seit der letzten manuellen Änderung und setzt bei überschreiten einer vorgegebenen Dauer das Lock-Flag zurück. Die Regelung arbeitet dann wieder „normal“.
Es kommt noch ein weiteres Problem hinzu:
Bei Verstellung kurz vor dem nächsten Temp-Wechsel, kommt die Antwort erst, wenn die Temp-Änderung bereits im Buffer steht. Dann hilft auch das Lock-Flag nicht mehr.
Man muss diesen Zustand abfangen, die vorherige _state Temp bestimmen und sie direkt im Anschluss wieder zum FHT schicken.

Ich suche heute Abend mal die notwendigen Ändeungen aus meiner Version raus.

Grüße
Fabian

Hallo Fabian,

habe die Zeile entsprechend geändert. Ich fürchte, es funktioniert nun … Aber sicher bin ich mir noch nicht. Ich werde das mal beobachten.

Falls es denn laufen sollte, so würde ich dann die „Lock“ Methode auch gerne einbauen, wenn es nicht allzu kompliziert ist :wink:

Gruß,
Christoph

Hallo,

die Geschichte mit dem „am Rad drehen“ läuft nun perfekt! Danke Fabian für Deine Hilfe.

Falls Du die Geduld noch nicht endgültig verloren hast:

Setze ich „iamhome“ auf TRUE, so ändert sich die Soll-Temperatur in den eingestellten Wert. Setze ich „iamhome“ auf FALSE und „iamaway“ auf TRUE, so steht dort 0°. Muss mal schauen, woran das liegen könnte.

Wäre noch an der Lock-Methode und an

Mein Vorschlag, bringe mal das mit den Vars in Ordnung, dann erkläre ich Dir wie ich es (mit noch besserem WAF) gelöst habe.

interessiert.

Gruß,
Christoph

Home und Away funktionieren nun, allerdings noch nicht so richtig… Vielleicht habe ich auch etwas nicht richtig verstanden.

Bisher hatte ich nur ein einziges Profil, nämlich DW. Da nun der manuelle Eingriff am FHT80B funktioniert, habe ich angefangen, Profile zu erstellen.
Wenn imaway TRUE ist, wird automatisch die korrekte Temperatur aus dem Profil „WW“ übernommen. Wenn imahome TRUE ist, wird die Temperatur aus aus „IW“ übernommen.
Wenn aber imaway und imhome beide FALSE sind, greift bei mir automatisch die „IW“ Einstellung obwohl - wenn ich es richtig verstanden habe - die „DW“ Einstellung aktiv werden müsste. Wo ist das Problem?

Das sFHTs-Script wird nun ja auch von „imaway“ und „imhome“ getriggert. Wenn ich jetzt beispielsweise „imhome“ auf TRUE setze, ändert sich die Variable vcs1_temp_soll auf den entsprechenden Wert - ohne jedoch, dass es an das FHT80B gesendet wird. die vcs1_temp_state und _state_r bleiben unverändert. Ist meine Variablenzuordnung vielleicht immer noch nicht in Ordnung?

So langsam bin ich am Verzweifeln mit dem Script… :confused:

Gruß,
Christoph

PS: Setzt nur Fabian das Script ein?

Hallo,

es freut mich, dass es jetzt so weit funktioniert.

Zum Lock:
Ich versuche es mal zu beschreiben und an meinem Script zu erläutern. Wegen dem Umfang Aufteilung auf zwei Posts.
Als erstes muss für jede Instanz eine weitere Bool-Var mit dem Präfix „_lock“ angelegt werden.
Dann lege ich eine Var für die Sperrzeit an:

// aktor-lock
$lock_time = 30; //Locktime in Minuten bei Nacht
if (!GetValueBoolean("__fht_night"))
   $lock_time = GetValueInteger("__fht_lockduration"); //Lock-Zeit Tagzeit setzen

hier wird von 30 Minuten in der Nacht und der in der StatusVariable „__fht_lockduration“ stehenden Lock-Zeit am Tag ausgewählt. Werte kann man auch dierkt ins Script schreiben. Für eine Steuerung mittels grafischer Oberfläche muss alles variabel sein. :smiley: Tag-Nacht-Steuerung über die StatusVar „__fht_night“ (z. B. mit Timer gesetzt, bei mir ist Nacht von 22:00 bis 07:00 Uhr)

nach dem Öffnen des Log-File ermittle ich erstmal, ob der Raum gegen Verstellung gesperrt ist - Lock - und prüfe das Rücksetzen. Zusätzlich wird die _state Temp ausgelesen und im $aktor-Array mit untergebracht:

/ open logfile
$handle = fopen("$logfilepath","a");
// aktuellen State auslesen für Flank-Detection und Lock Steuerung
foreach($fht_instances as $instance)
{
   $aktor[$instance]["state"] = GetValueFloat($instance."_temp_state"); //aktueller state für Vergleich
   $aktor_lock_ID = IPS_GetVariableID($instance."_temp_lock");
   $aktor_lock = GetValue($aktor_lock_ID);

   // Update-Zeit für state-var bestimmen und Aktor-lock zurück setzen
   $vUpdateTime = IPS_GetVariable(IPS_GetVariableID($instance."_temp_state"));
   //if ($ldebug) print_r($vUpdateTime);
   $vUpdateTimeDiff = (date("U") - $vUpdateTime["VariableUpdated"])/60; // Zeit in Minuten
	//$vUpdateTime = (date("U")-IPS_GetUpdateTime($instance."_temp_state"))/60; // Zeit in Minuten  ***** alte Vaersion aus V1, in V2.0 kein GetUpdateTime... ******
   if (($vUpdateTimeDiff > $lock_time || $aktor[$instance]["state"] == floatval($aktor[$instance]["soll"])) && $aktor_lock)
   {
      SetValue($aktor_lock_ID, false); // reset lock
      fwrite($handle,  date("d.m.y")."  ". date("H:i:s")."  Lock for room $instance is reset to use automatic
");
   }
}

Die Variable $instance entspricht der $key-Var weiter unten aus

foreach($aktor as $key => $value)

Aus heutiger Sicht würde ich es mit einbauen, aber damals habe ich als php-Neuling alles getrennt entwickelt… :rolleyes:

  1. Teil:

jetzt wird es haarig:
Der untere Teil sieht bei mir so aus:

// GET ALL AKTORS OUT OF ARRAY["AKTOR","SOLL"] = nice result of all the -above- work
// loop here : for every aktor in array : setTemp(Aktor, argument);
$junk = 1;
foreach($aktor as $key => $value)
{
   SetValueFloat($key."_temp_soll",floatval($value["soll"]));
   if ($ldebug) echo("FHT temp for '$key"."_temp_soll' set to '".$value["soll"]."' !!
");


	// get aktor-lock Value of current aktor ($key)
   $aktor_lock_ID = IPS_GetVariableID($key."_temp_lock");
   $aktor_lock = GetValue($aktor_lock_ID);
   
   // as the result of the function set aktors to soll
   $thisinstance = "o" . substr($key,1)."_temp";
   if (!defined($thisinstance)) {
      echo("

******* NOTICE: FHT-ID ($thisinstance) not defined in GlobalDefines.ips.php

");
   } elseif (!IPS_ObjectExists(constant($thisinstance))) {
      echo("

******* NOTICE: FHT with ID '". constant($thisinstance) . "' is not a valid instance in IPS.

");
   } else {
      if ($IPS_SENDER == "Variable") {
         if (IPS_GetName($IPS_VARIABLE) == "__imhome" || IPS_GetName($IPS_VARIABLE) == "__imaway" || IPS_GetName($IPS_VARIABLE) == "__party"){
            if ($softswitch) FHT_SetTemperature(constant($thisinstance),floatval($value["soll"]));
            if ($ldebug) echo("FHT_SetTemp for $thisinstance $neg SENT due to" .IPS_GetName($IPS_VARIABLE). "-trigger
");
            if ($ldebug) fwrite($handle, date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - FHT_SetTemp for $thisinstance $neg SENT due to" .IPS_GetName($IPS_VARIABLE). "-trigger
");
         } else {
            if (IPS_GetName($IPS_VARIABLE) == $key."_temp_state")
            {
               if (floatval($value["soll"]) <> $value["state"]) // manuelle Betätigung am FHT > wenn Abweichung vom soll, lock setzen
               {
                  fwrite($handle,  date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - $thisinstance is set EXTERNALLY to " . GetValueFloat($key."_temp_state") . "°C due to ".IPS_GetName($IPS_VARIABLE)."-trigger (no value sent... logging only)
");
 						SetValue($aktor_lock_ID, true); // lock auf Raum setzen
                  fwrite($handle,  date("d.m.y")."  ". date("H:i:s")."  room $key is locked on " . GetValueFloat($key."_temp_state") . "°C for $lock_time minutes
");
						IPS_RunScriptEx(@IPS_GetScriptID($StatusScriptName), Array("fht_Name" => $thisinstance));
               }
               else
               {
                  if ($ldebug) fwrite($handle,  date("d.m.y")."  ". date("H:i:s")."  *** $IPS_SENDER  - $thisinstance is set to requested value: " . GetValueFloat($key."_temp_state") . "°C
");
               }
            }
         }
      } elseif ($IPS_SENDER == "TimerEvent") {
         // only set soll-temp if there are changes required (flank-detection) to reset manual intervention
         $res_temp = $value["soll"];
         if ($ldebug) echo("Trigger : TimerEvent, Is '" . $value["soll"] . "' = '" . $value["state"] . "' ?
");
         if (floatval($value["soll"]) <> $value["state"] && !$aktor_lock)
         {
            //flank detected
            if ($softswitch) FHT_SetTemperature(constant($thisinstance),floatval($value["soll"]));
            IPS_Sleep(1000); // Zeit für tx_control Script
            if ($ldebug) echo("FHT_SetTemp for $thisinstance $neg SENT due to change of setting (flank detection).
");
            if ($ldebug) fwrite($handle, date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - FHT_SetTemp for $thisinstance $neg set to $res_temp °C due to change of setting (flank detection).
");
         }
         elseif (floatval($value["soll"]) <> $value["state"] && $aktor_lock)
         {
            fwrite($handle, date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - FHT_SetTemp for $thisinstance not set to $res_temp °C due to lock of room.
");
         }
      } else {
         //manual exec.
         if ($softswitch) FHT_SetTemperature(constant($thisinstance),floatval($value["soll"]));
         if ($ldebug) echo("FHT_SetTemp for $thisinstance $neg SENT due to manual-exec.
");
         if ($ldebug) fwrite($handle, date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - FHT_SetTemp for $thisinstance $neg SENT due to manual-exec.
");
      }
   }
   // ugly way to handle FHZ buffer issues
   // should be done by multiple passes so max 6 commands every 6 minutes
   // multiple passes ToDo
   // Paresy talked about a FHT1000 buffer; maybe there is a way to deal with this??
   if (bcmod($junk, 6) == 0) IPS_Sleep(1000*10); // wait 10 seconds FHZbuffer !!;
   $junk += 1;
}

Ich hoffe, es klappt so, musste vieles ändern, was ich zusätzlich angepasst habe. Da kann man schnell mal was übersehen.

Passend dazu mal ein Auszug aus meiner TempSent.txt:

22.02.09  10:31:16  *** Variable  - owzo_temp is set to requested value: 20°C
22.02.09  10:31:16*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  10:46:43  Variable  - owzo_temp is set EXTERNALLY to 22°C due to vwzo_temp_state-trigger (no value sent... logging only)
22.02.09  10:46:43  room vwzo is locked on 22°C for 90 minutes
22.02.09  10:46:43*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  11:00:43  Lock for room vkuo is reset to use automatic
22.02.09  11:00:43  Lock for room vbao is reset to use automatic
22.02.09  11:00:43  TimerEvent  - FHT_SetTemp for owzo_temp not set to 20 °C due to lock of room.
22.02.09  11:00:44  TimerEvent  - FHT_SetTemp for okuo_temp  set to 21 °C due to change of setting (flank detection).
22.02.09  11:00:45  TimerEvent  - FHT_SetTemp for obao_temp  set to 21 °C due to change of setting (flank detection).
22.02.09  11:00:45*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  11:01:28  *** Variable  - okuo_temp is set to requested value: 21°C
22.02.09  11:01:28*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  11:01:49  *** Variable  - obao_temp is set to requested value: 21°C
22.02.09  11:01:49*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  11:30:49  TimerEvent  - FHT_SetTemp for owzo_temp not set to 20 °C due to lock of room.
22.02.09  11:30:50  TimerEvent  - FHT_SetTemp for okuo_temp  set to 22 °C due to change of setting (flank detection).
22.02.09  11:30:50*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  11:32:16  *** Variable  - okuo_temp is set to requested value: 22°C
22.02.09  11:32:16*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  11:45:44  Variable  - okuo_temp is set EXTERNALLY to 20°C due to vkuo_temp_state-trigger (no value sent... logging only)
22.02.09  11:45:44  room vkuo is locked on 20°C for 90 minutes
22.02.09  11:45:44*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  12:00:44  TimerEvent  - FHT_SetTemp for owzo_temp not set to 21 °C due to lock of room.
22.02.09  12:00:44  TimerEvent  - FHT_SetTemp for okuo_temp not set to 22 °C due to lock of room.
22.02.09  12:00:44*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  12:30:44  Lock for room vwzo is reset to use automatic
22.02.09  12:30:45  TimerEvent  - FHT_SetTemp for owzo_temp  set to 21 °C due to change of setting (flank detection).
22.02.09  12:30:45  TimerEvent  - FHT_SetTemp for okuo_temp not set to 22 °C due to lock of room.
22.02.09  12:30:45*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  12:33:05  *** Variable  - owzo_temp is set to requested value: 21°C
22.02.09  12:33:05*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  12:49:20  Variable  - okuo_temp is set EXTERNALLY to 19°C due to vkuo_temp_state-trigger (no value sent... logging only)
22.02.09  12:49:20  room vkuo is locked on 19°C for 90 minutes
22.02.09  12:49:20*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  13:00:20  TimerEvent  - FHT_SetTemp for okuo_temp not set to 21 °C due to lock of room.
22.02.09  13:00:20*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  13:15:36  Variable  - owzo_temp is set EXTERNALLY to 22.5°C due to vwzo_temp_state-trigger (no value sent... logging only)
22.02.09  13:15:36  room vwzo is locked on 22.5°C for 90 minutes
22.02.09  13:15:36*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  13:30:35  TimerEvent  - FHT_SetTemp for owzo_temp not set to 21 °C due to lock of room.
22.02.09  13:30:35  TimerEvent  - FHT_SetTemp for okuo_temp not set to 21 °C due to lock of room.
22.02.09  13:30:35*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  14:00:35  TimerEvent  - FHT_SetTemp for owzo_temp not set to 22 °C due to lock of room.
22.02.09  14:00:35  TimerEvent  - FHT_SetTemp for okuo_temp not set to 21 °C due to lock of room.
22.02.09  14:00:35*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  14:30:36  Lock for room vkuo is reset to use automatic
22.02.09  14:30:36  TimerEvent  - FHT_SetTemp for owzo_temp not set to 23 °C due to lock of room.
22.02.09  14:30:37  TimerEvent  - FHT_SetTemp for okuo_temp  set to 22 °C due to change of setting (flank detection).
22.02.09  14:30:37*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  14:31:00  Variable  - owzo_temp is set EXTERNALLY to 21.5°C due to vwzo_temp_state-trigger (no value sent... logging only)
22.02.09  14:31:00  room vwzo is locked on 21.5°C for 90 minutes
22.02.09  14:31:00*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  14:31:19  *** Variable  - okuo_temp is set to requested value: 22°C
22.02.09  14:31:19*** *** *** *** *** *** *** *** *** *** *** *** ***
22.02.09  14:35:10  Variable  - okuo_temp is set EXTERNALLY to 21°C due to vkuo_temp_state-trigger (no value sent... logging only)
22.02.09  14:35:10  room vkuo is locked on 21°C for 90 minutes
22.02.09  14:35:10*** *** *** *** *** *** *** *** *** *** *** *** ***

Die Lockzeit ist nicht genau 90 min. Es ist immer die Lock-Time + die Rest-Laufzeit bis zur nächsten (planmäßigen) Ausführung.

Grüße
prof

PS: ich hoffe, die Admins verlangen nicht noch Miete für meinen exzessiven Platzverbrauch… :rolleyes:

Gut, das werde ich mir in einer ruhigen Minute mal ansehen :slight_smile:

Problem ist jetzt nur noch - wie oben beschrieben:
Temperatur wird nur noch bei Änderungen in der tempsettings.ini oder beim Drehen am Rad gesendet. Nicht aber beim Ändern der Variablen imhome oder imaway. Wird nach dem Ändern der Variablen am Rad gedreht oder es tritt eine Änderung in der tempsettings.ini ein, so läuft wieder alles.

Sendet das Script eine Änderung, so ändert sich die vcs1_temp_state und die Änderung wird ans FHT gesendet. Senden die Variablen imhome oder imaway eine Änderung, ändert sich nur die vcs1_temp_soll und die Änderung wird nicht gesendet. Im Zimmer bleibts dann logischerweise kalt :slight_smile:

Wo liegt der Fehler?

Gruß,
Christoph

poste mal das aktuelle Script…

Nachdem ich bis eben dran gesessen habe, habe ich den Fehler hoffentlich gefunden. Das Script reagiert nun auch auf Änderung der Variablen „imhome“, „imaway“ und „party“ indem es die Temperatur nicht nur in die „vcs1_soll_temp“ reinschreibt, sondern auch an das FHT80B sendet.

Irgendwo bei Zeile 376 hieß es:

if ($IPS_SENDER == "Variable")
  if ($IPS_VARIABLE == "__imhome" || $IPS_VARIABLE == "__imaway" || $IPS_VARIABLE == "__party"){

Geändert in

if ($IPS_VARIABLE == $V_IMHOME || $IPS_VARIABLE == $V_IMAWAY || $IPS_VARIABLE == $V_PARTY){

und schon läufts. Die Variablen $V_IMHOME etc. definiere ich ganz oben im Script. Sie enthalten die IDs ver Variablen.

Wenn ich das richtig beobachte, habe ich nun „nur noch“ folgendes Problem:

Bisher hatte ich nur ein einziges Profil, nämlich DW. Da nun der manuelle Eingriff am FHT80B funktioniert, habe ich angefangen, Profile zu erstellen.
Wenn imaway TRUE ist, wird merkwürgerweise die Temperatur aus dem Profil „DW“ übernommen. Wenn imahome TRUE ist, wird die Temperatur aus aus „IW“ übernommen, was ja auch korrekt ist.
Wenn aber imaway und imhome beide FALSE sind, greift bei mir automatisch die „IW“ Einstellung obwohl - wenn ich es richtig verstanden habe - die „DW“ Einstellung aktiv werden müsste. Wo ist das Problem?

Ich werde morgen mal weitertesten, wie sich das Script nun verhält…

Gruß,
Christoph

Hier noch einmal alles:

<?

 /*
*******************************
 IP-SYNCOM Event Scripting
*******************************
*/
//File: sFHTs.ips.php   PUBLIC       : 0.70   date  08/11/06
//File: sFHTs.ips.php   BETA VERSION : 0.69   date  04/11/06 '7' settings in .ini weekend bad interpret bug by Prof
//File: sFHTs.ips.php   BETA VERSION : 0.68   date  01/11/06 flank-detection problem due to TimerEvent and RunScript
//File: sFHTs.ips.php   BETA VERSION : 0.67   date  29/10/06 flank-detection doesn't work in S regime. bug by Torsteng
//File: sFHTs.ips.php   BETA VERSION : 0.66   date  18/06/06 Back to basic - no good
//File: sFHTs.ips.php   BETA VERSION : 0.65   date  18/06/06 semaphore test
//File: sFHTs.ips.php   BETA VERSION : 0.64   date  17/06/06 debug switch
//File: sFHTs.ips.php   PUBLIC       : 0.63   date  23/01/06
//
//Events : __imhome, __imaway, __party and all FHT_status-intervention variables
/*
Copyright rules applie under GNU-regulations
rest of copyright text ToDo
*/

// Variablen
$V_IMHOME = 18357 /*[OG\Zimmer CS\Heizung\Variablen\__imhome]*/ ;
$V_IMAWAY = 18351 /*[OG\Zimmer CS\Heizung\Variablen\__imaway]*/ ;
$V_PARTY = 48393 /*[OG\Zimmer CS\Heizung\Variablen\__party]*/ ;
$V_INHIBIT = 13117 /*[OG\Zimmer CS\Heizung\Variablen\__fht_inhibit]*/ ;
$V_DEBUG = 41022 /*[OG\Zimmer CS\Heizung\Variablen\__debug]*/ ;


include("GlobalDefines.ips.php");
   /* variables needed in GlobalDefines.ips.php !!
      see "tempsettings.ini" and modifie to your environment /*

   /**********  USER SETTINGS  ***********************************************/
   $tempfilepath=__myhome."tempsettings.ini"; //default: 'tempsettings.ini'
   //              |---> defined in GlobalDefines.ips.php

   $use_imhome = true;
   // Note : A IPS variabele '__iamhome' should exist !!
      /* use this switch to overrule general settings
      the effect is that if IPS-variable "__imhome" = true
      the HOLIDAY temperature is sent as the result of
      this function
      !! ATTENTION  BETA WORK !!
      19/11/2005 :  I am not happy with how this implemented but it's a start
      */

   $use_imaway = true;
   // Note : A IPS variabele '__iamaway' should exist !!
      /* use this switch to overrule general settings
      the effect is that if IPS-variable "__imaway" = true
      the AWAY temperature is sent as the result of
      this function
      !! ATTENTION  BETA WORK !!
      */

   $use_party = true;
   // Note : A IPS variabele '__party' should exist !!
      /* For all the party people out there ;-)
      Do YOU Like the Way YOU Feel when YOU Shake
      the effect is that if IPS-variable "__party" = true
      the party settings applie without checking days or dates.
      So starting on a Saturday will set party temperatures until
      you set __party=false on the Wednesday. (Oh my God what a party)
      */
   /**********  END OF USER SETTINGS  ****************************************/

   /**********  ADAPTATION TO YOUR ENVIROMENT  *******************************
   Every FHT has to have 2 variables with the names hereunder
   v(your-name)_soll : f.i. "vliv_temp_soll" = FHT soll temp in livingroom
   o(your-name)      : f.i. "oliv_temp" = device ID of the
                            FHT instance (set in GlobalDefines.ips.php)
   ***********  END ADAPTATION  **********************************************/

   /**********  DEBUG SWITCHES  **********************************************/
   $softswitch = true; /*    Send the temp-settings to FHT or not
                             If you're debugging set it to false
                             so FHZ won't be overbuffered            */
   $use_sollwert = false;
   $sollwert = "14";      //is 'use_sollwert' = true then take this value

   // if you want a master-debug switch : create an IPS variabele "__debug"
   if (IPS_VariableExists($V_DEBUG)){
      $debug = GetValueBoolean($V_DEBUG);
   } else {
      $debug = true;   // set to true if you want to enable echo-output
   }
   /* logfilepath since we are dealing with variables which cannot be show in
      the direct output window.                                              */
   $logfilepath=__mylogs."Heizung/tempSENT.txt";

//   $IPS_SENDER = "TimerEvent";

   /**********  END DEBUG  ***************************************************/

if ($IPS_SENDER == "Designer"){
//do not run when event is triggered by designer
   return;
}
if (IPS_VariableExists($V_INHIBIT)){
   if (GetValueBoolean($V_INHIBIT)){
      if($debug) echo("INHIBITED by '__fht_inhibit'");
      return;
   }
}
if ($IPS_SENDER == "Variable"){
   /* Switch ONLY when __imaway becomes true or __imhome becomes true
      die if false -> script will be triggered in max 30 minutes.
      if settings change from imhome -> imaway, then FHZ buffer get's
      overbuffered because script did run 2 times
      imhome -> false, imaway -> true x 5 FHT-devices = buffer overrun */
   if ($IPS_VARIABLE == "__imaway" && !GetValueBoolean($V_IMAWAY)) die;
   // die when imhome = false
   if ($IPS_VARIABLE == "__imhome" && !GetValueBoolean($V_IMHOME)) die;
   if ($IPS_VARIABLE == "__party" && !GetValueBoolean($V_PARTY)) die;
   //$lastrun=IPS_GetLastRun("GetTemp");
}
if (!file_exists("$tempfilepath")) {
   echo("

******* ERROR: Please install '$tempfilepath'

");
   die;
}
if (!file_exists("$tempfilepath")) {
   echo("

******* ERROR: Please install '$tempfilepath'

");
   die;
}
$handle=fopen("$tempfilepath", "r");
if (!$handle){
   // error cannot open file
   echo("******* ERROR: Cannot open file '$tempfilepath'
");
}
//init variable
$aktor = array();
$now = getdate();
$isholiday = false;
$isparty = false;
$holiday="";
$season = "";
$today="";
$alldays="";
$weekend="";
$imhome=false;
$party=false;
$temp_rule="";
if ($use_imhome && IPS_VariableExists($V_IMHOME)){
   $imhome = GetValueBoolean($V_IMHOME);
} elseif ($use_imhome) {
   echo("

******* NOTICE: Variabele '__imhome' not found as a valid IPS variabele

");
   $imhome = false;
} else {
   $imhome = false;
}
if ($use_imaway && IPS_VariableExists($V_IMAWAY)){
   $imaway = GetValueBoolean($V_IMAWAY);
} elseif ($use_imaway) {
   echo("

******* NOTICE: Variabele '__imaway' not found as a valid IPS variabele

");
   $imaway = false;
} else {
   $imaway = false;
}
if ($use_party && IPS_VariableExists($V_PARTY)){
   $party = GetValueBoolean($V_PARTY);
} elseif ($use_party) {
   echo("

******* NOTICE: Variabele '__party' not found as a valid IPS variabele

");
   $party = false;
} else {
   $party = false;
}

// the serious work   start with settin' the inhibit switch
SetValueBoolean($V_INHIBIT,true);
// end modifie

while(!feof($handle)) {
   $buffer = fgets($handle);
   Switch (substr($buffer,0,1)) {
   case "@":
      //general settings
      if (substr($buffer,1,7) == "season=") {
         $season = substr($buffer,8,1);
      }
      if (substr($buffer,1,1) == "H") {
         if ((sprintf("%02d",$now["mon"])."/".sprintf("%02d",$now["mday"]) == substr($buffer,2,5)) or (sprintf("%02d",$now["mon"])."/".sprintf("%02d",$now["mday"])."/".$now["year"] == substr($buffer,2,10))) {
            $isholiday = true;
            $temp_rule = substr($buffer,strpos($buffer,"#")+1,strlen($buffer)-strpos($buffer,"#")-3);
            if ($debug) echo "temp rule : $temp_rule";
         }
      }
      break;
   case "D":
      //DEFAULT lines
      if (substr($buffer,1,1) == "$season" && chop(substr($buffer,4,14))=="default"){
          // get default default or default room
          // aktor("default" -> $default OR "room" -> $default)
          $default = substr($buffer,27,48);
      } elseif (substr($buffer,1,1) == "$season") {
         $aktor[chop(substr($buffer,4,14))]["default"] = substr($buffer,27,48);
      }
      break;
   case "H":
      //HOLIDAY table entries
      if ($isholiday) {
         // NOTE THEM DOWN IN array[aktor,["holiday"]
         if (substr($buffer,1,1) == "$season") $aktor[chop(substr($buffer,4,14))]["holiday"]= substr($buffer,27,48);
      } else {
         if (substr($buffer,1,1) == "$season") $aktor[chop(substr($buffer,4,14))]["iamhome"]= substr($buffer,27,48);
      }
      break;
   case "I":
      //Table entries
      // GET RID OF THIS INSTRUCTION    GET THEM ALLL ;-)
      // array[substr(....),alldays, weekends, thisday]
      // ???? Should we apply precendence RULE here ??
      // WE SHOULD HAVE ALL INFO --> see tempfile.ini
      // SO HERE WE DEPEND THE RULE TO APPLY
      // WHAT IF NOT ?? NO APPLICABLE ENTRY ?? THEREFORE ALL THESE IF INSTRUCTIONS
         if ((substr($buffer,1,1) == "$season") and (substr($buffer,2,1) == "9")) $aktor[chop(substr($buffer,4,14))]["alldays"] = substr($buffer,27,48);
         if ((substr($buffer,1,1) == "$season") and (substr($buffer,2,1) == "7") and (($now["wday"] == 0) or ($now["wday"] == 6))) $aktor[chop(substr($buffer,4,14))]["weekend"] = substr($buffer,27,48);
         if ((substr($buffer,1,1) == "$season") and (substr($buffer,2,1) == $now["wday"])) $aktor[chop(substr($buffer,4,14))]["today"]= substr($buffer,27,48);
      break;
   case "W":
      // IamAway settings
      if (substr($buffer,1,1) == "$season" && chop(substr($buffer,4,14))=="default"){
          // get default default or default room
          // aktor("default" -> $default OR "room" -> $default)
          if ($imaway) $default = substr($buffer,27,48);
      }
      break;
   case "P":
      // PaAaRtY settings
      // no date-jump will occure !!
      // tryout 26/11/2005
      if (substr($buffer,1,1) == "$season") $aktor[chop(substr($buffer,4,14))]["party"]= substr($buffer,27,48);
      break;
   default:
      //only thing to expect are comments '#' and temp settings
      // PUT IN ARRAY !!! WE NEED THEM LATER
      // USE array[sign => value]
      if (substr($buffer,0,1) <> "#") {
         $temp[substr($buffer,0,1)] = substr($buffer,1,5);
      }
   }
}
$temp["0"]=false;
$temp["1"]=true;
fclose($handle);
if ($debug) {
   foreach($aktor as $key => $value){
      $thisday = $now["wday"];
      if ($debug) echo("
RESULT for '$key'
--------
");
      if ($debug) echo("  now             :'". $now["hours"] .":". $now["minutes"] . "'
");
      if ($debug) echo("  today is nr#    : $thisday
");
      if ($debug) echo("  season          : $season
");
      if ($debug) echo("  Is it a holiday : $isholiday
");
      if ($debug) echo("  Check precendence hereunder
");
      if ($debug) echo("  Am I home ?     : $imhome
");
      if(array_key_exists("iamhome",$value) && $debug)echo("  IAmHome         : ".$aktor[$key]["iamhome"]."
");
      if ($debug) echo("  Am I away ?     : $imaway
");
      if(array_key_exists("iamaway",$value) && $debug)echo("  IAmAway         : ".$aktor[$key]["iamaway"]."
");
      if(array_key_exists("holiday",$value) && $debug)echo("  holiday         : ".$aktor[$key]["holiday"]."
");
      if ($debug) echo("  Paaaartyy ?     : $party
");
      if(array_key_exists("party",$value) && $debug)echo("  Party           : ".$aktor[$key]["party"]."
");
      if(array_key_exists("today",$value) && $debug)echo("  today           : ".$aktor[$key]["today"]."
");
      if(array_key_exists("weekend",$value) && $debug)echo("  weekends        : ".$value["weekend"]."
");
      if(array_key_exists("alldays",$value) && $debug)echo("  alldays         : ".$aktor[$key]["alldays"]."
");
      if(array_key_exists("default",$value) && $debug)echo("  default rule    : ".$aktor[$key]["default"]."
");
      if ($debug) echo("  def. def. rule: $default
");
      if ($debug) echo("--------------------------------------------------
");
   } //for
} //if
/* precendence rules
   ON ALL ELEMENTS OF ARRAY = Aktors
   VARIABLES = FIELDS OF ARRAY ("AKTOR" [ROOMDEFAULT, HRule, DayRULE, RESULT, soll)
   NEGATIVE LOGIC    Variables are filled in IF applicable */
if ($debug) echo"

";
foreach($aktor as $key => $value){
   if (!array_key_exists("holiday", $value)) {
      if (!array_key_exists("today", $value)) {
         if (!array_key_exists("weekend", $value)) {
            if (!array_key_exists("alldays", $value)) {
               if (!array_key_exists("default", $value)) {
                  $aktor[$key]["result"] = $default;
                  if ($debug) echo "res = def. def";
               } else {
                  $aktor[$key]["result"] = $value["default"];
                  if ($debug) echo "res = default";
               } // if
            } else {
               $aktor[$key]["result"] = $value["alldays"];
               if ($debug) echo "res = alldays";
            }
         } else {
            $aktor[$key]["result"] = $value["weekend"];
            if ($debug) echo "res = weekend";
         }
      } else {
         $aktor[$key]["result"] = $value["today"];
         if ($debug) echo "res = today";
      }
   } else {
      $aktor[$key]["result"] = $value["holiday"];
      if ($debug) echo "res = holiday";
   }
   // attempt to set IAmHome rule !!
   if ($use_imhome and $imhome) {
      if (array_key_exists("iamhome", $value)){
         $aktor[$key]["result"] = $value["iamhome"];
         echo "
OVERRULED RESULT set to HOLIDAY because I AM HOME
";
      }
   }
   // attemp to set Away-rule
   if ($use_imaway and $imaway) {
      $aktor[$key]["result"] = $default;
      if ($debug) echo ("
OVERRULED RESULT set to AWAY
");
   }
   // attempt to set Party rule !!
   if ($use_party and $party) {
      if (array_key_exists("party", $value)){
         $aktor[$key]["result"] = $value["party"];
         echo "
OVERRULED RESULT set to PaAaRrTYyyyy
";
      }
   }
   if ($debug) echo("
For '$key' I did choose    : '".$aktor[$key]["result"]."'
");
}
// here we get the temperature out of string
// USE ARRAY["AKTOR", "soll"]
// change 11/10/2005 'floor' into 'round' because otherwise allways back to ??h00 instead of ??h00 or ??h30
$pos = $now["hours"]*2 + round($now["minutes"]/30);
$prevpos = $pos - 1;
if ($debug) echo("hours: " . $now["hours"] . " hours *2 = " . $now["hours"]*2 . "round($now[minutes]/30) = " . (round($now["minutes"]/30) . "
"));
if ($debug) echo "pos = '$pos'  (check midnight !!
";
// end change
foreach($aktor as $key => $value){
   $aktor[$key]["soll"] = $temp[substr($value["result"],$pos,1)];
   if ($debug) echo "res  : '" . $value["result"]."'
";
   if ($debug) echo "time : '12345678901234567890123456789012345678'
";
   if ($debug) echo "temp = '" . $aktor[$key]["soll"]."'
";
}
// and now deal with the state-event.
// detect flanks
//if ($temp[substr($value["result"],$pos,1)] <> $temp[substr($value["result"],$pos,1)]){

// 11/10/2005 This is still a burdon !! damn boy ... where do you wanne drive the MIN-TEMP to ? and MAX-TEMP ?
//if ($use_imhome and $imhome) {
//   $soll = $temp["+"];
//   $status = "OVERRULED  set to";
//} elseif ($use_imhome) {
//   $soll = $temp["-"];
//   $status = "OVERRULED  set to";
//} else {
//   $status = substr($result,$pos,1)."     : ";
//}
// 19/11/2005 : decided when 'I am Home' is selected to choose 'holiday'-rule

$handle = fopen("$logfilepath","a");
$neg = "NOT (SSw)";
if ($softswitch) $neg = "";

// GET ALL AKTORS OUT OF ARRAY["AKTOR","SOLL"] = nice result of all the -above- work
// loop here : for every aktor in array : setTemp(Aktor, argument);
$junk = 1;
foreach($aktor as $key => $value){
   if ($use_sollwert) {
      echo("OVERRULED BY use_sollwert");
      $value["soll"]= $sollwert;
   }
   SetValueFloat($key."_soll",floatval($value["soll"]));
   if ($debug) echo("FHT temp for '$key"."_soll' set to '".$value["soll"]."' !!
");
   // as the result of the function set aktors to soll
   $thisinstance = "o" . substr($key,1);
   if (!defined($thisinstance)) {
      echo("

******* NOTICE: FHT-ID ($thisinstance) not defined in GlobalDefines.ips.php

");
   } elseif (!IPS_InstanceExists(constant($thisinstance))) {
      echo("

******* NOTICE: FHT with ID '". constant($thisinstance) . "' is not a valid instance in IPS.

");
   } else {
      if ($IPS_SENDER == "Variable") {
			// geändert, da Triggern auf imaway etc nichts gebracht hat.
			//if ($IPS_VARIABLE == "__imhome" || $IPS_VARIABLE == "__imaway" || $IPS_VARIABLE == "__party"){
			if ($IPS_VARIABLE == $V_IMHOME || $IPS_VARIABLE == $V_IMAWAY || $IPS_VARIABLE == $V_PARTY){
            if ($softswitch) FHT_SetTemperature(constant($thisinstance),floatval($value["soll"]));
            if ($debug) echo("FHT_SetTemp for $thisinstance $neg SENT due to '$IPS_VARIABLE'-trigger
");
            if ($debug) fwrite($handle, date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - FHT_SetTemp for $thisinstance $neg SENT due to '$IPS_VARIABLE'-trigger
");
         } else {
            if ($debug) fwrite($handle,  date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - $thisinstance is set EXTERNALLY to " . GetValueFloat($key."_state") . "°C due to '$IPS_VARIABLE'-trigger (no value sent... logging only)
");
         }
//       Zeile geändert da manuelles Drehen am Rad nicht funktioniert hat
//      } elseif ($IPS_SENDER == "RunScript") {
      } elseif ($IPS_SENDER == "TimerEvent") {
         // only set soll-temp if there are changes required (flank-detection) to reset manual intervention
         if ($debug) echo("Trigger : timerevent, Is '" . $temp[substr($value["result"],$pos,1)] . "' = '" . $temp[substr($value["result"],$prevpos,1)] . "' ?
");
         if ($temp[substr($value["result"],$pos,1)] <> $temp[substr($value["result"],$prevpos,1)]){
            //flank detected
            if ($softswitch) FHT_SetTemperature(constant($thisinstance),floatval($value["soll"]));
            if ($debug) echo("FHT_SetTemp for $thisinstance $neg SENT due to change of setting (flank detection).
");
            if ($debug) fwrite($handle, date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - FHT_SetTemp for $thisinstance $neg SENT due to change of setting (flank detection).
");
         } else {
            if ($debug) fwrite($handle, date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER  - No flank detected for $thisinstance.
");
         }
      } else {
         //manual exec.
         if ($softswitch) FHT_SetTemperature(constant($thisinstance),floatval($value["soll"]));
         if ($debug) echo("FHT_SetTemp for $thisinstance $neg SENT due to manual-exec.
");
         if ($debug) fwrite($handle, date("d.m.y")."  ". date("H:i:s")."  $IPS_SENDER/MANUAL - FHT_SetTemp for $thisinstance $neg SENT due to manual-exec.
");
      }
   }
   // ugly way to handle FHZ buffer issues
   // should be done by multiple passes so max 6 commands every 6 minutes
   // multiple passes ToDo
   // Paresy talked about a FHT1000 buffer; maybe there is a way to deal with this??

   // removed in version: 0.66 FHT-buffer now in place
   //if (bcmod($junk, 6) == 0) IPS_Sleep(1000*10); // wait 10 seconds FHZbuffer !!;
   //$junk += 1;
}
// 2006/05/30 modifie due to multi-hreads
SetValueBoolean($V_INHIBIT,false);
// 2006/05/30 end modifie
if ($debug) echo("Finished 
");
if ($debug) fclose($handle);

?>

Nachdem ich das Script nun den halben Nachmittag beobachtet habe, haben sich erstmal keine weiteren Fehler ergeben.

Wenn nun noch die Heizprofile korrekt funktionieren, ist das leidige Thema endlich abgeschlossen :slight_smile:

Gruß,
Christoph

Hallo Christoph,

Auf den ersten Blick würde ich sagen, dass alles ok ist. Bei dem Umfang ist das aber nicht so einfach…

Ungefähr in der Mitte gibt es einen großen zusammenhängenden Debug-Block. Hier wird der ausgelesene Zustand aller Variablen klar dargestellt und der Vorrang beschrieben. Also „Debug ON“ und Ausgaben im Log genau prüfen.

Auch würde ich hier an den entscheidenden Stellen (z. B. Einlesen der Tempsettings) weitere Debug-Ausgaben einfügen, um alle Vorgänge bis ins Detail zu erfassen.

Wichtig ist es, den Aufbau und die Syntax der Tempsettings-Datei genau zu kennen und einzuhalten. Viele schieben hier und da mal Leerzeichen (z. B. zur besseren Lesbarkeit) ein. Mal zufällig, mal absichtlich aber arglos. Das ist nur eine der möglichen Fehlerquellen… :confused:

Grüße
Fabian

Hallo Fabian,

die Syntax der tempsettings.ini habe ich mit gerade mal angeschaut, dort ist alles in Ordnung.

Ich habe den Verdacht, dass ich die Kompatibilität mit V2 noch nicht komplett hergestellt habe … Ich habe folgenden Code (irgendwo bei Zeile 113) im Veracht:

   if ($IPS_VARIABLE == "__imaway" && !GetValueBoolean($V_IMAWAY)) die;
   // die when imhome = false
   if ($IPS_VARIABLE == "__imhome" && !GetValueBoolean($V_IMHOME)) die;
   if ($IPS_VARIABLE == "__party" && !GetValueBoolean($V_PARTY)) die;

Ich werde mal weiter forschen… Meine PHP Kenntnisse halten sich bei solch umfangreichen Scripts leider in Grenzen :wink:

Gruß,
Christoph

Du hast doch selber Variablen geändert z.B. diese

$V_IMHOME

usw… folglich musst Du das ganze Script entsprechend anpassen.

Wenn man so ein komplexes Script selber ändert nimmt man am besten Notepad++ dort kann man alle Namensänderungen in einem Rutsch machen.

Hallo zusammen,

aktueller Stand ist, nachdem ich den o.g. Code angepasst habe, dass

Switch ONLY when __imaway becomes true or __imhome becomes true
      die if false -> script will be triggered in max 30 minutes.

nun auch zutrifft.

Das eigentliche Problem mit den Heizprofilen konnte ich detaillierter beobachten:

IMAWAY = TRUE und IMHOME = FALSE --> Default-Heizprofil --> müsste aber AWAY-Profil sein
IMAWAY = FALSE und IMHOME = FALSE --> HOME-Heizprofil --> müsste aber Default-Profil sein, oder?
IMAWAY = FALSE und IMHOME = TRUE --> HOME-Heizprofil --> korrekt

So viel zum Stand der Dinge.

Gruß,
Christoph

poste mal die Log-Ausgabe bei aktiviertem Debug

Wenn ich AWAY = TRUE setze:

RESULT for 'vcs1_temp'
--------
  now             :'17:39'
  today is nr#    : 5
  season          : W
  Is it a holiday : 
  Check precendence hereunder
  Am I home ?     : 
  Am I away ?     : 1
  Paaaartyy ?     : 
  Party           : RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
  alldays         : ||||||||||||OOOOOOOOOOOOOOOOOOOOO++++++++++++OO|
  def. def. rule: ||||||||||||OO||||||||O|||||||||OOO||||||||OO|||
--------------------------------------------------


res = alldays
OVERRULED RESULT set to AWAY

For 'vcs1_temp' I did choose    : '||||||||||||OO||||||||O|||||||||OOO||||||||OO|||'
hours: 17 hours *2 = 34round(39/30) = 1
pos = '35'  (check midnight !!
res  : '||||||||||||OO||||||||O|||||||||OOO||||||||OO|||'
time : '12345678901234567890123456789012345678'
temp = '18.00'
FHT temp for 'vcs1_temp_soll' set to '18.00' !!
FHT_SetTemp for ocs1_temp  SENT due to '18351'-trigger
Finished 

Fehler wie beschrieben:
Default-Heizprofil wird ausgewählt → müsste aber AWAY-Profil sein

Wenn ich HOME = TRUE setze:

RESULT for 'vcs1_temp'
--------
  now             :'17:39'
  today is nr#    : 5
  season          : W
  Is it a holiday : 
  Check precendence hereunder
  Am I home ?     : 1
  Am I away ?     : 
  Paaaartyy ?     : 
  Party           : RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
  alldays         : ||||||||||||OOOOOOOOOOOOOOOOOOOOO++++++++++++OO|
  def. def. rule: ||||||||||||OO||||||||O|||||||||OOO||||||||OO|||
--------------------------------------------------


res = alldays
For 'vcs1_temp' I did choose    : '||||||||||||OOOOOOOOOOOOOOOOOOOOO++++++++++++OO|'
hours: 17 hours *2 = 34round(39/30) = 1
pos = '35'  (check midnight !!
res  : '||||||||||||OOOOOOOOOOOOOOOOOOOOO++++++++++++OO|'
time : '12345678901234567890123456789012345678'
temp = '19.50'
FHT temp for 'vcs1_temp_soll' set to '19.50' !!
FHT_SetTemp for ocs1_temp  SENT due to '18357'-trigger
Finished 

Das ist in Ordnung.

Hier die tempsettings.ini

#Season            T T   H 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 
#| day             1 2   O 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 
#|| sensor         x x   U 030303030303030303030303030303030303030303030303
#|| |              x x   R 000000000000000000000000000000000000000000000000
DS  default        x x     ------------------------------------------------
DW  default        x x     ||||||||||||OO||||||||O|||||||||OOO||||||||OO|||
###########################################################################
# ABWESEND - jeden Tag
WW9 vcs1_temp      x x     |||||||||||||||O||||||||OO|||||||O+O||M||M||O|||
###########################################################################
# ANWESEND
IW9 vcs1_temp      x x     ||||||||||||OOOOOOOOOOOOOOOOOOOOO++++++++++++OO|

Gruß,
Christoph

Hallo und sorry für die Wartezeit,

also ich kann zwar grundsätzlich keinen direkten Fehler erkennen, aber wenn eine away-rule aus der tempsettings ausgelesen wird, geschieht dies anscheinend nur bei der default-Einstellung.

   case "W":
      // IamAway settings
      if (substr($buffer,1,1) == "$season" && chop(substr($buffer,4,14))=="default"){
          // get default default or default room
          // aktor("default" -> $default OR "room" -> $default)
          if ($imaway) $default = substr($buffer,27,48);
      }

hier findet nur ein Vergleich nach $season und dem Instanz-Varnamen „default“ statt. Wenn ich das so richtig interpretiere, gibt es damit keine raumgebundene away-rule. Es wird folgerichtig die instanzenunabhängige „default default rule“ ausgewählt.

Um es raumgebunden einzusetzen, musst Du den Teil für away nach dem Vorbild für z. B. party umbauen, sollte kein Problem sein…

Gruß
Fabian

PS: War mir nie wirklich aufgefallen, da ich das Script schon ziemlich zum Anfang auf Datenbank umgebaut habe.