FHEM Forum

FHEM - Hausautomations-Systeme => Unterstützende Dienste => Wettermodule => Thema gestartet von: Newbie am 13 Juli 2016, 16:10:01

Titel: Twilight PERL WARNING
Beitrag von: Newbie am 13 Juli 2016, 16:10:01
Hallo Dietmar,

habe seit ein paar Tagen beim Start von FHEM folgende Zeilen im Log:

2016.07.13 15:35:29.320 1: PERL WARNING: Use of uninitialized value $result in concatenation (.) or string at ./FHEM/59_Twilight.pm line 416.
2016.07.13 15:35:29.320 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 420.
2016.07.13 15:35:29.332 1: PERL WARNING: Use of uninitialized value in numeric ne (!=) at ./FHEM/59_Twilight.pm line 278.
2016.07.13 15:35:29.334 1: PERL WARNING: Use of uninitialized value in numeric ne (!=) at ./FHEM/59_Twilight.pm line 428.
2016.07.13 15:35:29.334 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 429.


Ich benutze PERL 5.22

vg Jens
Titel: Antw:Twilight PERL WARNING
Beitrag von: CoolTux am 13 Juli 2016, 17:17:16
Da scheint das Twilight Modul keine Daten von Yahoo zu erhalten. Wie aktuell ist Dein FHEM?
Titel: Antw:Twilight PERL WARNING
Beitrag von: Newbie am 13 Juli 2016, 21:51:48
Hallo CoolTux,

FHEM ist immer aktuell und wie gesagt die Meldung ist ja nur beim Starten von FHEM.

vg Jens
Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 14 Juli 2016, 09:01:30
Sehe ich mir an
Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 14 Juli 2016, 22:02:30
Kannst du bitte den Namen deines Twilight-Geräts mit tst beginnen lassen und einmal staraten.

Dann wird beim Start von fhem  tstTwiilight(oder so) schon auf verbose 4 umgestellt. Dann solltest du logging bekommen aus dem wir vielleicht das Problem einkreisen können. 
Titel: Antw:Twilight PERL WARNING
Beitrag von: Newbie am 15 Juli 2016, 16:26:46
Hallo Dietmar,


hier die Daten

2016.07.15 16:07:13.108 1: PERL WARNING: Constant subroutine main::URL redefined at /usr/share/perl/5.22/constant.pm line 171.
2016.07.15 16:07:13.119 4: [tstmyTwilight] url=http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=20065758%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
2016.07.15 16:07:13.122 3: [tstmyTwilight] got no weather info from yahoo. Error code: http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=20065758%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys: Can't connect(1) to http://query.yahooapis.com:80: IO::Socket::INET: Bad hostname 'query.yahooapis.com:80'
2016.07.15 16:07:13.123 1: PERL WARNING: Use of uninitialized value $result in concatenation (.) or string at ./FHEM/59_Twilight.pm line 416.
2016.07.15 16:07:13.123 4: [tstmyTwilight] answer=
2016.07.15 16:07:13.123 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 420.
2016.07.15 16:07:13.125 4: [tstmyTwilight] hint: sr_astro,  ss_astro are not defined(HORIZON=-18)
2016.07.15 16:07:13.135 1: PERL WARNING: Use of uninitialized value in numeric ne (!=) at ./FHEM/59_Twilight.pm line 278.
2016.07.15 16:07:13.137 1: PERL WARNING: Use of uninitialized value in numeric ne (!=) at ./FHEM/59_Twilight.pm line 428.
2016.07.15 16:07:13.137 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 429.
2016.07.15 16:07:13.198 1: HMLAN_Parse: HMLAN1 new condition disconnected
2016.07.15 16:07:13.892 1: PERL WARNING: Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\x{ <-- HERE [1-9a-f]}/ at ./FHEM/72_FRITZBOX.pm line 4495.
Invalid argument at /usr/share/perl5/Net/SIP/Simple.pm line 143.
2016.07.15 16:07:20 2: Perfmon: ready to watch out for delays greater than one second
2016.07.15 16:07:20.825 1: PERL WARNING: Constant subroutine main::URL redefined at /usr/share/perl/5.22/constant.pm line 171.
2016.07.15 16:07:20.833 4: [tstmyTwilight] url=http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=20065758%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
2016.07.15 16:07:21.121 4: [tstmyTwilight] got weather info from yahoo for 20065758
2016.07.15 16:07:21.121 4: [tstmyTwilight] answer={"query":{"count":1,"created":"2016-07-15T14:07:20Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! Weather - Potsdam, BB, DE","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-20065758/","description":"Yahoo! Weather for Potsdam, BB, DE","language":"en-us","lastBuildDate":"Fri, 15 Jul 2016 04:07 PM CEST","ttl":"60","location":{"city":"Potsdam","country":"Germany","region":" BB"},"wind":{"chill":"63","direction":"310","speed":"35.40"},"atmosphere":{"humidity":"62","pressure":"34337.99","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"5:5 am","sunset":"9:21 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions for Potsdam, BB, DE at 03:00 PM CEST","lat":"52.374161","long":"13.13928","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-20065758/","pubDate":"Fri, 15 Jul 2016 03:00 PM CEST","condition":{"code":"39","date":"Fri, 15 Jul 2016 03:00 PM CEST","temp":"17","text":"Scattered Showers"},"forecast":[{"code":"12","date":"15 Jul 2016","day":"Fri","high":"18","low":"13","text":"Rain"},{"code":"30","date":"16 Jul 2016","day":"Sat","high":"23","low":"10","text":"Partly Cloudy"},{"code":"28","date":"17 Jul 2016","day":"Sun","high":"22","low":"16","text":"Mostly Cloudy"},{"code":"30","date":"18 Jul 2016","day":"Mon","high":"21","low":"15","text":"Partly Cloudy"},{"code":"30","date":"19 Jul 2016","day":"Tue","high":"22","low":"13","text":"Partly Cloudy"},{"code":"30","date":"20 Jul 2016","day":"Wed","high":"25","low":"14","text":"Partly Cloudy"},{"code":"39","date":"21 Jul 2016","day":"Thu","high":"25","low":"16","text":"Scattered Showers"},{"code":"30","date":"22 Jul 2016","day":"Fri","high":"25","low":"16","text":"Partly Cloudy"},{"code":"39","date":"23 Jul 2016","day":"Sat","high":"24","low":"16","text":"Scattered Showers"},{"code":"30","date":"24 Jul 2016","day":"Sun","high":"24","low":"15","text":"Partly Cloudy"}],"description":"<![CDATA[<img src=\"http://l.yimg.com/a/i/us/we/52/39.gif\"/>\n<BR />\n<b>Current Conditions:</b>\n<BR />Scattered Showers\n<BR />\n<BR />\n<b>Forecast:</b>\n<BR /> Fri - Rain. High: 18Low: 13\n<BR /> Sat - Partly Cloudy. High: 23Low: 10\n<BR /> Sun - Mostly Cloudy. High: 22Low: 16\n<BR /> Mon - Partly Cloudy. High: 21Low: 15\n<BR /> Tue - Partly Cloudy. High: 22Low: 13\n<BR />\n<BR />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-20065758/\">Full Forecast at Yahoo! Weather</a>\n<BR />\n<BR />\n(provided by <a href=\"http://www.weather.com\" >The Weather Channel</a>)\n<BR />\n]]>","guid":{"isPermaLink":"false"}}}}}}
2016.07.15 16:07:21.123 4: [tstmyTwilight] 39=Scattered Showers 17, correction: 12°
2016.07.15 16:07:21.125 4: [tstmyTwilight] hint: sr_astro,  ss_astro are not defined(HORIZON=-18)
2016.07.15 16:07:21.177 1: HMLAN_Parse: HMLAN1 new condition disconnected
2016.07.15 16:07:21.182 1: HMLAN_Parse: HMLAN1 new condition init
2016.07.15 16:07:21.691 1: PERL WARNING: Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\x{ <-- HERE [1-9a-f]}/ at ./FHEM/72_FRITZBOX.pm line 4495.
2016.07.15 16:07:23.115 1: HMLAN_Parse: hmusb new condition disconnected
2016.07.15 16:07:23.118 1: HMLAN_Parse: hmusb new condition init
2016.07.15 16:07:23.925 0: Featurelevel: 5.7
2016.07.15 16:07:23.925 0: Server started with 144 defined entities (fhem.pl:11756/2016-07-07 perl:5.022001 os:linux user:fhem pid:2312)
2016.07.15 16:07:23.933 4: [tstmyTwilight] sr_naut    2016-07-15 03:11:58  ( 2/2/-12.0°/0)   ===> sr_civil   04:19:46             
2016.07.15 16:07:23.934 4: [tstmyTwilight] sr_civil   2016-07-15 04:19:46  ( 3/3/ -6.0°/0)   ===> sr         05:12:31             
2016.07.15 16:07:23.934 4: [tstmyTwilight] sr         2016-07-15 05:12:31  ( 4/4/ +0.0°/0)   ===> sr_indoor  05:36:15             
2016.07.15 16:07:23.935 4: [tstmyTwilight] sr_indoor  2016-07-15 05:36:15  ( 5/5/ +3.0°/0)   ===> sr_weather 07:02:20             
2016.07.15 16:07:23.935 4: [tstmyTwilight] sr_weather 2016-07-15 07:02:20  ( 6/6/+15.0°/0)   ===> ss_weather 19:25:00             
2016.07.15 16:07:23.938 1: Perfmon: possible freeze starting at 16:07:21, delay is 2.938
2016.07.15 16:07:24.071 1: HMLAN_Parse: hmusb new condition ok
2016.07.15 16:07:24.102 1: HMLAN_Parse: HMLAN1 new condition ok


vg Jens
Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 15 Juli 2016, 19:03:22
erste Anlayse:

irgendetwas ist bei dir faul:


2016.07.15 16:07:13.119 4: [tstmyTwilight] url=http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=20065758%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
2016.07.15 16:07:13.122 3: [tstmyTwilight] got no weather info from yahoo. Error code: http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=20065758%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys: Can't connect(1) to http://query.yahooapis.com:80: IO::Socket::INET: Bad hostname 'query.yahooapis.com:80'

 
IO::Socket::INET: Bad hostname 'query.yahooapis.com:80'

beim ersten Zugriff auf yahoo meint INET, der hostname sei bad. Beim zweiten Zugriff 10 Sekunden später klappt der Zugriff mit dem gleichen hostname dann - merkwürdig:


2016.07.15 16:07:20.833 4: [tstmyTwilight] url=http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=20065758%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
2016.07.15 16:07:21.121 4: [tstmyTwilight] got weather info from yahoo for 20065758


Ich werde das Modul so verbessern, dass  die PERL warnings nicht mehr erzeugt werden.
Titel: Antw:Twilight PERL WARNING
Beitrag von: Newbie am 16 Juli 2016, 00:23:51
Was mir erst gestern Abend aufgefallen ist

Die Warnmeldung kommt nur bei einem System-Reboot, aber nicht bei einem Restart von FHEM.


vg
Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 17 Juli 2016, 11:24:17
Habe eine veränderte Version eingecheckt.
Probier mal ob der Fehler verschwunden ist - ich kann es nicht testen.
Titel: Antw:Twilight PERL WARNING
Beitrag von: Newbie am 17 Juli 2016, 15:50:10
Hallo Dietmar,

mit der neuen Version kommt noch das hier:

2016.07.17 15:46:10.355 1: PERL WARNING: Use of uninitialized value $result in concatenation (.) or string at ./FHEM/59_Twilight.pm line 417.

vg Jens
Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 17 Juli 2016, 17:12:29
Ok, schau ich nochmals nach
Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 17 Juli 2016, 18:20:10
Habe nochmals eine veränderte Version eingecheckt.
Probier bitte nochmals, ob der Fehler verschwunden ist.
Titel: Antw:Twilight PERL WARNING
Beitrag von: Newbie am 17 Juli 2016, 20:17:52
Hallo Dietmar,

alles supi alles schick.


danke und vg Jens
Titel: Antw:Twilight PERL WARNING
Beitrag von: my-engel am 09 September 2016, 10:55:28
Hallo Dietmar,

muss mich hier einmal anhängen, vielleicht kannst du mir ja auch helfen ...
denn ich habe ebenfalls ein Problem mit dem Modul Twilight.
Habe dieses seit ein paar Tagen installiert und jedes mal beim Start von FHEM folgende Zeile im Log:
PERL WARNING: Constant subroutine main::URL redefined at /mod/external/usr/share/fhem/lib/perl5/5.12.2/constant.pm line 130, <$fh> line 239.
Das Modul schein aber sonst zu funktionieren, es holt sich auch später dann die Werte aus dem Netz.
Die Meldung erscheint nur beim Start von FHEM , später dann nicht mehr.
Habe mal das device in "tstLichtWetter" umbenannt und das log hier eingefügt.


2016.09.09 10:25:57 3: Opening HMUSB device 127.0.0.1:1001
2016.09.09 10:25:57 1: HMLAN_Parse: HMUSB new condition init
2016.09.09 10:25:57 3: HMUSB device opened
2016.09.09 10:26:02 1: HMLAN_Parse: HMLAN1 new condition disconnected
2016.09.09 10:26:02 3: Opening HMLAN1 device 192.168.1.8:1000
2016.09.09 10:26:02 1: HMLAN_Parse: HMLAN1 new condition init
2016.09.09 10:26:02 3: HMLAN1 device opened
2016.09.09 10:26:04 1: PERL WARNING: Constant subroutine main::URL redefined at /mod/external/usr/share/fhem/lib/perl5/5.12.2/constant.pm line 130, <$fh> line 239.
2016.09.09 10:26:04 4: [tstLichtWetter] url=http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=0%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
2016.09.09 10:26:04 3: HttpUtils url=http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=0%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
2016.09.09 10:26:04 3: http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=0%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys: HTTP response code 200
2016.09.09 10:26:04 3: HttpUtils http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=0%20and%20u=%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys: Got data, length: 168
2016.09.09 10:26:04 4: [tstLichtWetter] got weather info from yahoo for 0
2016.09.09 10:26:04 4: [tstLichtWetter] answer={"query":{"count":1,"created":"2016-09-09T08:26:04Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"}}}}}
2016.09.09 10:26:04 1: Including ./log/fhem.save
2016.09.09 10:26:05 3: Device Sensor.Haustuer added to ActionDetector with 000:50 time
2016.09.09 10:26:05 3: Device Sensor.Kellertuer added to ActionDetector with 000:50 time
2016.09.09 10:26:05 3: Device Sensor.Wohnungstuer added to ActionDetector with 000:50 time
2016.09.09 10:26:05 1: usb create starting
2016.09.09 10:26:10 1: usb create end
2016.09.09 10:26:10 0: Featurelevel: 5.7
2016.09.09 10:26:10 0: Server started with 39 defined entities (fhem.pl:12095/2016-08-30 perl:5.012002 os:linux user:fhem pid:10886)
2016.09.09 10:26:10 4: [tstLichtWetter] sr_astro   2016-09-09 04:42:51  ( 1/1/-18.0°/0)   ===> sr_naut    05:25:38             
2016.09.09 10:26:10 4: [tstLichtWetter] sr_naut    2016-09-09 05:25:38  ( 2/2/-12.0°/0)   ===> sr_civil   06:05:44             
2016.09.09 10:26:10 4: [tstLichtWetter] sr_civil   2016-09-09 06:05:44  ( 3/3/ -6.0°/0)   ===> sr         06:44:23             
2016.09.09 10:26:10 4: [tstLichtWetter] sr         2016-09-09 06:44:23  ( 4/4/ +0.0°/0)   ===> sr_indoor  08:52:20             
2016.09.09 10:26:10 4: [tstLichtWetter] sr_weather 2016-09-09 06:44:23  ( 6/6/ +0.0°/0)   ===> ss_weather 19:30:30             
2016.09.09 10:26:10 4: [tstLichtWetter] sr_indoor  2016-09-09 08:52:20  ( 5/5/+20.0°/0)   ===> sr_weather 06:44:23             
2016.09.09 10:26:10 1: HMLAN_Parse: HMUSB new condition ok
2016.09.09 10:26:10 1: HMLAN_Parse: HMLAN1 new condition ok


Fhem info:
  Release  : 5.7 FeatureLevel: 5.7
  OS       : linux
  Arch     : mips-linux
  Perl     : v5.12.2

Bei mir läuft FHEM auf einer ge-freetz-ten FritzBox 7490
FHEM und auch das Modul 59_Twilight.pm habe ich schon geupdatet,
aber leider ohne Erfolg.
Danke schon mal für deine Hilfe...

vg Uwe
Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 09 September 2016, 20:26:24
ich kann vielleicht was machen
Titel: Antw:Twilight PERL WARNING
Beitrag von: my-engel am 09 September 2016, 21:51:35
Hallo Dietmar,

das wäre echt toll....

vg Uwe
Titel: Antw:Twilight PERL WARNING
Beitrag von: FunkOdyssey am 12 September 2016, 11:56:58
Vermutlich durch diese (https://sourceforge.net/p/fhem/code/12139/tree//trunk/fhem/FHEM/59_Twilight.pm?diff=51b78df35fcbc96f6b6b9d33:12138) gestrige Änderung füllt sich das Log mit folgenden Fehlern:

2016.09.12 11:50:21 1: PERL WARNING: Use of uninitialized value $URL in sprintf at ./FHEM/59_Twilight.pm line 382, <GEN316> line 1.
2016.09.12 11:50:21 3: [twilight] got no weather info from yahoo. Error code: : malformed or unsupported URL

Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 12 September 2016, 15:31:50
kläre ich heute Abend
Titel: Antw:Twilight PERL WARNING
Beitrag von: Dietmar63 am 13 September 2016, 00:01:41
done and checked in
Titel: Antw:Twilight PERL WARNING
Beitrag von: frank am 13 September 2016, 00:20:57
bei mir sind die warnungen weg, danke.
für solche fälle wäre ein disable attribut eigentlich was feines.

gruss frank
Titel: Antw:Twilight PERL WARNING
Beitrag von: my-engel am 13 September 2016, 17:48:40
Hallo Dietmar,

Danke die Fehlermeldung ist verschwunden und alles funktioniert...

Kannst du kurz erklären ob es sich um einen Fehler handelte oder evtl.
nur um einen Hinweis, dass sich etwas im "Teststadium" befandt ?
ich versuche nur einiges zu verstehen....

vg Uwe