Neue Features - $SELF, $self, cmd-Reading, timerevent, selftrigger ...

Begonnen von Damian, 19 März 2016, 22:12:40

Vorheriges Thema - Nächstes Thema

Ellert

Die Version # $Id: 98_DOIF.pm Version 0.3 $ erzeugt beim Start und Betrieb von FHEM Perl-Warnungen
Ich habe es auf meinem Testsystem mal nachgestellt für das DOIF

Internals:
   DEF        ([TSL2561:broadband] > 0) (({Log 1,"[TSL2561:broadband]"}))
   NAME       di
   NR         51
   NTFY_ORDER 50-di
   STATE      cmd_1
   TYPE       DOIF
   Readings:
     2016-04-02 10:37:20   Device          TSL2561
     2016-04-02 10:37:20   cmd_event       TSL2561
     2016-04-02 10:37:20   cmd_nr          1
     2016-04-02 10:37:20   e_TSL2561_broadband 4549
     2016-04-02 10:37:20   state           cmd_1
   Condition:
     0          ReadingValDoIf($hash,'TSL2561','broadband','','',AttrVal($hash->{NAME},'notexist',undef)) > 0
   Devices:
     0           TSL2561
     all         TSL2561
   Do:
     0:
       0          ({Log 1,"[TSL2561:broadband]"})
   Helper:
     event      gain: 16,integrationTime: 0.101,broadband: 4549,ir: 3441,luminosity: 37.7
     globalinit 1
     last_timer 0
     sleeptimer -1
     timerdev   TSL2561
     timerevent gain: 16,integrationTime: 0.101,broadband: 4549,ir: 3441,luminosity: 37.7
     triggerDev TSL2561
     timerevents:
       gain: 16
       integrationTime: 0.101
       broadband: 4549
       ir: 3441
       luminosity: 37.7
     timereventsState:
       gain: 16
       integrationTime: 0.101
       broadband: 4549
       ir: 3441
       luminosity: 37.7
     triggerEvents:
       gain: 16
       integrationTime: 0.101
       broadband: 4549
       ir: 3441
       luminosity: 37.7
     triggerEventsState:
       gain: 16
       integrationTime: 0.101
       broadband: 4549
       ir: 3441
       luminosity: 37.7
   Internals:
   Itimer:
   Readings:
     0           TSL2561:broadband
     all         TSL2561:broadband
   Regexp:
     0:
     All:
   State:
   Trigger:
Attributes:
   do         always
   room       0_Test

erhalte ich beim Start von FHEM folgende Warnungen:
Zitat2016.04.02 10:28:13 0: Server started with 77 defined entities (fhem.pl:11144/2016-03-29 perl:5.020002 os:linux user:fhem pid:26333)
Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497.
2016.04.02 10:28:18 1: 3608
Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207.
2016.04.02 10:28:18 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497.
2016.04.02 10:28:18 3: stacktrace:
2016.04.02 10:28:18 3:     main::__ANON__                      called by ./FHEM/98_DOIF.pm (497)
2016.04.02 10:28:18 3:     main::ReplaceAllReadingsDoIf        called by ./FHEM/98_DOIF.pm (161)
2016.04.02 10:28:18 3:     main::EvalValueDoIf                 called by ./FHEM/98_DOIF.pm (944)
2016.04.02 10:28:18 3:     main::DOIF_cmd                      called by ./FHEM/98_DOIF.pm (1174)
2016.04.02 10:28:18 3:     main::DOIF_Trigger                  called by ./FHEM/98_DOIF.pm (1270)
2016.04.02 10:28:18 3:     main::DOIF_Notify                   called by fhem.pl (3151)
2016.04.02 10:28:18 3:     main::CallFn                        called by fhem.pl (3073)
2016.04.02 10:28:18 3:     main::DoTrigger                     called by fhem.pl (3953)
2016.04.02 10:28:18 3:     main::readingsEndUpdate             called by ./FHEM/51_I2C_TSL2561.pm (594)
2016.04.02 10:28:18 3:     main::I2C_TSL2561_Poll              called by fhem.pl (2761)
2016.04.02 10:28:18 3:     main::HandleTimeout                 called by fhem.pl (586)
2016.04.02 10:28:18 1: 4088
2016.04.02 10:28:18 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207.
2016.04.02 10:28:18 3: stacktrace:
2016.04.02 10:28:18 3:     main::__ANON__                      called by ./FHEM/98_DOIF.pm (207)
2016.04.02 10:28:18 3:     main::SplitDoIf                     called by ./FHEM/98_DOIF.pm (800)
2016.04.02 10:28:18 3:     main::DOIF_SetState                 called by ./FHEM/98_DOIF.pm (1011)
2016.04.02 10:28:18 3:     main::DOIF_cmd                      called by ./FHEM/98_DOIF.pm (1174)
2016.04.02 10:28:18 3:     main::DOIF_Trigger                  called by ./FHEM/98_DOIF.pm (1270)
2016.04.02 10:28:18 3:     main::DOIF_Notify                   called by fhem.pl (3151)
2016.04.02 10:28:18 3:     main::CallFn                        called by fhem.pl (3073)
2016.04.02 10:28:18 3:     main::DoTrigger                     called by fhem.pl (3953)
2016.04.02 10:28:18 3:     main::readingsEndUpdate             called by ./FHEM/51_I2C_TSL2561.pm (594)
2016.04.02 10:28:18 3:     main::I2C_TSL2561_Poll              called by fhem.pl (2761)
2016.04.02 10:28:18 3:     main::HandleTimeout                 called by fhem.pl (586)


2016.04.02 10:29:18 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497.
2016.04.02 10:29:18 3: stacktrace:
2016.04.02 10:29:18 3:     main::__ANON__                      called by ./FHEM/98_DOIF.pm (497)
2016.04.02 10:29:18 3:     main::ReplaceAllReadingsDoIf        called by ./FHEM/98_DOIF.pm (161)
2016.04.02 10:29:18 3:     main::EvalValueDoIf                 called by ./FHEM/98_DOIF.pm (944)
2016.04.02 10:29:18 3:     main::DOIF_cmd                      called by ./FHEM/98_DOIF.pm (1174)
2016.04.02 10:29:18 3:     main::DOIF_Trigger                  called by ./FHEM/98_DOIF.pm (1270)
2016.04.02 10:29:18 3:     main::DOIF_Notify                   called by fhem.pl (3151)
2016.04.02 10:29:18 3:     main::CallFn                        called by fhem.pl (3073)
2016.04.02 10:29:18 3:     main::DoTrigger                     called by fhem.pl (3953)
2016.04.02 10:29:18 3:     main::readingsEndUpdate             called by ./FHEM/51_I2C_TSL2561.pm (594)
2016.04.02 10:29:18 3:     main::I2C_TSL2561_Poll              called by fhem.pl (2761)
2016.04.02 10:29:18 3:     main::HandleTimeout                 called by fhem.pl (586)
2016.04.02 10:29:18 1: 4124
2016.04.02 10:29:18 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207.
2016.04.02 10:29:18 3: stacktrace:
2016.04.02 10:29:18 3:     main::__ANON__                      called by ./FHEM/98_DOIF.pm (207)
2016.04.02 10:29:18 3:     main::SplitDoIf                     called by ./FHEM/98_DOIF.pm (800)
2016.04.02 10:29:18 3:     main::DOIF_SetState                 called by ./FHEM/98_DOIF.pm (1011)
2016.04.02 10:29:18 3:     main::DOIF_cmd                      called by ./FHEM/98_DOIF.pm (1174)
2016.04.02 10:29:18 3:     main::DOIF_Trigger                  called by ./FHEM/98_DOIF.pm (1270)
2016.04.02 10:29:18 3:     main::DOIF_Notify                   called by fhem.pl (3151)
2016.04.02 10:29:18 3:     main::CallFn                        called by fhem.pl (3073)
2016.04.02 10:29:18 3:     main::DoTrigger                     called by fhem.pl (3953)
2016.04.02 10:29:18 3:     main::readingsEndUpdate             called by ./FHEM/51_I2C_TSL2561.pm (594)
2016.04.02 10:29:18 3:     main::I2C_TSL2561_Poll              called by fhem.pl (2761)
2016.04.02 10:29:18 3:     main::HandleTimeout                 called by fhem.pl (586)
Das DOIF funktioniert, wie der Logeintrag (rot) zeigt
Bei der Version 98_DOIF.pm 10985 2016-03-03 17:25:24Z damian-s gibt es keine Warnungen.

Ellert

Die DOIF Version # $Id: 98_DOIF.pm Version 0.3 $ ignoriert cmdState 0.
Ich habe es auf meinem Testsystem mal nachgestellt für das DOIF:
Zitat
Internals:
   DEF        ([du:state:d])
   (({Log 1, "(du): [du], (di:state): [di:state]"}))
DOELSEIF (![du:state:d])
   (({Log 1, "(du): [du], (di:state): [di:state]"}))

   NAME       di
   NR         51
   NTFY_ORDER 50-di
   STATE      cmd_2
   TYPE       DOIF
   Readings:
     2016-04-02 11:15:50   Device          du
     2016-04-02 11:15:50   cmd_event       du
     2016-04-02 11:15:50   cmd_nr          2
     2016-04-02 11:15:50   e_du_state      x0
     2016-04-02 11:15:50   state           cmd_2
   Condition:
     0          ReadingValDoIf($hash,'du','state','(-?\d+(\.\d+)?)','',AttrVal($hash->{NAME},'notexist',undef))
     1          !ReadingValDoIf($hash,'du','state','(-?\d+(\.\d+)?)','',AttrVal($hash->{NAME},'notexist',undef))
   Devices:
     0           du
     1           du
     all         du
   Do:
     0:
       0          ({Log 1, "(du): [du], (di:state): [di:state]"})
     1:
       0          ({Log 1, "(du): [du], (di:state): [di:state]"})
   Helper:
     event      x0
     globalinit 1
     last_timer 0
     sleeptimer -1
     timerdev   du
     timerevent x0
     triggerDev du
     timerevents:
       x0
     timereventsState:
       state: x0
     triggerEvents:
       x0
     triggerEventsState:
       state: x0
   Internals:
   Itimer:
   Readings:
     0           du:state
     1           du:state
     all         du:state
   Regexp:
     0:
     1:
     All:
   State:
   Trigger:
Attributes:
   cmdState   1|0
   do         always
   room       0_Test
Für du=x1 funktioniert es und di:state wird 1.


Damian

Zitat von: Ellert am 02 April 2016, 11:33:29
Die DOIF Version # $Id: 98_DOIF.pm Version 0.3 $ ignoriert cmdState 0.
Ich habe es auf meinem Testsystem mal nachgestellt für das DOIF:Für du=x1 funktioniert es und di:state wird 1.

Ich habe es gefixt und an der Doku noch etwas gefeilt.

Version 0.4 im ersten Post.

Gruß

Damian
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

Ellert

Zitat von: Damian am 02 April 2016, 13:16:51
Ich habe es gefixt und an der Doku noch etwas gefeilt.

Version 0.4 im ersten Post.

Gruß

Damian

Nachdem cmdState 0 funktioniert, habe ich die Version 0.4 versuchsweise im Wirkbetrieb eingesetzt.

Die Menge der Perlwarnungen gegenüber der Version "10985 2016-03-03 17:25:24Z damian-s" ist etwas irritierend.
Ich kann die Warnungen keinem Gerät eindeutig zuordnen, daher erstmal nachrichtlich die Warnungen:

2016.04.02 17:37:59 0: Featurelevel: 5.7
2016.04.02 17:37:59 0: Server started with 404 defined entities (fhem.pl:11144/2016-03-29 perl:5.014002 os:linux user:fhem pid:15922)
2016.04.02 17:38:00 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 941.
2016.04.02 17:38:00 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 942.
2016.04.02 17:38:00 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497.
2016.04.02 17:38:00 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207.
2016.04.02 17:50:43 1: PERL WARNING: Use of uninitialized value in subtraction (-) at ./FHEM/51_RPI_GPIO.pm line 510, <GEN25> line 2.
2016.04.02 17:50:43 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 941, <GEN25> line 2.
2016.04.02 17:50:43 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 942, <GEN25> line 2.
2016.04.02 17:50:43 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 2.
2016.04.02 17:50:43 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 2.
2016.04.02 17:50:44 1: PERL WARNING: Use of uninitialized value in subtraction (-) at ./FHEM/51_RPI_GPIO.pm line 510, <GEN29> line 2.
2016.04.02 17:50:44 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 941, <GEN29> line 2.
2016.04.02 17:50:44 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 942, <GEN29> line 2.
2016.04.02 17:50:44 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 2.
2016.04.02 17:50:44 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 2.
2016.04.02 17:51:35 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 941, <GEN25> line 3.
2016.04.02 17:51:35 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 942, <GEN25> line 3.
2016.04.02 17:51:35 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 3.
2016.04.02 17:51:35 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 3.
2016.04.02 17:51:35 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 941, <GEN29> line 3.
2016.04.02 17:51:35 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 942, <GEN29> line 3.
2016.04.02 17:51:35 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 3.
2016.04.02 17:51:35 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 3.
2016.04.02 18:06:52 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 941, <GEN25> line 4.
2016.04.02 18:06:52 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 942, <GEN25> line 4.
2016.04.02 18:06:52 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 4.
2016.04.02 18:06:52 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 4.
2016.04.02 18:06:53 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 941, <GEN29> line 4.
2016.04.02 18:06:53 1: PERL WARNING: Use of uninitialized value $_ in pattern match (m//) at ./FHEM/98_DOIF.pm line 942, <GEN29> line 4.
2016.04.02 18:06:53 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 4.
2016.04.02 18:06:53 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 4.
2016.04.02 18:23:40 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 5.
2016.04.02 18:23:40 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 5.
2016.04.02 18:23:42 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 5.
2016.04.02 18:23:42 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 5.
2016.04.02 18:24:20 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 6.
2016.04.02 18:24:20 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 6.
2016.04.02 18:24:46 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 6.
2016.04.02 18:24:46 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 6.
2016.04.02 18:25:14 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 7.
2016.04.02 18:25:14 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 7.
2016.04.02 18:25:14 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 7.
2016.04.02 18:25:14 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 7.
2016.04.02 18:27:29 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 8.
2016.04.02 18:27:29 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 8.
2016.04.02 18:30:51 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 8.
2016.04.02 18:30:51 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 8.
2016.04.02 18:30:54 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 9.
2016.04.02 18:30:54 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 9.
2016.04.02 18:31:23 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 10.
2016.04.02 18:31:23 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 10.
2016.04.02 18:32:58 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 9.
2016.04.02 18:32:58 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 9.
2016.04.02 18:32:58 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 11.
2016.04.02 18:32:58 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 11.
2016.04.02 18:51:10 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 10.
2016.04.02 18:51:10 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 10.
2016.04.02 18:51:12 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 12.
2016.04.02 18:51:12 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 12.
2016.04.02 18:51:50 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 11.
2016.04.02 18:51:50 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 11.
2016.04.02 18:51:54 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 13.
2016.04.02 18:51:54 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 13.
2016.04.02 19:00:04 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 14.
2016.04.02 19:00:04 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 14.
2016.04.02 19:13:33 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 15.
2016.04.02 19:13:33 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 15.
2016.04.02 19:14:16 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 16.
2016.04.02 19:14:16 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 16.
2016.04.02 19:15:36 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 12.
2016.04.02 19:15:36 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 12.
2016.04.02 19:15:41 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 17.
2016.04.02 19:15:41 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 17.
2016.04.02 19:16:47 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 13.
2016.04.02 19:16:47 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 13.
2016.04.02 19:19:50 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 14.
2016.04.02 19:19:50 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 14.
2016.04.02 19:19:53 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 18.
2016.04.02 19:19:53 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 18.
2016.04.02 19:26:33 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 19.
2016.04.02 19:26:33 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 19.
2016.04.02 19:26:34 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 15.
2016.04.02 19:26:34 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 15.
2016.04.02 19:29:14 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 20.
2016.04.02 19:29:15 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 20.
2016.04.02 19:31:01 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 16.
2016.04.02 19:31:01 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 16.
2016.04.02 19:31:16 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 21.
2016.04.02 19:31:16 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 21.
2016.04.02 19:32:44 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 17.
2016.04.02 19:32:44 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 17.
2016.04.02 19:32:45 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 22.
2016.04.02 19:32:45 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 22.
2016.04.02 19:41:25 1: PERL WARNING: substr outside of string at ./FHEM/98_DOIF.pm line 127, <GEN29> line 22.
2016.04.02 19:41:25 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 210, <GEN29> line 22.
2016.04.02 19:43:27 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 18.
2016.04.02 19:43:27 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 18.
2016.04.02 19:43:28 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 23.
2016.04.02 19:43:28 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 23.
2016.04.02 19:46:50 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 24.
2016.04.02 19:46:50 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 24.
2016.04.02 19:46:51 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 19.
2016.04.02 19:46:51 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 19.
2016.04.02 19:48:23 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 25.
2016.04.02 19:48:23 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 25.
2016.04.02 19:48:33 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN25> line 20.
2016.04.02 19:48:33 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN25> line 20.
2016.04.02 19:48:57 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 497, <GEN29> line 26.
2016.04.02 19:48:57 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 207, <GEN29> line 26.
2016.04.02 19:49:36 1: PERL WARNING: substr outside of string at ./FHEM/98_DOIF.pm line 127, <GEN29> line 26.
2016.04.02 19:49:36 1: PERL WARNING: Use of uninitialized value $tailBlock in string ne at ./FHEM/98_DOIF.pm line 210, <GEN29> line 26.

Damian

Version 0.5 im ersten Post sollte jetzt keine Warnings bringen.
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

FunkOdyssey

Beim FHEM-Neustart habe ich noch folgende Warnings. Leider kenne ich die exakte Quelle noch nicht.


PERL WARNING: Use of uninitialized value $reading in regexp compilation at ./FHEM/98_DOIF.pm line 1066.
PERL WARNING: Use of uninitialized value in pattern match (m//) at ./FHEM/98_DOIF.pm line 1162.

Damian

Zitat von: FunkOdyssey am 03 April 2016, 00:26:01
Beim FHEM-Neustart habe ich noch folgende Warnings. Leider kenne ich die exakte Quelle noch nicht.


PERL WARNING: Use of uninitialized value $reading in regexp compilation at ./FHEM/98_DOIF.pm line 1066.
PERL WARNING: Use of uninitialized value in pattern match (m//) at ./FHEM/98_DOIF.pm line 1162.


Mit Version 0.6 sollten auch diese Warnings weg sein.
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

FunkOdyssey

Einer ist noch drinne:
PERL WARNING: Use of uninitialized value $reading in regexp compilation at ./FHEM/98_DOIF.pm line 1069.

Damian

Zitat von: FunkOdyssey am 03 April 2016, 14:20:29
Einer ist noch drinne:
PERL WARNING: Use of uninitialized value $reading in regexp compilation at ./FHEM/98_DOIF.pm line 1069.

Version 0.7 - so langsam müssten sie alle ausgemerzt sein.
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

Ellert

Zitat von: Damian am 03 April 2016, 15:07:02
Version 0.7 - so langsam müssten sie alle ausgemerzt sein.
Bis jetzt sind keine Warnungen mehr aufgetaucht.

Damian

Zitat von: Ellert am 04 April 2016, 11:48:06
Bis jetzt sind keine Warnungen mehr aufgetaucht.

Das ist gut. Wenn sich keine weiteren Auffälligkeiten ergeben, dann werde ich die Version bald einchecken.


Gruß

Damian
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

FunkOdyssey

Ich kann auch keine Probleme finden.
Die Perl-Warnings sind nun tatsächlich alle weg.

Ellert

Ich habe gerade addStateEvent probiert, es scheint nicht zu funktionieren.
DOIF Version 0.7
ZitatInternals:
   CFGFN
   DEF        ([Test:"^state: "]) (({Log 1, "$DEVICE $EVENTS"}))

   NAME       state_di
   NR         1696
   NTFY_ORDER 50-atHome_di
   STATE      initialized
   TYPE       DOIF
   Readings:
     2016-04-05 20:22:51   Device          Test
     2016-04-05 20:22:51   e_Test_events   1
     2016-04-05 20:20:26   state           initialized

   Condition:
     0          EventDoIf('Test',$hash,'^state: ',1)
   Devices:
     0           Test
     all         Test
   Do:
     0:
       0          ({Log 1, "$DEVICE $EVENTS"})
     1:
   Helper:
     event      1
     globalinit 1
     last_timer 0
     sleeptimer -1
     triggerDev Test
     triggerEvents:
       1
     triggerEventsState:
       state: 1
   Internals:
   Itimer:
   Readings:
   Regexp:
     0:
     All:
   State:
   Trigger:
     all         Test
Attributes:
   addStateEvent 1
   do         always
   room       0_Test

Damian

Zitat von: Ellert am 05 April 2016, 20:28:13
Ich habe gerade addStateEvent probiert, es scheint nicht zu funktionieren.
DOIF Version 0.7

Version 0.8 mit Korrekturen und weiteren Anpassungen.

So sieht die neue Einleitung der Commandref aus:

ZitatDOIF (ausgeprochen: du if, übersetzt: tue wenn) ist ein universelles Modul, welches ereignis- und zeitgesteuert in Abhängigkeit definierter Bedingungen Anweisungen ausführt.

In einer Hausautomatisation geht es immer wieder um die Ausführung von Befehlen abhängig von einem Ereignis. Oft reicht aber eine einfache Abfrage der Art: "wenn Ereignis eintritt, dann Befehl ausführen" nicht aus. Ebenso häufig möchte man eine Aktion nicht nur von einem einzelnen Ereignis abhängig ausführen, sondern abhängig von mehreren Bedingungen, z. B. "schalte Außenlicht ein, wenn es dunkel wird, aber nicht vor 18:00 Uhr" oder "schalte die Warmwasserzirkulation ein, wenn die Rücklauftemperatur unter 38 Grad fällt und jemand zuhause ist". In solchen Fällen muss man mehrere Bedingung logisch miteinander verknüpfen. Das lässt sich mit Hilfe eines Perl-if-Befehls in Kombination mit dem notify-Modul bei Ereignissteuerung oder dem at-Modul bei Zeitsteuerung bewerkstelligen. Das setzt allerdings bereits eine gewisse Mindestkenntnis der Programmiersprache Perl voraus.

An dieser Stelle setzt das Modul DOIF an. Es stellt eine eigene Benutzer-Schnittstelle zur Verfügung ohne Programmierkenntnisse in Perl vorauszusetzen. Mit diesem Modul ist es möglich, sowohl Ereignis- als auch Zeitsteuerung mit Hilfe logischer Abfragen miteinander zu kombinieren. Damit können komplexere Problemstellungen innerhalb eines DOIF-Moduls gelöst werden, ohne Perlcode in Kombination mit anderen Modulen programmieren zu müssen.

Das DOIF-Modul bedient sich selbst des Perlinterpreters, damit sind beliebige logische Abfragen möglich. Logische Abfragen werden in DOIF/DOELSEIF-Bedingungen vornehmlich mit Hilfe von and/or-Operatoren erstellt. Diese werden mit Angaben von Stati, Readings, Internals, Events oder Zeiten kombiniert. Sie werden grundsätzlich in eckigen Klammern angegeben und führen zur Triggerung des Moduls und damit zur Auswertung der dazugehörigen Bedingung. Zusätzlich können in einer Bedingung Perl-Funktionen angegeben werden, die in FHEM definiert sind. Wenn eine Bedingung wahr wird, so werden die dazugehörigen Befehle ausgeführt.

Syntax:

define <name> DOIF (<Bedingung>) (<Befehle>) DOELSEIF (<Bedingung>) (<Befehle>) DOELSEIF ... DOELSE (<Befehle>)

Die Angaben werden immer von links nach rechts abgearbeitet. Zu beachten ist, dass nur die Bedingungen überprüft werden, die zum ausgelösten Event das dazughörige Device bzw. die dazugehörige Triggerzeit beinhalten. Kommt ein Device in mehreren Bedingungen vor, so wird immer nur ein Kommando ausgeführt, und zwar das erste, für das die dazugehörige Bedingung in der abgearbeiteten Reihenfolge wahr ist.

Das DOIF-Modul arbeitet mit Zuständen. Jeder Ausführungszweig DOIF/DOELSEIF..DOELSEIF/DOELSE stellt einen eigenen Zustand dar (cmd_1, cmd_2, usw.). Das Modul merkt sich den zuletzt ausgeführten Ausführungszweig und wiederholt diesen standardmäßig nicht. Ein Ausführungszweig wird erst dann wieder ausgeführt, wenn zwischenzeitlich ein anderer Ausführungszweig ausgeführt wurde, also ein Zustandswechsel stattgefunden hat. Dieses Verhalten ist sinnvoll, um zu verhindern, dass zyklisch sendende Sensoren (Temperatur, Feuchtigkeit, Helligkeit, usw.) zu ständiger Wiederholung des selben Befehls oder Befehlsabfolge führen.

Gruß

Damian
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

FunkOdyssey

Schöne Einleitung in der Doku.




Mit der v0.8 habe ich wieder eine Warnung:
PERL WARNING: Use of uninitialized value in pattern match (m//) at ./FHEM/98_DOIF.pm line 1168.