kontinuierliche Temperaturausgabe mit MAX-Thermostaten

Begonnen von Zwer2k, 26 Februar 2013, 01:03:14

Vorheriges Thema - Nächstes Thema

Harald

Guten Morgen Jurij und Matthias,

@Jurij

bei mir funktioniert Dein Script bisher (im Auto- wie auch im Eco-Mode) am besten . Es gibt nur sehr selten ein falsches Setzen der deciredTemperatur. Auch gefällt mir, dass das Script in 99_myUtils.pm steht und nicht andere Module geändert werden müssen, die bei einem Update ggf. überschrieben werden. Wenn die Abfrage des DutyCycle noch eingebunden werden könnte, fände ich das prima.

@ Matthias,

wäre es möglich, 10_MAX.pm oder 00_MAXLAN.pm so zu ändern, dass DutyCycle als Reading z.B. unter Qube verfügbar wäre?

Nachtrag:
Habe gerade nach dem Update gesehen, dass in ml (MAXLAN) dutycycle angezeigt wird, dessen Wert sich auch erhöht, wenn ich auf ein MAX-Gerät schreibe. In Qube gibt es auch ein Reading dutycycle, das aber immer 0 zeigt. Kann ich dutycycle aus ml auslesen und in das Log bzw. Reading von Qube schreiben um es weiter zu verwenden?

So, Das habe ich mit Hilfe von "betateilchen" miitels InternalVal hinbekommen. Im Qube-Log steht jetzt dutycycle und kann weiterverarbeitet werden.

Viele Dank für Eure Arbeiten und viele Grüße

Harald
Router:AVM7590 1&1 FW:FRITZ!OS 07.56 Anbindung:1&1 50/10 Mb/s, WLAN-Repeater 300E
ELV MAX!Cube, 7xThermostat, ECO, RasPi 4B mit bullseye auf Festplatte,
CUL V 1.67, JeeLink v3_10.1c, nanoCUL, 1xS300TH, 4xHMS100T, 4xELRO, 1xTFA, 2xMAX_FK
ELV MAX!1.4.5, FHEM 5.7 auf RasPi, Kostal PIKO plus

andrece

wie kann ich dafür den Plot erstellen???
Danke

LG
andrece

Stephan

Bekomme einen Syntaxerror...

syntax error at ./FHEM/99_myUtils.pm line 80, near "

-----------------------------------
# start-of-template
package main;

use Time::Piece;
$main::NextUpdate = ();

use strict;
use warnings;
use POSIX;

sub
myUtils_Initialize($$)
{
   my ($hash) = @_;
}

# start with your own functions below this line
sub ForceMAXTempUpdate {
  my $UpdateInterval = $_[0];
  my @UpdateThermostat =  @{$_[1]};

  $UpdateInterval++ if ($UpdateInterval % 2 != 0);
  foreach my $therm (@UpdateThermostat) {
    my $curTime = gmtime() + localtime()->tzoffset;
    if ((!defined($main::NextUpdate{$therm}{"NextUpdate"})) || ($curTime>$main::NextUpdate{$therm}{"NextUpdate"})){
      my $th_time = $defs{$therm}{READINGS}{"temperature"}{TIME};
      my $th_val = $defs{$therm}{READINGS}{"desiredTemperature"}{VAL};
      my $th_mode = $defs{$therm}{READINGS}{"mode"}{VAL};
      my $tempTime=Time::Piece->strptime($th_time, "%Y-%m-%d %H:%M:%S");
      my $nextPlan = $tempTime + $UpdateInterval * 60 - 15;
      my $nextUpd = $nextPlan;
      $nextUpd = $nextUpd + 60 * 2 while($curTime->epoch > $nextUpd->epoch);

      if (defined($main::NextUpdate{$therm}{"NextUpdate"})){
        if (!defined($main::NextUpdate{$therm}{"Started"})){
          if ($nextPlan > $main::NextUpdate{$therm}{"NextUpdate"}) {
            $main::NextUpdate{$therm}{"NextUpdate"} = $nextUpd;
            return;
          }
          if (($th_mode eq "auto") || ($th_mode eq "manual")){
            fhem("set ".$therm." desiredTemperature "
                 .($th_mode eq "manual" ? "auto" : "")." ".$th_val);
            $main::NextUpdate{$therm}{"Started"} = $curTime;
            $main::NextUpdate{$therm}{"temp"} = $th_val;
            $main::NextUpdate{$therm}{"mode"} = $th_mode;
          }
        } else {
          my $oldMode = $main::NextUpdate{$therm}{"mode"};
          my $oldTemp = $main::NextUpdate{$therm}{"temp"};
          if ($tempTime > $main::NextUpdate{$therm}{"Started"}){
            if (($th_mode eq ($oldMode eq "auto" ? "manual" : "auto")) && ($th_val eq $main::NextUpdate{$therm}{"temp"})){
              fhem("set ".$therm." desiredTemperature ".($oldMode eq "auto" ? "auto " : "").$oldTemp);
            }
            undef $main::NextUpdate{$therm}{"Started"};
            $main::NextUpdate{$therm}{"NextUpdate"} = $nextUpd;
          } else {
            if ($curTime > $main::NextUpdate{$therm}{"Started"} + 60 * 4) {
              fhem("set ".$therm." desiredTemperature ".($oldMode eq "auto" ? "auto " : "").$oldTemp);
              undef $main::NextUpdate{$therm}{"Started"};
              $main::NextUpdate{$therm}{"NextUpdate"} = $nextUpd;
            }
          }
        }
      } else {
        $main::NextUpdate{$therm} = ();
        $main::NextUpdate{$therm}{"NextUpdate"} = $nextUpd;
      }
      $main::NextUpdate{$therm}{"CurTime"} = $curTime;
    }
  }
}



# behind your last function, we need the following
1;
# end-of-template
</code>
</pre>
</br>
   <b>Defined functions</b><br/><br/>
   <ul>
      <li><b>abstime2rel()</b><br>???</li><br/>
      <li><b>ltrim()</b><br>returns string without leading spaces</li><br/>
      <li><b>max()</b><br>returns the highest value from a given list (sorted alphanumeric)</li><br/>
      <li><b>maxNum()</b><br>returns the highest value from a given list (sorted numeric)</li><br/>
      <li><b>min()</b><br>returns the lowest value from a given list (sorted alphanumeric)</li><br/>
      <li><b>minNum()</b><br>returns the lowest value from a given list (sorted numeric)</li><br/>
      <li><b>rtrim()</b><br>returns string without trailing spaces</li><br/>
      <li><b>time_str2num()</b><br>???</li><br/>
      <li><b>trim()</b><br>returns string without leading and without trailing spaces</li><br/>
      <li><b>UntoggleDirect()</b><br>For devices paired directly, converts state 'toggle' into 'on' or 'off'</li><br/>
      <li><b>UntoggleIndirect()</b><br>For devices paired indirectly, switches the target device 'on' or 'off' <br/>
      also when a 'toggle' was sent from the source device</li><br/>
   </ul>
</ul>
=end html
=cut
---------------------------------------------------

Das bekomme eich nicht gefixt. Kann mir mal jemand einen Tipp geben?

Danke/Gruss

Stephan
Gruß
Stephan

fhem 5.5, Raspi B, CUL V3 868 (max), Arduino Uno R3 conf.firmata v2.05

cotecmania

Hallo Zusammen,

möchte das auch einbauen, aber wie sieht denn jetzt die endgültige funktionierende Version aus ? Es gibt so viele Änderungen im Laufe des Threads.
Könnte man nicht im Post 1 immer die aktuell am besten funktionierende Version abbilden ?

FHEM auf RaspberryPI B (buster)
2xCUL868 für MAX/Slow_RF, HM-LAN, JeeLink
MAX!/HM-Thermostate, FS20/HM-Rolladenschalter, FS20-EM, LevelJet-Ölstandsmessung, PCA301, IT, KM271, IPCAM, FireTAB10 FTUI

cotecmania

Bei mir kommt folgender Fehler, wenn ich 99_myUtils.pm speichere :

Attempt to reload Time/Piece.pm aborted. Compilation failed in require at C:/fhem-5.5/FHEM/99_myUtils.pm line 7. BEGIN failed--compilation aborted at C:/fhem-5.5/FHEM/99_myUtils.pm line 7.

Strawberry perl for Windows portable 5.18.1.1

99_myUtils.pm :

package main;

use strict;
use warnings;
use POSIX;

use Time::Piece;
$main::NextUpdate = ();

sub
myUtils_Initialize($$)
{
   my ($hash) = @_;
}


sub ForceMAXTempUpdate {
  my $UpdateInterval = $_[0];
  my @UpdateThermostat =  @{$_[1]};

  $UpdateInterval++ if ($UpdateInterval % 2 != 0);
  foreach my $therm (@UpdateThermostat) {
    my $curTime = gmtime() + localtime()->tzoffset;
    if ((!defined($main::NextUpdate{$therm}{"NextUpdate"})) || ($curTime>$main::NextUpdate{$therm}{"NextUpdate"})){
      my $th_time = $defs{$therm}{READINGS}{"temperature"}{TIME};
      my $th_val = $defs{$therm}{READINGS}{"desiredTemperature"}{VAL};
      my $th_mode = $defs{$therm}{READINGS}{"mode"}{VAL};
      my $tempTime=Time::Piece->strptime($th_time, "%Y-%m-%d %H:%M:%S");
      my $nextPlan = $tempTime + $UpdateInterval * 60 - 15;
      my $nextUpd = $nextPlan;
      $nextUpd = $nextUpd + 60 * 2 while($curTime->epoch > $nextUpd->epoch);

      if (defined($main::NextUpdate{$therm}{"NextUpdate"})){
        if (!defined($main::NextUpdate{$therm}{"Started"})){
          if ($nextPlan > $main::NextUpdate{$therm}{"NextUpdate"}) {
            $main::NextUpdate{$therm}{"NextUpdate"} = $nextUpd;
            return;
          }
          if (($th_mode eq "auto") || ($th_mode eq "manual")){
            fhem("set ".$therm." desiredTemperature "
                 .($th_mode eq "manual" ? "auto" : "")." ".$th_val);
            $main::NextUpdate{$therm}{"Started"} = $curTime;
            $main::NextUpdate{$therm}{"temp"} = $th_val;
            $main::NextUpdate{$therm}{"mode"} = $th_mode;
          }
        } else {
          my $oldMode = $main::NextUpdate{$therm}{"mode"};
          my $oldTemp = $main::NextUpdate{$therm}{"temp"};
          if ($tempTime > $main::NextUpdate{$therm}{"Started"}){
            if (($th_mode eq ($oldMode eq "auto" ? "manual" : "auto")) && ($th_val eq $main::NextUpdate{$therm}{"temp"})){
              fhem("set ".$therm." desiredTemperature ".($oldMode eq "auto" ? "auto " : "").$oldTemp);
            }
            undef $main::NextUpdate{$therm}{"Started"};
            $main::NextUpdate{$therm}{"NextUpdate"} = $nextUpd;
          } else {
            if ($curTime > $main::NextUpdate{$therm}{"Started"} + 60 * 4) {
              fhem("set ".$therm." desiredTemperature ".($oldMode eq "auto" ? "auto " : "").$oldTemp);
              undef $main::NextUpdate{$therm}{"Started"};
              $main::NextUpdate{$therm}{"NextUpdate"} = $nextUpd;
            }
          }
        }
      } else {
        $main::NextUpdate{$therm} = ();
        $main::NextUpdate{$therm}{"NextUpdate"} = $nextUpd;
      }
      $main::NextUpdate{$therm}{"CurTime"} = $curTime;
    }
  }
}


1;
FHEM auf RaspberryPI B (buster)
2xCUL868 für MAX/Slow_RF, HM-LAN, JeeLink
MAX!/HM-Thermostate, FS20/HM-Rolladenschalter, FS20-EM, LevelJet-Ölstandsmessung, PCA301, IT, KM271, IPCAM, FireTAB10 FTUI

Harald

Hallo zusammen,

ich muss hier nochmal nachhaken. Ich wollte die Funktion wieder in Betrieb nehmen. Leider bekomme ich folgende Meldung im Log:
2015.02.02 14:43:47 3: at_ForceMAXTempUpdate: Undefined subroutine &main::ForceMAXTempUpdate called at (eval 4316) line 1.
In der fhem.cfg stehtdefine at_ForceMAXTempUpdate at +*00:03:00 {my @MaxThermostate=("Bad","Flur");;my $Interval=5;; &ForceMAXTempUpdate ($Interval,\@MaxThermostate);;}
Warum findet FHEM die Subroutine nicht? Was ist denn hier falsch?

Vielen Dank im Voraus und viele Grüße

Harald
Router:AVM7590 1&1 FW:FRITZ!OS 07.56 Anbindung:1&1 50/10 Mb/s, WLAN-Repeater 300E
ELV MAX!Cube, 7xThermostat, ECO, RasPi 4B mit bullseye auf Festplatte,
CUL V 1.67, JeeLink v3_10.1c, nanoCUL, 1xS300TH, 4xHMS100T, 4xELRO, 1xTFA, 2xMAX_FK
ELV MAX!1.4.5, FHEM 5.7 auf RasPi, Kostal PIKO plus

Mr.Heat

Leichenschänder...


Gibt es dafür nicht den MAX-Temperatur-Scanner?

Harald

#37
Ja, richtig. Aber der macht mir zu viel. Der Cube macht fast alles selbst, was der Max-Temperatur-Scanner auch noch bearbeitet wie z.B. Wochenprogramm, WindowsOpen, Schutter usw. Ich benötige nur ModeUmschaltung und das macht hier dieses Skript, wenn ich es denn wieder zum Laufen bekomme. Damals hat es gut funktioniert, deshalb möchte ich es verwenden.

Viele Grüße

Harald

Hat sich erledigt! Die Anzahl der übergebenen Variablen stimmte nicht überein.
Router:AVM7590 1&1 FW:FRITZ!OS 07.56 Anbindung:1&1 50/10 Mb/s, WLAN-Repeater 300E
ELV MAX!Cube, 7xThermostat, ECO, RasPi 4B mit bullseye auf Festplatte,
CUL V 1.67, JeeLink v3_10.1c, nanoCUL, 1xS300TH, 4xHMS100T, 4xELRO, 1xTFA, 2xMAX_FK
ELV MAX!1.4.5, FHEM 5.7 auf RasPi, Kostal PIKO plus

Mr.Heat

Der Scanner macht da nichts. Die Thermostaten machen da auch ihr Wochenprogramm selbstständig. Der Scanner berücksichtigt das nur, um z.B. bei offenem Fenster nicht unbeabsichtigt die Temperatur wieder zurück zu ändern und stellt kurz vor einer Änderung der Temperatur nach Wochenprogramm die Arbeit ein, um das nicht unbeabsichtigt zurück zu ändern. 

Ich denke, dieser uralte TThreadist wohl der Vorgänger des Maxscanners... und seit diesem auch nicht mehr notwendig.

Harald

Du hast ja Recht. Für den Betrieb mit dem CUL ist das ja OK und Prima. Da hat John tolle Arbeit geleistet und hat meine Hochachtung!  :-*  Beim Betrieb mit dem Cube müssen diese Parameter nicht berücksichtig werden, denn das macht der Cube schon. Und deshalb möchte ich den Vorgänger von John's Scanner ausprobieren , da ich auch nur die ModeUmschaltung verwenden möchte.

Viele Grüße

Harald

Router:AVM7590 1&1 FW:FRITZ!OS 07.56 Anbindung:1&1 50/10 Mb/s, WLAN-Repeater 300E
ELV MAX!Cube, 7xThermostat, ECO, RasPi 4B mit bullseye auf Festplatte,
CUL V 1.67, JeeLink v3_10.1c, nanoCUL, 1xS300TH, 4xHMS100T, 4xELRO, 1xTFA, 2xMAX_FK
ELV MAX!1.4.5, FHEM 5.7 auf RasPi, Kostal PIKO plus

Mr.Heat

Doch. Müssen sie. Auch mit CUL machen die Thermostaten ihr Wochenprogramm selbst, es gibt da keinen Unterschied. Der Cube macht das Wochenprogramm nicht, das sind die Thermostaten selbst. Der Programmiert nur die Thermostaten; bei einem Komplettausfall würden die Thermostaten mit Cube und auch mit CUL trotzdem ihr Wochenprogramm weitermachen.