Autor Thema: [erledigt] seit Mitternacht im Minutentakt Fehler im Log (99_Utils.pm line 116)  (Gelesen 1123 mal)

Offline Loki

  • Full Member
  • ***
  • Beiträge: 126
Hallo, ich habe seit Mitternacht folgende Fehler im Log:
2020.01.01 00:01:04 1: PERL WARNING: Argument "undef" isn't numeric in subtraction (-) at ./FHEM/99_Utils.pm line 116.
2020.01.01 00:01:04 1: stacktrace:
2020.01.01 00:01:04 1:     main::__ANON__                      called by ./FHEM/99_Utils.pm (116)
2020.01.01 00:01:04 1:     main::SVG_time_to_sec               called by ./FHEM/98_logProxy.pm (470)
2020.01.01 00:01:04 1:     main::logProxy_shiftTime            called by ./FHEM/98_logProxy.pm (937)
2020.01.01 00:01:04 1:     main::logProxy_Get                  called by fhem.pl (3763)
2020.01.01 00:01:04 1:     main::CallFn                        called by fhem.pl (1964)
2020.01.01 00:01:04 1:     main::CommandGet                    called by fhem.pl (1245)
2020.01.01 00:01:04 1:     main::AnalyzeCommand                called by ./FHEM/01_FHEMWEB.pm (2686)
2020.01.01 00:01:04 1:     main::FW_fC                         called by ./FHEM/98_SVG.pm (1216)
2020.01.01 00:01:04 1:     main::SVG_getData                   called by ./FHEM/98_SVG.pm (1182)
2020.01.01 00:01:04 1:     main::SVG_doShowLog                 called by ./FHEM/98_SVG.pm (1075)
2020.01.01 00:01:04 1:     main::SVG_showLog                   called by ./FHEM/01_FHEMWEB.pm (943)
2020.01.01 00:01:04 1:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (583)
2020.01.01 00:01:04 1:     main::FW_Read                       called by fhem.pl (3763)
2020.01.01 00:01:04 1:     main::CallFn                        called by fhem.pl (756)
2020.01.01 00:02:34 1: PERL WARNING: Argument "undef" isn't numeric in subtraction (-) at ./FHEM/99_Utils.pm line 116.
2020.01.01 00:02:34 1: stacktrace:
2020.01.01 00:02:34 1:     main::__ANON__                      called by ./FHEM/99_Utils.pm (116)
2020.01.01 00:02:34 1:     main::SVG_time_to_sec               called by ./FHEM/98_logProxy.pm (470)
2020.01.01 00:02:34 1:     main::logProxy_shiftTime            called by ./FHEM/98_logProxy.pm (937)
2020.01.01 00:02:34 1:     main::logProxy_Get                  called by fhem.pl (3763)
2020.01.01 00:02:34 1:     main::CallFn                        called by fhem.pl (1964)
2020.01.01 00:02:34 1:     main::CommandGet                    called by fhem.pl (1245)
2020.01.01 00:02:34 1:     main::AnalyzeCommand                called by ./FHEM/01_FHEMWEB.pm (2686)
2020.01.01 00:02:34 1:     main::FW_fC                         called by ./FHEM/98_SVG.pm (1216)
2020.01.01 00:02:34 1:     main::SVG_getData                   called by ./FHEM/98_SVG.pm (1182)
2020.01.01 00:02:34 1:     main::SVG_doShowLog                 called by ./FHEM/98_SVG.pm (1075)
2020.01.01 00:02:34 1:     main::SVG_showLog                   called by ./FHEM/01_FHEMWEB.pm (943)
2020.01.01 00:02:34 1:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (583)
2020.01.01 00:02:34 1:     main::FW_Read                       called by fhem.pl (3763)
2020.01.01 00:02:34 1:     main::CallFn                        called by fhem.pl (756)
2020.01.01 00:04:04 1: PERL WARNING: Argument "undef" isn't numeric in subtraction (-) at ./FHEM/99_Utils.pm line 116.
2020.01.01 00:04:04 1: stacktrace:
2020.01.01 00:04:04 1:     main::__ANON__                      called by ./FHEM/99_Utils.pm (116)
2020.01.01 00:04:04 1:     main::SVG_time_to_sec               called by ./FHEM/98_logProxy.pm (470)
2020.01.01 00:04:04 1:     main::logProxy_shiftTime            called by ./FHEM/98_logProxy.pm (937)
2020.01.01 00:04:04 1:     main::logProxy_Get                  called by fhem.pl (3763)
2020.01.01 00:04:04 1:     main::CallFn                        called by fhem.pl (1964)
2020.01.01 00:04:04 1:     main::CommandGet                    called by fhem.pl (1245)
2020.01.01 00:04:04 1:     main::AnalyzeCommand                called by ./FHEM/01_FHEMWEB.pm (2686)
2020.01.01 00:04:04 1:     main::FW_fC                         called by ./FHEM/98_SVG.pm (1216)
2020.01.01 00:04:04 1:     main::SVG_getData                   called by ./FHEM/98_SVG.pm (1182)
2020.01.01 00:04:04 1:     main::SVG_doShowLog                 called by ./FHEM/98_SVG.pm (1075)
2020.01.01 00:04:04 1:     main::SVG_showLog                   called by ./FHEM/01_FHEMWEB.pm (943)
2020.01.01 00:04:04 1:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (583)
2020.01.01 00:04:04 1:     main::FW_Read                       called by fhem.pl (3763)
2020.01.01 00:04:04 1:     main::CallFn                        called by fhem.pl (756)
2020.01.01 00:05:34 1: PERL WARNING: Argument "undef" isn't numeric in subtraction (-) at ./FHEM/99_Utils.pm line 116.
2020.01.01 00:05:34 1: stacktrace:
2020.01.01 00:05:34 1:     main::__ANON__                      called by ./FHEM/99_Utils.pm (116)
2020.01.01 00:05:34 1:     main::SVG_time_to_sec               called by ./FHEM/98_logProxy.pm (470)
2020.01.01 00:05:34 1:     main::logProxy_shiftTime            called by ./FHEM/98_logProxy.pm (937)
2020.01.01 00:05:34 1:     main::logProxy_Get                  called by fhem.pl (3763)
2020.01.01 00:05:34 1:     main::CallFn                        called by fhem.pl (1964)
2020.01.01 00:05:34 1:     main::CommandGet                    called by fhem.pl (1245)
2020.01.01 00:05:34 1:     main::AnalyzeCommand                called by ./FHEM/01_FHEMWEB.pm (2686)
2020.01.01 00:05:34 1:     main::FW_fC                         called by ./FHEM/98_SVG.pm (1216)
2020.01.01 00:05:34 1:     main::SVG_getData                   called by ./FHEM/98_SVG.pm (1182)
2020.01.01 00:05:34 1:     main::SVG_doShowLog                 called by ./FHEM/98_SVG.pm (1075)
2020.01.01 00:05:34 1:     main::SVG_showLog                   called by ./FHEM/01_FHEMWEB.pm (943)
2020.01.01 00:05:34 1:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (583)
2020.01.01 00:05:34 1:     main::FW_Read                       called by fhem.pl (3763)
2020.01.01 00:05:34 1:     main::CallFn                        called by fhem.pl (756)
2020.01.01 00:07:04 1: PERL WARNING: Argument "undef" isn't numeric in subtraction (-) at ./FHEM/99_Utils.pm line 116.
2020.01.01 00:07:04 1: stacktrace:
2020.01.01 00:07:04 1:     main::__ANON__                      called by ./FHEM/99_Utils.pm (116)
2020.01.01 00:07:04 1:     main::SVG_time_to_sec               called by ./FHEM/98_logProxy.pm (470)
2020.01.01 00:07:04 1:     main::logProxy_shiftTime            called by ./FHEM/98_logProxy.pm (937)
2020.01.01 00:07:04 1:     main::logProxy_Get                  called by fhem.pl (3763)
2020.01.01 00:07:04 1:     main::CallFn                        called by fhem.pl (1964)
2020.01.01 00:07:04 1:     main::CommandGet                    called by fhem.pl (1245)
2020.01.01 00:07:04 1:     main::AnalyzeCommand                called by ./FHEM/01_FHEMWEB.pm (2686)
2020.01.01 00:07:04 1:     main::FW_fC                         called by ./FHEM/98_SVG.pm (1216)
2020.01.01 00:07:04 1:     main::SVG_getData                   called by ./FHEM/98_SVG.pm (1182)
2020.01.01 00:07:04 1:     main::SVG_doShowLog                 called by ./FHEM/98_SVG.pm (1075)
2020.01.01 00:07:04 1:     main::SVG_showLog                   called by ./FHEM/01_FHEMWEB.pm (943)
2020.01.01 00:07:04 1:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (583)
2020.01.01 00:07:04 1:     main::FW_Read                       called by fhem.pl (3763)
2020.01.01 00:07:04 1:     main::CallFn                        called by fhem.pl (756)
2020.01.01 00:08:34 1: PERL WARNING: Argument "undef" isn't numeric in subtraction (-) at ./FHEM/99_Utils.pm line 116.
2020.01.01 00:08:34 1: stacktrace:
2020.01.01 00:08:34 1:     main::__ANON__                      called by ./FHEM/99_Utils.pm (116)
2020.01.01 00:08:34 1:     main::SVG_time_to_sec               called by ./FHEM/98_logProxy.pm (470)
2020.01.01 00:08:34 1:     main::logProxy_shiftTime            called by ./FHEM/98_logProxy.pm (937)
2020.01.01 00:08:34 1:     main::logProxy_Get                  called by fhem.pl (3763)
2020.01.01 00:08:34 1:     main::CallFn                        called by fhem.pl (1964)
2020.01.01 00:08:34 1:     main::CommandGet                    called by fhem.pl (1245)
2020.01.01 00:08:34 1:     main::AnalyzeCommand                called by ./FHEM/01_FHEMWEB.pm (2686)
2020.01.01 00:08:34 1:     main::FW_fC                         called by ./FHEM/98_SVG.pm (1216)
2020.01.01 00:08:34 1:     main::SVG_getData                   called by ./FHEM/98_SVG.pm (1182)
2020.01.01 00:08:34 1:     main::SVG_doShowLog                 called by ./FHEM/98_SVG.pm (1075)
2020.01.01 00:08:34 1:     main::SVG_showLog                   called by ./FHEM/01_FHEMWEB.pm (943)
2020.01.01 00:08:34 1:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (583)
2020.01.01 00:08:34 1:     main::FW_Read                       called by fhem.pl (3763)
2020.01.01 00:08:34 1:     main::CallFn                        called by fhem.pl (756)
« Letzte Änderung: 17 Januar 2020, 20:22:02 von Loki »

Offline rudolfkoenig

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 22831
Ich tippe auf irgendwelche Probleme im Zusammenhang mit logProxy/offset.

Offline Loki

  • Full Member
  • ***
  • Beiträge: 126
Ich habe gerade alle gplot Dateien geprüft.
Ein offset wird nirgends mehr verwendet.

Der Fehler bleibt:
2020.01.06 21:40:15 1: PERL WARNING: Use of uninitialized value $sy in addition (+) at ./FHEM/98_SVG.pm line 1018.
2020.01.06 21:40:15 1: stacktrace:
2020.01.06 21:40:15 1:     main::__ANON__                      called by ./FHEM/98_SVG.pm (1018)
2020.01.06 21:40:15 1:     main::SVG_calcOffsets               called by ./FHEM/98_SVG.pm (1104)
2020.01.06 21:40:15 1:     main::SVG_doShowLog                 called by ./FHEM/98_SVG.pm (1076)
2020.01.06 21:40:15 1:     main::SVG_showLog                   called by ./FHEM/01_FHEMWEB.pm (943)
2020.01.06 21:40:15 1:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (583)
2020.01.06 21:40:15 1:     main::FW_Read                       called by fhem.pl (3761)
2020.01.06 21:40:15 1:     main::CallFn                        called by fhem.pl (756)
« Letzte Änderung: 06 Januar 2020, 21:41:03 von Loki »

Offline Loki

  • Full Member
  • ***
  • Beiträge: 126
Ich habe mal global Verbose auf 5 gesetzt und bekomme nun folgendes im log:
2020.01.12 10:12:13 4 : Connection accepted from WEBapiLocal_192.168.178.117_58970
2020.01.12 10:12:13 4 : WEBapiLocal_192.168.178.117_58970 GET /fhem/SVG_showLog?dev=ZAEHLER1.Verbrauch.Monat.svg&logdev=myDbLog&gplotfile=ZAEHLER.unten&logfile=HISTORY&pos=&t=1578820332977; BUFLEN:0
2020.01.12 10:12:13 1 : PERL WARNING: Use of uninitialized value $sy in addition (+) at ./FHEM/98_SVG.pm line 1018.
2020.01.12 10:12:13 1 : stacktrace:
2020.01.12 10:12:13 1 :     main::__ANON__                      called by ./FHEM/98_SVG.pm (1018)
2020.01.12 10:12:13 1 :     main::SVG_calcOffsets               called by ./FHEM/98_SVG.pm (1104)
2020.01.12 10:12:13 1 :     main::SVG_doShowLog                 called by ./FHEM/98_SVG.pm (1076)
2020.01.12 10:12:13 1 :     main::SVG_showLog                   called by ./FHEM/01_FHEMWEB.pm (943)
2020.01.12 10:12:13 1 :     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (583)
2020.01.12 10:12:13 1 :     main::FW_Read                       called by fhem.pl (3761)
2020.01.12 10:12:13 1 :     main::CallFn                        called by fhem.pl (756)
2020.01.12 10:12:13 5 : plotcommand: get myDbLog HISTORY INT 2020-01-01_00:00:00 2020-01-31_23:59:59  DbLog:myDbLog:ZAEHLER1_Werte:kostenMonat:: ZAEHLER1_Werte:verbrauchAbsolutTag ConstY:16.8
2020.01.12 10:12:13 5 : Cmd: >get logProxy CURRENT INT 2020-01-01_00:00:00 2020-01-31_23:59:59 DbLog:myDbLog:ZAEHLER1_Werte:kostenMonat:: ConstY:16.8<
2020.01.12 10:12:13 4 : logProxy: calling get myDbLog HISTORY INT 2020-01-01_00:00:00 2020-01-31_23:59:59 ZAEHLER1_Werte:kostenMonat::
2020.01.12 10:12:13 5 : Cmd: >get myDbLog HISTORY INT 2020-01-01_00:00:00 2020-01-31_23:59:59 ZAEHLER1_Werte:kostenMonat::<
2020.01.12 10:12:13 5 : Cmd: >get myDbLog HISTORY INT 2020-01-01_00:00:00 2020-01-31_23:59:59 ZAEHLER1_Werte:verbrauchAbsolutTag<
2020.01.12 10:12:13 5 : Cmd: >{ "HISTORY" }<
2020.01.12 10:12:13 5 : Cmd: >{ "Tag in kWh: $data{currval2}, Mittel: $data{avg2}  | Montas-Kosten: $data{currval1}€" }<


das listing vom SVG:
Internals:
   DEF        myDbLog:ZAEHLER.unten:HISTORY
   FUUID      5c43a4f2-f33f-a31c-a0b1-27ca5c5e12fa379b
   GPLOTFILE  ZAEHLER.unten
   LOGDEVICE  myDbLog
   LOGFILE    HISTORY
   NAME       ZAEHLER1.Verbrauch.Monat.svg
   NOTIFYDEV  global
   NR         792
   STATE      initialized
   TYPE       SVG
Attributes:
   DbLogExclude .*
   fixedrange month
   label      "Tag in kWh: $data{currval2}, Mittel: $data{avg2}  | Montas-Kosten: $data{currval1}€"
   room       80_Energie,99_Plots

das gplot file:
# Created by FHEM/98_SVG.pm, 2020-01-06 20:09:40
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<L1>'
set ytics
set y2tics
set grid ytics
set ylabel "€ Monat"
set y2label "kWh Tag"
set yrange [0:140]
set y2range [0:20]

#logProxy DbLog:myDbLog:ZAEHLER1_Werte:kostenMonat::
#myDbLog ZAEHLER1_Werte:verbrauchAbsolutTag
#logProxy ConstY:16.8

plot "<IN>" using 1:2 axes x1y1 title 'Kosten Monat' ls l5fill lw 1 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'pro Tag (absolut)' ls l0fill_gyr lw 2 with cubic,\
     "<IN>" using 1:2 axes x1y2 title 'Abschlag' ls l4 lw 1 with lines

ein Offset gibt es nirgends...

Offline Loki

  • Full Member
  • ***
  • Beiträge: 126
der betreffende Bereich im cooding von 98_SVG.pm (# $Id: 98_SVG.pm 20859 2019-12-31 10:21:48Z rudolfkoenig $):

} elsif($zoom eq "month") {
    my ($sd,$ed,$sm,$em,$sy,$ey);
    my @l = localtime($now);
    while($off < -12) { # Correct the year
      $off += 12; $l[5]--;
    }
    $l[4] += $off;
    $l[4] += 12, $l[5]-- if($l[4] < 0);
    my @me = (31,28,31,30,31,30,31,31,30,31,30,31);
    $me[1]++ if(($sy+1900)%4); # leap year. Ignore 1900 and 2100 :)

    if(SVG_Attr($FW_wname, $wl, "endPlotToday", undef)) {
      $sy = $ey = $l[5];
      $sm = $l[4]-1; $em = $l[4];
      $sm += 12, $sy-- if($sm < 0);
      $sd = $l[3]+1; $ed = $l[3];
      $sd=1, $sm=$em, $sy=$ey if($sd > $me[$sm]);
      $ed = $me[$em] if($ed > $me[$em]);

    } else {
      $sy = $ey = $l[5];
      $sm = $em = $l[4];
      $sd = 1; $ed = $me[$l[4]];
    }
    $SVG_devs{$d}{from} = SVG_tspec( 0, 0, 0,$sd,$sm,$sy);
    $SVG_devs{$d}{to}   = SVG_tspec(59,59,23,$ed,$em,$ey);

  }


Das Problem ist die Variable $sy.
Eventuell liege ich falsch, aber in der Zeile
$me[1]++ if(($sy+1900)%4); # leap year. Ignore 1900 and 2100 :)
ist doch $sy immer noch initial, oder?
« Letzte Änderung: 12 Januar 2020, 10:51:16 von Loki »

Offline rudolfkoenig

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 22831
Doch, die Zeile da ist fehl am Platz, danke fuer den Hinweis.
Habs umgebaut und eingecheckt.
Gefällt mir Gefällt mir x 1 Liste anzeigen

Offline Loki

  • Full Member
  • ***
  • Beiträge: 126
Danke, der Fehler ist weg!