Bug in HTTPMOD Modul?

Begonnen von Trinidad, 27 Mai 2020, 18:34:02

Vorheriges Thema - Nächstes Thema

Trinidad

Hallo,

habe seit gestern das Problem, dass seit gestern eine HTTPMOD Gerät ein Bug liefert. Das einzige was ich gemacht habe war ein FHEM Update. Es lief sonst alles bisher ohne Probleme und nun das. Scheinbar erkennt HTTPMOD das JSON Array nicht mehr als solches, obwohl es nach wie vor eines gibt, wie man deutlich erkennen kann. Wenn ich die URL mit Firefox öffne, dann erkennt Firefox auch sofort das JSON Array und gibt es schön formatiert aus.
Hier ein verbose 5 Log des Fehlers:

Zitat
2020.05.27 17:47:30 5: Emlog.laufend: GetUpdate called (update)
2020.05.27 17:47:30 5: Emlog.laufend: update timer modified: will call GetUpdate in 60.0 seconds at 2020-05-27 17:48:30
2020.05.27 17:47:30 5: Emlog.laufend: AddToQueue adds type update to URL http://192.168.1.28/pages/getinformation.php?export&meterindex=1, no data, no headers, retry 0, initial queue len: 0
2020.05.27 17:47:30 5: Emlog.laufend: HandleSendQueue called, qlen = 1
2020.05.27 17:47:30 4: Emlog.laufend: HandleSendQueue sends update with timeout 2 to http://192.168.1.28/pages/getinformation.php?export&meterindex=1, No Data, No Header
2020.05.27 17:47:30 5: HttpUtils url=http://192.168.1.28/pages/getinformation.php?export&meterindex=1
2020.05.27 17:47:30 4: IP: 192.168.1.28 -> 192.168.1.28
2020.05.27 17:47:30 5: HttpUtils request header:
GET /pages/getinformation.php?export&meterindex=1 HTTP/1.0
Host: 192.168.1.28
User-Agent: fhem
Accept-Encoding: gzip,deflate

2020.05.27 17:47:30 4: http://192.168.1.28/pages/getinformation.php?export&meterindex=1: HTTP response code 200
2020.05.27 17:47:30 5: HttpUtils http://192.168.1.28/pages/getinformation.php?export&meterindex=1: Got data, length: 731
2020.05.27 17:47:30 5: HttpUtils response header:
HTTP/1.0 200 OK
Content-type: application/json
Content-Length: 731
Connection: close
Date: Wed, 27 May 2020 15:47:29 GMT
Server: lighttpd/1.4.35
2020.05.27 17:47:30 4: Emlog.laufend: Read callback: request type was update retry 0,
header: HTTP/1.0 200 OK
Content-type: application/json
Content-Length: 731
Connection: close
Date: Wed, 27 May 2020 15:47:29 GMT
Server: lighttpd/1.4.35, body length 731
2020.05.27 17:47:30 5: Emlog.laufend: Read callback: body
{"product":"Emlog - Electronic Meter Log","version":1.1,"Zaehlerstand_Bezug":{"Stand180":4878.0709,"Stand181":4878.0709,"Stand182":0},"Zaehlerstand_Lieferung":{"Stand280":348.1674,"Stand281":348.1674,"Stand282":0},"Wirkleistung_Bezug":{"Leistung170":-279,"Leistung171":227,"Leistung172":-1214,"Leistung173":706},"Wirkleistung_Lieferung":{"Leistung270":0,"Leistung271":0,"Leistung272":0,"Leistung273":0},"Kwh_Bezug":{"Kwh180":8.0487999999996,"Kwh181":8.0487999999996,"Kwh182":0},"Kwh_Lieferung":{"Kwh280":14.5325,"Kwh281":14.5325,"Kwh282":0},"Betrag_Bezug":{"Betrag180":0,"Betrag181":0,"Betrag182":0,"Waehrung":"EUR"},"Betrag_Lieferung":{"Betrag280":0,"Betrag281":0,"Betrag282":0,"Waehrung":"EUR"},"DiffBezugLieferung":{"Betrag":0}}
2020.05.27 17:47:30 4: Emlog.laufend: Read is decoding the buffer as utf-8
2020.05.27 17:47:30 3: Emlog.laufend: error while parsing JSON data: JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at (eval 55848) line 1.

2020.05.27 17:47:30 5: Emlog.laufend: GetCookies is looking for Cookies
2020.05.27 17:47:30 5: Emlog.laufend: ExtractSid called, context reading, num
2020.05.27 17:47:30 4: Emlog.laufend: checking for redirects, code=200, ignore=0
2020.05.27 17:47:30 4: Emlog.laufend: no redirects to handle
2020.05.27 17:47:30 5: Emlog.laufend: CheckAuth decided no authentication required
2020.05.27 17:47:30 3: Emlog.laufend: no parsed JSON structure available
2020.05.27 17:47:30 5: Emlog.laufend: Read starts parsing response to update with defined readings:
2020.05.27 17:47:30 4: Emlog.laufend: Read response to update didn't match any Reading
2020.05.27 17:47:30 5: Emlog.laufend: HandleSendQueue called, qlen = 0   

Hier noch das define und die Attribute:
Zitat
define Emlog.laufend HTTPMOD http://192.168.1.28/pages/getinformation.php?export&meterindex=1 60
setuuid Emlog.laufend 5ead9432-f33f-44ee-de66-df423eeeed3f34b4
attr Emlog.laufend alignTime 00:00:30
attr Emlog.laufend bodyDecode utf-8
attr Emlog.laufend enableControlSet 1
attr Emlog.laufend enforceGoodReadingNames 1
attr Emlog.laufend event-on-change-reading .*
attr Emlog.laufend extractAllJSON 1
attr Emlog.laufend group Strommessgeräte
attr Emlog.laufend icon measure_power_meter@SkyBlue
attr Emlog.laufend room Strom
attr Emlog.laufend stateFormat Bezug: Wirkleistung_Bezug_Leistung170 Watt
hat jemand eine Idee?

Christoph Morrison

Welche Version der JSON-Library nutzt du?


cpan -D JSON

Trinidad

#2
Es sagt:

Zitat
root@FHEM-Server:~# cpan -D JSON
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
  Database was generated on Wed, 27 May 2020 16:55:54 GMT
JSON
-------------------------------------------------------------------------
        (no description)
        I/IS/ISHIGAKI/JSON-4.02.tar.gz
        /usr/share/perl5/JSON.pm
        Installed: 4.02
        CPAN:      4.02  up to date
        Kenichi Ishigaki (ISHIGAKI)
        ishigaki@cpan.org



Christoph Morrison

Ich hab eben mal einen Test mit dem Body aus deinem list mit JSON gemacht und da sehe ich auch keinen Fehler.

Trinidad

Liegt an meinem Debian. Wie ich festgestellt habe gehen alle HTTPMOD Geräte nicht mehr. Auch Yahoo Wetter schmeisst den Fehler raus. Neuinstallation von Perl-JSon hat auch nix gebracht. Werde gleich mal Debian wegmachen und Ubuntu Server draufmachen.