59-twilight wirft gelegentich Fehler

Begonnen von Elektrolurch, 20 Mai 2016, 11:08:55

Vorheriges Thema - Nächstes Thema

Elektrolurch

Hallo,

seit einigen Wochen wirft das Wettermodul 59-twilight.pm meistens so um die Dämmerung nachfolgende Fehler aus und der twilight - Wert ist 0, so dass bei Tageslicht schon die Bewegungsmelder gesteuerte Beleuchtung  sich einschaltet. Vermutlich kann da bei yahoo (?) Werte nicht gelesen werden, so dass die Folgeverarbeitung Mist produziert.
Hier das Log:

2016.05.19 18:50:21 1: PERL WARNING: Bareword found where operator expected at (eval 82479) line 3, near "<TITLE>Could"
2016.05.19 18:50:21 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 18:50:21 1: PERL WARNING: Bareword found where operator expected at (eval 82479) line 6, near "<H1>Could"
2016.05.19 18:50:21 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 18:50:21 1: PERL WARNING: Use of uninitialized value $cond_code in array element at ./FHEM/59_Twilight.pm line 510.
2016.05.19 18:50:21 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 402.
2016.05.19 18:50:21 1: PERL WARNING: Use of uninitialized value in numeric ne (!=) at ./FHEM/59_Twilight.pm line 408.
2016.05.19 18:50:21 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 409.
2016.05.19 18:50:21 1: PERL WARNING: Bareword found where operator expected at (eval 82480) line 3, near "<TITLE>Could"
2016.05.19 18:50:21 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 18:50:21 1: PERL WARNING: Bareword found where operator expected at (eval 82480) line 6, near "<H1>Could"
2016.05.19 18:50:21 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 18:51:21 1: PERL WARNING: Bareword found where operator expected at (eval 82504) line 3, near "<TITLE>Could"
2016.05.19 18:51:21 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 18:51:21 1: PERL WARNING: Bareword found where operator expected at (eval 82504) line 6, near "<H1>Could"
2016.05.19 18:51:21 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 18:51:21 1: PERL WARNING: Use of uninitialized value $cond_code in array element at ./FHEM/59_Twilight.pm line 510.
2016.05.19 18:51:21 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 402.
2016.05.19 18:51:21 1: PERL WARNING: Use of uninitialized value in numeric ne (!=) at ./FHEM/59_Twilight.pm line 408.
2016.05.19 18:51:21 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 409.
2016.05.19 19:00:41 1: PERL WARNING: Bareword found where operator expected at (eval 82660) line 3, near "<TITLE>Could"
2016.05.19 19:00:41 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 19:00:41 1: PERL WARNING: Bareword found where operator expected at (eval 82660) line 6, near "<H1>Could"
2016.05.19 19:00:41 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 19:01:41 1: PERL WARNING: Bareword found where operator expected at (eval 82681) line 3, near "<TITLE>Could"
2016.05.19 19:01:41 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 19:01:41 1: PERL WARNING: Bareword found where operator expected at (eval 82681) line 6, near "<H1>Could"
2016.05.19 19:01:41 1: PERL WARNING:    (Missing operator before Could?)
2016.05.19 19:01:41 1: PERL WARNING: Use of uninitialized value $cond_code in array element at ./FHEM/59_Twilight.pm line 510.
2016.05.19 19:01:41 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 402.
2016.05.19 19:01:41 1: PERL WARNING: Use of uninitialized value in numeric ne (!=) at ./FHEM/59_Twilight.pm line 408.
2016.05.19 19:01:41 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 409.


Elektrolurch
configDB und Windows befreite Zone!

Dietmar63

hast du vielleicht eine veraltete Version im Einsatz?
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

Elektrolurch

Nein, sollte alles uptodate sein:

Fhem info:
  Release  : 5.7 FeatureLevel: 5.7
  OS       : linux
  Arch     : arm-linux-gnueabihf-thread-multi-64int
  Perl     : v5.20.2

# $Id: 59_Twilight.pm 11234 2016-04-12 17:50:46Z dietmar63 $


Gruß
Elektrolurch
configDB und Windows befreite Zone!

Dietmar63

dann schalte mal bitte das Logging auf 5 und clickse bitte auf modify - dann bitte das Log an mich.
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

ein wenig merkwürdig sind deine Fehlermeldungen schon.

Das Modul bestellt bei yahoo die Wetterdaten im json-Format. Bekommt sie aber wahrscheinlich nicht sondern inrgendwie html.

Wenn ich den Rückgabewert künstlich auf "<TITLE>Could" setzte bekomme ich folgenden Fehler:


2016.05.20 22:15:24 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 414.
2016.05.20 22:15:24 1: PERL WARNING: Use of uninitialized value in numeric ne (!=) at ./FHEM/59_Twilight.pm line 413.
2016.05.20 22:15:24 1: PERL WARNING: Use of uninitialized value in numeric eq (==) at ./FHEM/59_Twilight.pm line 407.
2016.05.20 22:15:23 1: PERL WARNING: Use of uninitialized value $temperatur in concatenation (.) or string at ./FHEM/59_Twilight.pm line 525.
2016.05.20 22:15:23 1: PERL WARNING: Use of uninitialized value $cond_txt in concatenation (.) or string at ./FHEM/59_Twilight.pm line 525.
2016.05.20 22:15:23 1: PERL WARNING: Use of uninitialized value $cond_code in concatenation (.) or string at ./FHEM/59_Twilight.pm line 525.
2016.05.20 22:15:23 1: PERL WARNING: Use of uninitialized value $cond_code in array element at ./FHEM/59_Twilight.pm line 519.
parsing {"query":{"count":1,"created":"2016-05-20T20:15:23Z","lang":"en-US","results":{"channel":{"units":{"distance":"km","pressure":"mb","speed":"km/h","temperature":"C"},"title":"Yahoo! Weather - Burgdorf, NI, DE","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-12833457/","description":"Yahoo! Weather for Burgdorf, NI, DE","language":"en-us","lastBuildDate":"Fri, 20 May 2016 10:15 PM CEST","ttl":"60","location":{"city":"Burgdorf","country":"Germany","region":" NI"},"wind":{"chill":"57","direction":"230","speed":"17.70"},"atmosphere":{"humidity":"88","pressure":"34202.54","rising":"0","visibility":"25.91"},"astronomy":{"sunrise":"5:14 am","sunset":"9:19 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 Burgdorf, NI, DE at 09:00 PM CEST","lat":"52.4739","long":"10.01198","link":"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-12833457/","pubDate":"Fri, 20 May 2016 09:00 PM CEST","condition":{"code":"26","date":"Fri, 20 May 2016 09:00 PM CEST","temp":"14","text":"Cloudy"},"forecast":[{"code":"26","date":"20 May 2016","day":"Fri","high":"17","low":"10","text":"Cloudy"},{"code":"26","date":"21 May 2016","day":"Sat","high":"22","low":"10","text":"Cloudy"},{"code":"39","date":"22 May 2016","day":"Sun","high":"26","low":"13","text":"Scattered Showers"},{"code":"39","date":"23 May 2016","day":"Mon","high":"16","low":"12","text":"Scattered Showers"},{"code":"28","date":"24 May 2016","day":"Tue","high":"17","low":"9","text":"Mostly Cloudy"},{"code":"30","date":"25 May 2016","day":"Wed","high":"20","low":"10","text":"Partly Cloudy"},{"code":"28","date":"26 May 2016","day":"Thu","high":"23","low":"12","text":"Mostly Cloudy"},{"code":"30","date":"27 May 2016","day":"Fri","high":"21","low":"12","text":"Partly Cloudy"},{"code":"28","date":"28 May 2016","day":"Sat","high":"22","low":"12","text":"Mostly Cloudy"},{"code":"39","date":"29 May 2016","day":"Sun","high":"21","low":"12","text":"Scattered Showers"}],"description":"<![CDATA[<img src=\"http://l.yimg.com/a/i/us/we/52/26.gif\"/>\n<BR />\n<b>Current Conditions:</b>\n<BR />Cloudy\n<BR />\n<BR />\n<b>Forecast:</b>\n<BR /> Fri - Cloudy. High: 17Low: 10\n<BR /> Sat - Cloudy. High: 22Low: 10\n<BR /> Sun - Scattered Showers. High: 26Low: 13\n<BR /> Mon - Scattered Showers. High: 16Low: 12\n<BR /> Tue - Mostly Cloudy. High: 17Low: 9\n<BR />\n<BR />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-12833457/\">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.05.20 22:15:23 3: [Twilight] error syntax error at (eval 10660) line 2, near "<TITLE>Could
2016.05.20 22:15:23 1: PERL WARNING: Bareword found where operator expected at (eval 10660) line 1, near "<TITLE>Could"


Das entspricht fast deinen Fehlermeldungen.
Bei mir passiert das praktisch nie.
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

Elektrolurch

Hallo Dietmar,

wie oben gesagt: Es ist bis jetzt auch nur ein oder zweimal aufgetreten. Die Folge ist dann, dass das Licht tagsüber eingeschaltet wird, weil twilight-weather = 0 zu sein scheint.
Meine Frage war auch nur, ob man das vorher abfangen kann, d.h. wenn die Daten nicht korrekt kommen, dass man die readings erst gar nicht versucht zu setzen.
Es gibt doch für den parser eval die Variable @#, vielleicht kann man die ja abfragen und wenn die gesetzt ist, den Rest abbrechen.

Gruß

Elektrolurch
configDB und Windows befreite Zone!

Dietmar63

Das passiert eigentlich schonschon. Ich werde versuchen es wasserdichter zu gestalten. dicht
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

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