WeekdayTimer und Perlfunktion für time

Begonnen von ToKa, 09 Dezember 2016, 20:28:44

Vorheriges Thema - Nächstes Thema

ToKa

Hallo zusammen,

ich nutze bei einem WeekdayTimer die Möglichkeit den time Parameter mit einer eigenen Perlfunktion zu berechnen. In der Perlfunktion benutze ich ein Reading (state = Urlaub: ja/nein) aus einem Dummy-Device. Das funktioniert auch beim Speichern der Definition prima.

Wenn ich fhem per shutdown/restart neustarte, werden die Werte im WeekdayTimer zwar neu berechnet, aber das Reading hat nur den Defaultwert aus ReadingsVal und nicht den zuletzt gesetzten Wert. Kann es sein, dass beim Neustart der state des Dummy noch nicht gesetzt ist, während WeekdayTimer die Werte neuberechnet? Oder muss ich in meiner Perlfunktion etwas für den Neustart berücksichtigen?

Beste Grüße

Torsten
RaspberryPi3 mit RaZberry2 und Conbee II
Fibaro: FGWPE/F-101 Switch & FIBARO System FGWPE/F Wall Plug Gen5, FGSD002 Smoke Sensor
EUROtronic: SPIRIT Wall Radiator Thermostat Valve Control
Shelly2.5 Rollladenaktoren
Zipato Bulb 2, Osram und InnrLight

Dietmar63

Ja, es kommt auf die Reihenfolge der Definitionen an
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

ToKa

Hallo Dietmar,

danke für die schnelle Antwort. Kann ich denn die Reihenfolge ändern?

Gruß

Torsten
RaspberryPi3 mit RaZberry2 und Conbee II
Fibaro: FGWPE/F-101 Switch & FIBARO System FGWPE/F Wall Plug Gen5, FGSD002 Smoke Sensor
EUROtronic: SPIRIT Wall Radiator Thermostat Valve Control
Shelly2.5 Rollladenaktoren
Zipato Bulb 2, Osram und InnrLight

Dietmar63

Ich glaube es geht mit Löschen und neu anlegen
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

ToKa

Ups... das wäre aber umständlich  :(
Dann müsste ich ja den WeekdayTimer immer neu anlegen, wenn ich eine neue "Variable" benutzen will.
RaspberryPi3 mit RaZberry2 und Conbee II
Fibaro: FGWPE/F-101 Switch & FIBARO System FGWPE/F Wall Plug Gen5, FGSD002 Smoke Sensor
EUROtronic: SPIRIT Wall Radiator Thermostat Valve Control
Shelly2.5 Rollladenaktoren
Zipato Bulb 2, Osram und InnrLight

Dietmar63

Die defines werden beim Start  in einer bestimmten Reihenfolge abgearbeitet. Die Reihenfolge bestimmt fhem.cfg.
Mir ist nicht bekannt wie man das beeinflussen kann ohne löschen Neuanlegen zu nutzen.


Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

ToKa

RaspberryPi3 mit RaZberry2 und Conbee II
Fibaro: FGWPE/F-101 Switch & FIBARO System FGWPE/F Wall Plug Gen5, FGSD002 Smoke Sensor
EUROtronic: SPIRIT Wall Radiator Thermostat Valve Control
Shelly2.5 Rollladenaktoren
Zipato Bulb 2, Osram und InnrLight

ToKa

Hallo Dietmar,

ich habe den WeekdayTimer gelöscht und neu angelegt. In der fhem.cfg ist der Timer nun der letzte Eintrag, so dass mein "Urlaubsdummy" weit vorher in der Datei steht.

Das Verhalten beim Neustart hat sich aber nicht geändert und der Dummy wird beim Berechnen der Zeiten im WeekdayTimer nicht berücksichtigt.

Was nun? Kann ich Dir mit einem Log weiterhelfen?

Gruß Torsten
RaspberryPi3 mit RaZberry2 und Conbee II
Fibaro: FGWPE/F-101 Switch & FIBARO System FGWPE/F Wall Plug Gen5, FGSD002 Smoke Sensor
EUROtronic: SPIRIT Wall Radiator Thermostat Valve Control
Shelly2.5 Rollladenaktoren
Zipato Bulb 2, Osram und InnrLight

Dietmar63

Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

Dietmar63

veröffentliche bitte mal deine Definition
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

ToKa

Hallo Dietmar,

die vom WeekdayTimer oder meinem dummy?

Gruß
Torsten
RaspberryPi3 mit RaZberry2 und Conbee II
Fibaro: FGWPE/F-101 Switch & FIBARO System FGWPE/F Wall Plug Gen5, FGSD002 Smoke Sensor
EUROtronic: SPIRIT Wall Radiator Thermostat Valve Control
Shelly2.5 Rollladenaktoren
Zipato Bulb 2, Osram und InnrLight

Dietmar63

Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

ToKa

#12
Hallo Dietmar,

hier das list des WDT:

Internals:
   COMMAND
   CONDITION
   DEF        KG.hz.ZS.Zirkulationspumpe de !$we|{myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","on",1)}|on !$we|{myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","off",1)}|off !$we|{myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","on",2)}|on !$we|{myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","off",2)}|off $we|{myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","on",1)}|on $we|{myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","off",1)}|off $we|{myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","on",2)}|on $we|{myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","off",2)}|off
   DEVICE     KG.hz.ZS.Zirkulationspumpe
   GlobalDaylistSpec
   LANGUAGE   de
   NAME       KG.hz.ZS.Zirkulationspumpe.tim
   NR         165
   Profil 0: Sonntag 06:30:00 on, 08:00:00 off, 18:30:00 on, 20:00:00 off
   Profil 1: Montag 04:30:00 on, 06:00:00 off, 16:30:00 on, 18:00:00 off
   Profil 2: Dienstag 04:30:00 on, 06:00:00 off, 16:30:00 on, 18:00:00 off
   Profil 3: Mittwoch 04:30:00 on, 06:00:00 off, 16:30:00 on, 18:00:00 off
   Profil 4: Donnerstag 04:30:00 on, 06:00:00 off, 16:30:00 on, 18:00:00 off
   Profil 5: Freitag 04:30:00 on, 06:00:00 off, 16:30:00 on, 18:00:00 off
   Profil 6: Samstag 06:30:00 on, 08:00:00 off, 18:30:00 on, 20:00:00 off
   Profil 7: Wochenende 06:30:00 on, 08:00:00 off, 18:30:00 on, 20:00:00 off
   Profil 8: Werktags 04:30:00 on, 06:00:00 off, 16:30:00 on, 18:00:00 off
   STATE      active
   STILLDONETIME 0
   TYPE       WeekdayTimer
   Readings:
     2016-12-16 19:29:32   currValue       off
     2016-12-16 19:29:32   nextUpdate      2016-12-17 06:30:00
     2016-12-16 19:29:32   nextValue       on
     2016-12-16 19:29:32   state           active
   SWITCHINGTIMES:
     !$we|{myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","on",1)}|on
     !$we|{myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","off",1)}|off
     !$we|{myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","on",2)}|on
     !$we|{myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","off",2)}|off
     $we|{myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","on",1)}|on
     $we|{myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","off",1)}|off
     $we|{myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","on",2)}|on
     $we|{myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","off",2)}|off
   Timer:
     Kg.hz.zs.zirkulationspumpe.tim_8:
       HASH       KG.hz.ZS.Zirkulationspumpe.tim
       MODIFIER   8
       NAME       KG.hz.ZS.Zirkulationspumpe.tim_8
     Kg.hz.zs.zirkulationspumpe.tim_settimerofday:
       HASH       KG.hz.ZS.Zirkulationspumpe.tim
       MODIFIER   SetTimerOfDay
       NAME       KG.hz.ZS.Zirkulationspumpe.tim_SetTimerOfDay
       SETTIMERATMIDNIGHT 1
   Daynumber:
     !$we       8
     $we        7
     di         2
     do         4
     fr         5
     mi         3
     mo         1
     sa         6
     so         0
   Helper:
     daysRegExp (so|mo|di|mi|do|fr|sa|\$we|\!\$we)
     daysRegExpMessage (so|mo|di|mi|do|fr|sa|$we|!$we)
     Switchingtime:
       0:
         06:30:00   on
         08:00:00   off
         18:30:00   on
         20:00:00   off
       1:
         04:30:00   on
         06:00:00   off
         16:30:00   on
         18:00:00   off
       2:
         04:30:00   on
         06:00:00   off
         16:30:00   on
         18:00:00   off
       3:
         04:30:00   on
         06:00:00   off
         16:30:00   on
         18:00:00   off
       4:
         04:30:00   on
         06:00:00   off
         16:30:00   on
         18:00:00   off
       5:
         04:30:00   on
         06:00:00   off
         16:30:00   on
         18:00:00   off
       6:
         06:30:00   on
         08:00:00   off
         18:30:00   on
         20:00:00   off
       7:
         06:30:00   on
         08:00:00   off
         18:30:00   on
         20:00:00   off
       8:
         04:30:00   on
         06:00:00   off
         16:30:00   on
         18:00:00   off
   Longdays:
     de:
       Sonntag
       Montag
       Dienstag
       Mittwoch
       Donnerstag
       Freitag
       Samstag
       Wochenende
       Werktags
     en:
       Sunday
       Monday
       Tuesday
       Wednesday
       Thursday
       Friday
       Saturday
       weekend
       weekdays
     fr:
       Dimanche
       Lundi
       Mardi
       Mercredi
       Jeudi
       Vendredi
       Samedi
       weekend
       jours de la semaine
   Profil:
     1:
       EPOCH      1481859000
       PARA       on
       TIME       {myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","on",1)}
       TAGE:
         8
     2:
       EPOCH      1481864400
       PARA       off
       TIME       {myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","off",1)}
       TAGE:
         8
     3:
       EPOCH      1481902200
       PARA       on
       TIME       {myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","on",2)}
       TAGE:
         8
     4:
       EPOCH      1481907600
       PARA       off
       TIME       {myWeekdayTimerTimeTable(0,"KG.hz.ZS.Zirkulationspumpe","off",2)}
       TAGE:
         8
     5:
       EPOCH      1481866200
       PARA       on
       TIME       {myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","on",1)}
       TAGE:
         7
     6:
       EPOCH      1481871600
       PARA       off
       TIME       {myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","off",1)}
       TAGE:
         7
     7:
       EPOCH      1481909400
       PARA       on
       TIME       {myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","on",2)}
       TAGE:
         7
     8:
       EPOCH      1481914800
       PARA       off
       TIME       {myWeekdayTimerTimeTable(1,"KG.hz.ZS.Zirkulationspumpe","off",2)}
       TAGE:
         7
   Profile_idx:
     0:
       06:30:00   5
       08:00:00   6
       18:30:00   7
       20:00:00   8
     1:
       04:30:00   1
       06:00:00   2
       16:30:00   3
       18:00:00   4
     2:
       04:30:00   1
       06:00:00   2
       16:30:00   3
       18:00:00   4
     3:
       04:30:00   1
       06:00:00   2
       16:30:00   3
       18:00:00   4
     4:
       04:30:00   1
       06:00:00   2
       16:30:00   3
       18:00:00   4
     5:
       04:30:00   1
       06:00:00   2
       16:30:00   3
       18:00:00   4
     6:
       06:30:00   5
       08:00:00   6
       18:30:00   7
       20:00:00   8
     7:
       06:30:00   5
       08:00:00   6
       18:30:00   7
       20:00:00   8
     8:
       04:30:00   1
       06:00:00   2
       16:30:00   3
       18:00:00   4
   Shortdays:
     de:
       so
       mo
       di
       mi
       do
       fr
       sa
       $we
       !$we
     en:
       su
       mo
       tu
       we
       th
       fr
       sa
       $we
       !$we
     fr:
       di
       lu
       ma
       me
       je
       ve
       sa
       $we
       !$we
Attributes:
   alias      Zeitsteuerung
   group      Zirkulationspumpe
   icon       sani_pump
   room       Heizungsraum,Zentrale Steuerung


Meine eigene Funktion myWeekdayTimerTimeTable wertet wie beschrieben, den Dummy mit den Informationen zu Urlaub aus und passt entsprechend die Start-/Endzeiten für die Zirkulationspumpe an.

Gruß

Torsten
RaspberryPi3 mit RaZberry2 und Conbee II
Fibaro: FGWPE/F-101 Switch & FIBARO System FGWPE/F Wall Plug Gen5, FGSD002 Smoke Sensor
EUROtronic: SPIRIT Wall Radiator Thermostat Valve Control
Shelly2.5 Rollladenaktoren
Zipato Bulb 2, Osram und InnrLight

Dietmar63

Die Zeitfunktionen werden immer Mitternachts ausgewertet.
Wenn du dein Dummy änderst, must du Weekdaytimer_SetAllParam() aufrufen
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

ToKa

Hallo Dietmar,

danke für den Hinweis, das würde ich dann in mein notify des dummy einbauen. Das Problem liegt ja aber nach wie vor darin, dass bei einem Neustart von fhem der Wert des Dummy bei der Berechnung des WDT nicht "berücksichtigt" wird.

Gruß

Torsten
RaspberryPi3 mit RaZberry2 und Conbee II
Fibaro: FGWPE/F-101 Switch & FIBARO System FGWPE/F Wall Plug Gen5, FGSD002 Smoke Sensor
EUROtronic: SPIRIT Wall Radiator Thermostat Valve Control
Shelly2.5 Rollladenaktoren
Zipato Bulb 2, Osram und InnrLight