Erstmal vorweg, das Modul ist eigentlich super.
Ich mache bestimmt einen Fehler aber ich habe da ein Problem.
Folgende Quelle
https://api.weatherbit.io/v2.0/forecast/daily?lang=de&city=Bremerhaven&key=meiner
Liefert das Ergebnis
Zitat{"city_name":"Bremerhaven","country_code":"DE","data":[{"app_max_temp":10.4,"app_min_temp":3.4,"clouds":73,"clouds_hi":0,"clouds_low":62,"clouds_mid":60,"datetime":"2023-04-11","dewpt":4.5,"high_temp":8.6,"low_temp":4.7,"max_dhi":null,"max_temp":10.4,"min_temp":6.7,"moon_phase":0.621522,"moon_phase_lunation":0.72,"moonrise_ts":1681172354,"moonset_ts":1681198681,"ozone":392.3,"pop":75,"precip":5.5035644,"pres":1009.5,"rh":79,"slp":1009.6,"snow":0,"snow_depth":0,"sunrise_ts":1681187764,"sunset_ts":1681237269,"temp":8,"ts":1681196460,"uv":1.9,"valid_date":"2023-04-11","vis":20.32,"weather":{"code":500,"icon":"r01d","description":"Leichter Regen"},"wind_cdir":"WSW","wind_cdir_full":"West-Südwestlich","wind_dir":254,"wind_gust_spd":11.8,"wind_spd":5.9},{"app_max_temp":10,"app_min_temp":2.5,"clouds":81,"clouds_hi":18,"clouds_low":51,"clouds_mid":75,"datetime":"2023-04-12","dewpt":4,"high_temp":10,"low_temp":6.5,"max_dhi":null,"max_temp":10,"min_temp":6.1,"moon_phase":0.50275,"moon_phase_lunation":0.76,"moonrise_ts":1681263064,"moonset_ts":1681289577,"ozone":381.2,"pop":80,"precip":7.7000003,"pres":1000.9,"rh":76,"slp":1001,"snow":0,"snow_depth":0,"sunrise_ts":1681274023,"sunset_ts":1681323779,"temp":8,"ts":1681250460,"uv":1.6,"valid_date":"2023-04-12","vis":21.088,"weather":{"code":500,"icon":"r01d","description":"Leichter Regen"},"wind_cdir":"SSO","wind_cdir_full":"Süd-Südost","wind_dir":157,"wind_gust_spd":8.4,"wind_spd":5},{"app_max_temp":10.8,"app_min_temp":2.5,"clouds":69,"clouds_hi":3,"clouds_low":45,"clouds_mid":24,"datetime":"2023-04-13","dewpt":4.2,"high_temp":10.8,"low_temp":4.7,"max_dhi":null,"max_temp":10.8,"min_temp":6.5,"moon_phase":0.381368,"moon_phase_lunation":0.79,"moonrise_ts":1681352657,"moonset_ts":1681381284,"ozone":414.1,"pop":35,"precip":1,"pres":1002.6,"rh":75,"slp":1002.7,"snow":0,"snow_depth":0,"sunrise_ts":1681360283,"sunset_ts":1681410289,"temp":8.3,"ts":1681336860,"uv":5.3,"valid_date":"2023-04-13","vis":22.707,"weather":{"code":803,"icon":"c03d","description":"Aufgelockert Bewölkt"},"wind_cdir":"SSW","wind_cdir_full":"Süd-südwesten","wind_dir":204,"wind_gust_spd":9.4,"wind_spd":5.9},{"app_max_temp":12,"app_min_temp":2.5,"clouds":28,"clouds_hi":3,"clouds_low":6,"clouds_mid":9,"datetime":"2023-04-14","dewpt":2.9,"high_temp":12,"low_temp":6.5,"max_dhi":null,"max_temp":12,"min_temp":4.7,"moon_phase":0.26576,"moon_phase_lunation":0.82,"moonrise_ts":1681441195,"moonset_ts":1681473268,"ozone":403.7,"pop":0,"precip":0,"pres":1009.9,"rh":69,"slp":1010,"snow":0,"snow_depth":0,"sunrise_ts":1681446544,"sunset_ts":1681496798,"temp":8.5,"ts":1681423260,"uv":5.4,"valid_date":"2023-04-14","vis":24.128,"weather":{"code":802,"icon":"c02d","description":"Verstreute Wolken"},"wind_cdir":"OSO","wind_cdir_full":"Osten-Südöstlich","wind_dir":102,"wind_gust_spd":5.6,"wind_spd":3.1},{"app_max_temp":11.1,"app_min_temp":3.8,"clouds":75,"clouds_hi":4,"clouds_low":54,"clouds_mid":14,"datetime":"2023-04-15","dewpt":5.7,"high_temp":11.1,"low_temp":7.6,"max_dhi":null,"max_temp":11.1,"min_temp":6.5,"moon_phase":0.164094,"moon_phase_lunation":0.86,"moonrise_ts":1681529013,"moonset_ts":1681565202,"ozone":393,"pop":25,"precip":0.6,"pres":1013,"rh":81,"slp":1013.2,"snow":0,"snow_depth":0,"sunrise_ts":1681532805,"sunset_ts":1681583308,"temp":8.8,"ts":1681509660,"uv":2,"valid_date":"2023-04-15","vis":22.358,"weather":{"code":804,"icon":"c04d","description":"Bewölkt"},"wind_cdir":"NNO","wind_cdir_full":"Norden-Nordost","wind_dir":25,"wind_gust_spd":7.8,"wind_spd":4.9},{"app_max_temp":12.2,"app_min_temp":7.6,"clouds":69,"clouds_hi":41,"clouds_low":43,"clouds_mid":9,"datetime":"2023-04-16","dewpt":6.2,"high_temp":12.2,"low_temp":6.7,"max_dhi":null,"max_temp":12.2,"min_temp":7.6,"moon_phase":0.0833191,"moon_phase_lunation":0.89,"moonrise_ts":1681616408,"moonset_ts":1681656986,"ozone":366,"pop":0,"precip":0,"pres":1015.7,"rh":79,"slp":1015.9,"snow":0,"snow_depth":0,"sunrise_ts":1681619067,"sunset_ts":1681669818,"temp":9.7,"ts":1681596060,"uv":6,"valid_date":"2023-04-16","vis":24.128,"weather":{"code":803,"icon":"c03d","description":"Aufgelockert Bewölkt"},"wind_cdir":"NNO","wind_cdir_full":"Norden-Nordost","wind_dir":21,"wind_gust_spd":7.1,"wind_spd":4.2},{"app_max_temp":13.4,"app_min_temp":4,"clouds":46,"clouds_hi":14,"clouds_low":37,"clouds_mid":0,"datetime":"2023-04-17","dewpt":5.6,"high_temp":13.4,"low_temp":7.3,"max_dhi":null,"max_temp":13.4,"min_temp":6.7,"moon_phase":0.0284941,"moon_phase_lunation":0.93,"moonrise_ts":1681703571,"moonset_ts":1681748647,"ozone":334.5,"pop":0,"precip":0,"pres":1024.4,"rh":75,"slp":1024.4,"snow":0,"snow_depth":0,"sunrise_ts":1681705330,"sunset_ts":1681756327,"temp":10,"ts":1681682460,"uv":6,"valid_date":"2023-04-17","vis":22.805,"weather":{"code":803,"icon":"c03d","description":"Aufgelockert Bewölkt"},"wind_cdir":"ONO","wind_cdir_full":"Osten-Nordöstlich","wind_dir":59,"wind_gust_spd":6.9,"wind_spd":4.3}],"lat":"53.55021","lon":"8.57673","state_code":"03","timezone":"Europe/Berlin"}
Mit readingList ,,complete();" läuft alles stabil, nur bei der selektiven Ausgabe stürzt FHEM komplett ohne Meldung ab und startet neu.
Schon bei der Aktivierung der ersten beiden Ausgaben passiert das reproduzierbar (2 x auf reread).
#complete();
multi(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'));
multi(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_cloudCover'), propertyf('clouds', '', '%s %%'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_temperature'), propertyf('temp', '', '%.0f°'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_feels_like'), propertyf('app_max_temp', '', '%.0f°'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_pressure'), propertyf('pres', '', '%s hPa'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_humidity'), propertyf('rh', '', '%s %%'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_wind_speed'), propertyf('wind_spd', '', '%.1f'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_wind_gust'), propertyf('wind_gust_spd', '', '%.1f'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_wind_deg'), property('wind_dir'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_precip'), propertyf('precip', '', '%.2f mm'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_tempLow'), propertyf('min_temp', '', '%.0f°'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_tempHigh'), propertyf('max_temp', '', '%.0f°'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_sunrise'), property('sunrise_ts'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_sunset'), property('sunset_ts'));
#multi(jsonPath('$.data[*]'), concat('hfc', count(), '_uv'), property('uv'));
Gibt es zum Absturz eine Fehlermeldung im log?
Ich würde mal im Systemlog (journalctl) zum Zeitpunkt des FHEM Neustarts mal schauen, was da passiert sein könnte.
Mit JsonMod und größeren/komplexeren Abfragen kann es schon mal zu diesen Problemchen kommen. Allerdings konnte ich dies noch nicht verlässlig reproduzieren (siehe auch hier (https://forum.fhem.de/index.php?topic=119301.0)) - einige komplexe Abfragen funktionieren Problemfrei, andere wiederum nicht (zuletzt mit aponet).
Dein JsonMod funktioniert hier einwandfrei.
defmod test_json JsonMod file://tmp/test.json
attr test_json readingList multi(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'));;\
multi(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'));;\
setstate test_json 2023-04-12 08:57:32 .computedReadings hfc3_condition,hfc0_iconAPI,hfc5_iconAPI,hfc5_condition,hfc0_condition,hfc3_iconAPI,hfc2_iconAPI,hfc2_condition,hfc6_condition,hfc4_condition,hfc4_iconAPI,hfc6_iconAPI,hfc1_iconAPI,hfc1_condition
setstate test_json 2023-04-12 08:57:32 hfc0_condition Leichter Regen
setstate test_json 2023-04-12 08:57:32 hfc0_iconAPI https://www.weatherbit.io/static/img/icons/r01d.png
setstate test_json 2023-04-12 08:57:32 hfc1_condition Leichter Regen
setstate test_json 2023-04-12 08:57:32 hfc1_iconAPI https://www.weatherbit.io/static/img/icons/r01d.png
setstate test_json 2023-04-12 08:57:32 hfc2_condition Aufgelockert Bewölkt
setstate test_json 2023-04-12 08:57:32 hfc2_iconAPI https://www.weatherbit.io/static/img/icons/c03d.png
setstate test_json 2023-04-12 08:57:32 hfc3_condition Verstreute Wolken
setstate test_json 2023-04-12 08:57:32 hfc3_iconAPI https://www.weatherbit.io/static/img/icons/c02d.png
setstate test_json 2023-04-12 08:57:32 hfc4_condition Bewölkt
setstate test_json 2023-04-12 08:57:32 hfc4_iconAPI https://www.weatherbit.io/static/img/icons/c04d.png
setstate test_json 2023-04-12 08:57:32 hfc5_condition Aufgelockert Bewölkt
setstate test_json 2023-04-12 08:57:32 hfc5_iconAPI https://www.weatherbit.io/static/img/icons/c03d.png
setstate test_json 2023-04-12 08:57:32 hfc6_condition Aufgelockert Bewölkt
setstate test_json 2023-04-12 08:57:32 hfc6_iconAPI https://www.weatherbit.io/static/img/icons/c03d.png
Zitat von: betateilchen am 12 April 2023, 08:58:18Dein JsonMod funktioniert hier einwandfrei.
Ergänzend aus Erfahrung kann ich sagen, dass
meine JsonMod-Devices auch funktioniert haben. Sogar teilweise mehrere Intervalle fehlerfrei. Aber dann und wann führte es immer wieder zu diesem Fehler (https://forum.fhem.de/index.php?topic=119301.0) mit Absturz & Neustart (imho Erzwungen von systemd) von FHEM. Bewusst provozieren konnte ich dies nie; auffallend war, dass die Zeiten des Intervals des JsonMod Devices mit dem Neustart korrelierten. Löscht/Deaktiviert man das JsonMod Device in FHEM, hat man keine Probleme.
Es war auch immer nur ein JsonMod Device betroffen (es liefen aber auch nie welche parallel).
Möglicherweise müsste man eine FHEM Testinstanz mit eben diesen JsonMod Code betreiben und schauen unter welchen Bedingungen es zu einem Absturz führt. Aber ob verbose=5 und stacktrace dann wirklich helfen würden?
Bisher hat es mir gereicht, das betreffende JsonMod Device zu löschen und nach Alternativen zu suchen. Generell fehlen mir aber die Möglichkeiten das tiefergehend zu debuggen - technisch und fachlich.
Leider trotz verbose = 5 nichts im Log zu sehen.
Aber der Absturz ist da.
Apr 12 20:09:11 raspi3 systemd[1]: fhem.service: Main process exited, code=killed, status=11/SEGV
Apr 12 20:10:41 raspi3 systemd[1]: fhem.service: State 'stop-sigterm' timed out. Killing.
Apr 12 20:10:41 raspi3 systemd[1]: fhem.service: Killing process 14499 (perl) with signal SIGKILL.
Apr 12 20:10:41 raspi3 systemd[1]: fhem.service: Failed with result 'signal'.
Apr 12 20:10:41 raspi3 systemd[1]: fhem.service: Consumed 1min 52.072s CPU time.
Apr 12 20:10:42 raspi3 systemd[1]: fhem.service: Scheduled restart job, restart counter is at 1.
Apr 12 20:10:42 raspi3 systemd[1]: Stopped FHEM Home Automation.
Apr 12 20:10:42 raspi3 systemd[1]: fhem.service: Consumed 1min 52.072s CPU time.
Apr 12 20:10:42 raspi3 systemd[1]: Starting FHEM Home Automation...
Perl = v5.32.1
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Latest Revision: 27418
File Rev Last Change
fhem.pl 27410 2023-04-07 19:59:43Z rudolfkoenig
39_alexa.pm 23820 2021-02-24 19:29:15Z justme1968
90_at.pm 25248 2021-11-21 10:29:01Z rudolfkoenig
98_autocreate.pm 23727 2021-02-12 20:31:37Z rudolfkoenig
98_BOSEST.pm 21773 2020-04-25 17:30:30Z dominik
98_cmdalias.pm 16300 2018-03-01 08:48:21Z rudolfkoenig
00_CUL.pm 24815 2021-08-01 16:14:02Z rudolfkoenig
14_CUL_REDIRECT.pm 18358 2019-01-20 20:21:05Z bjoernh
14_CUL_TCM97001.pm 26180 2022-06-29 15:00:03Z Ralf9
14_CUL_TX.pm 17102 2018-08-08 05:34:42Z rudolfkoenig
14_CUL_WS.pm 26674 2022-11-08 17:23:41Z rudolfkoenig
98_dewpoint.pm 18846 2019-03-10 11:45:58Z hotbso
98_DLNARenderer.pm 15836 2018-01-09 21:01:49Z dominik
98_DOIF.pm 27418 2023-04-09 21:23:46Z Damian
98_dummy.pm 25606 2022-02-01 10:43:57Z rudolfkoenig
70_ENIGMA2.pm 18995 2019-03-22 20:09:53Z loredo
91_eventTypes.pm 23471 2021-01-04 19:24:21Z rudolfkoenig
00_FBAHAHTTP.pm 25767 2022-03-03 18:52:56Z rudolfkoenig
10_FBDECT.pm 25069 2021-10-13 05:58:51Z rudolfkoenig
72_FB_CALLLIST.pm 25271 2021-11-28 09:40:15Z markusbloch
72_FB_CALLMONITOR.pm 27275 2023-02-27 07:05:39Z jowiemann
01_FHEMWEB.pm 27294 2023-03-03 14:34:59Z rudolfkoenig
92_FileLog.pm 26959 2023-01-04 12:56:01Z rudolfkoenig
72_FRITZBOX.pm 27403 2023-04-06 13:23:45Z jowiemann
37_harmony.pm 19170 2019-04-13 12:21:29Z justme1968
98_help.pm 25013 2021-09-23 21:07:00Z betateilchen
88_HMCCU.pm 26565 2022-10-20 12:24:12Z zap
88_HMCCUCHN.pm 26565 2022-10-20 12:24:12Z zap
88_HMCCURPCPROC.pm 26565 2022-10-20 12:24:12Z zap
98_HTTPMOD.pm 27065 2023-01-15 17:33:44Z StefanStrobel
30_HUEBridge.pm 26438 2022-09-22 06:40:39Z justme1968
31_HUEDevice.pm 26730 2022-11-21 17:28:03Z justme1968
10_IT.pm 20839 2019-12-28 09:41:47Z bjoernh
98_JsonList2.pm 26701 2022-11-14 09:51:02Z rudolfkoenig
98_JsonMod.pm 24783 2021-07-21 22:37:12Z herrmannj
70_NEUTRINO.pm 18461 2019-01-30 20:33:35Z michael.winkler
91_notify.pm 25888 2022-03-27 10:22:58Z rudolfkoenig
73_PRESENCE.pm 20782 2019-12-19 10:51:06Z markusbloch
33_readingsGroup.pm 23844 2021-02-27 19:43:24Z justme1968
10_RESIDENTS.pm 19533 2019-06-02 19:33:11Z loredo
20_ROOMMATE.pm 19533 2019-06-02 19:33:11Z loredo
70_SamsungAV.pm 19110 2019-04-04 10:37:59Z KoelnSolar
14_SD_WS07.pm 26981 2023-01-06 11:43:36Z Sidey
36_Shelly.pm 26017 2022-05-02 07:04:23Z phenning
99_SUNRISE_EL.pm 24249 2021-04-14 05:45:49Z rudolfkoenig
98_SVG.pm 27261 2023-02-21 09:34:09Z rudolfkoenig
50_TelegramBot.pm 27218 2023-02-13 22:45:48Z viegener
98_telnet.pm 25754 2022-02-27 16:49:52Z rudolfkoenig
99_Utils.pm 24128 2021-04-02 16:29:11Z rudolfkoenig
98_version.pm 26611 2022-10-28 16:32:29Z betateilchen
91_watchdog.pm 26108 2022-06-01 08:25:03Z rudolfkoenig
59_Weather.pm 27146 2023-01-29 15:27:02Z CoolTux
98_weblink.pm 26988 2023-01-07 09:18:42Z rudolfkoenig
98_WeekdayTimer.pm 27118 2023-01-25 19:32:47Z Beta-User
59_Wunderground.pm 18995 2019-03-22 20:09:53Z loredo
AttrTemplate.pm 27145 2023-01-29 11:48:19Z rudolfkoenig
Blocking.pm 23268 2020-12-01 11:48:48Z rudolfkoenig
Color.pm 20813 2019-12-22 18:42:10Z justme1968
Common.pm 10759 2016-02-07 20:00:12Z rleins
ControlPoint.pm 22400 2020-07-14 17:54:36Z Reinerlein
CoProcess.pm 24043 2021-03-21 16:21:46Z justme1968
DevIo.pm 27247 2023-02-18 21:22:32Z rudolfkoenig
FritzBoxUtils.pm 23727 2021-02-12 20:31:37Z rudolfkoenig
GPUtils.pm 19666 2019-06-20 11:17:29Z CoolTux
HMCCUConf.pm 26565 2022-10-20 12:24:12Z zap
HttpUtils.pm 27406 2023-04-07 16:52:19Z rudolfkoenig
Meta.pm 26889 2022-12-23 15:04:11Z CoolTux
myUtilsTemplate.pm 7570 2015-01-14 18:31:44Z rudolfkoenig
RESIDENTStk.pm 19788 2019-07-06 08:10:55Z loredo
RTypes.pm 10476 2016-01-12 21:03:33Z borisneubert
SetExtensions.pm 25286 2021-12-03 10:16:56Z rudolfkoenig
TcpServerUtils.pm 25866 2022-03-21 09:01:16Z rudolfkoenig
UConv.pm 21159 2020-02-09 14:04:27Z loredo
Unit.pm 19614 2019-06-13 23:11:25Z loredo
doif.js 24438 2021-05-14 18:08:18Z Ellert
fhemweb.js 27117 2023-01-25 09:13:32Z rudolfkoenig
fhemweb_readingsGroup.js 15189 2017-10-03 17:53:27Z justme1968
Das ist der Aufruf mit, mit dem fhem dann absemmelt im Log.
2023.04.12 20:09:11 4: https://api.weatherbit.io/v2.0/forecast/daily?lang=de&city=Bremerhaven&key=dee8bda83d9d49f1acf5b2072a15fee0: HTTP response code 200
2023.04.12 20:09:11 5: HttpUtils https://api.weatherbit.io/v2.0/forecast/daily?lang=de&city=Bremerhaven&key=meiner: Got data, length: 5011
2023.04.12 20:09:11 5: HttpUtils response header:
HTTP/1.1 200 OK
server: openresty/1.19.3.1
date: Wed, 12 Apr 2023 18:09:11 GMT
content-type: application/json; charset=utf-8
content-length: 5011
keep-alive: timeout=5
x-ratelimit-limit: 55
x-ratelimit-remaining: 35
x-ratelimit-reset: 1681343999
x-proxy-cache: MISS
access-control-allow-origin: *
access-control-allow-methods: GET, OPTIONS, POST
access-control-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range
access-control-expose-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range
connection: close
2023.04.12 20:09:11 4: [WeatherBit] api encoding is , designated encoder is utf-8-strict
2023.04.12 20:10:42 1: Including fhem.cfg
2023.04.12 20:10:43 3: WEB: port 8083 opened
Zitat von: betateilchen am 12 April 2023, 08:58:18Dein JsonMod funktioniert hier einwandfrei.
defmod test_json JsonMod file://tmp/test.json
attr test_json readingList multi(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'));;\
multi(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'));;\
setstate test_json 2023-04-12 08:57:32 .computedReadings hfc3_condition,hfc0_iconAPI,hfc5_iconAPI,hfc5_condition,hfc0_condition,hfc3_iconAPI,hfc2_iconAPI,hfc2_condition,hfc6_condition,hfc4_condition,hfc4_iconAPI,hfc6_iconAPI,hfc1_iconAPI,hfc1_condition
setstate test_json 2023-04-12 08:57:32 hfc0_condition Leichter Regen
setstate test_json 2023-04-12 08:57:32 hfc0_iconAPI https://www.weatherbit.io/static/img/icons/r01d.png
setstate test_json 2023-04-12 08:57:32 hfc1_condition Leichter Regen
setstate test_json 2023-04-12 08:57:32 hfc1_iconAPI https://www.weatherbit.io/static/img/icons/r01d.png
setstate test_json 2023-04-12 08:57:32 hfc2_condition Aufgelockert Bewölkt
setstate test_json 2023-04-12 08:57:32 hfc2_iconAPI https://www.weatherbit.io/static/img/icons/c03d.png
setstate test_json 2023-04-12 08:57:32 hfc3_condition Verstreute Wolken
setstate test_json 2023-04-12 08:57:32 hfc3_iconAPI https://www.weatherbit.io/static/img/icons/c02d.png
setstate test_json 2023-04-12 08:57:32 hfc4_condition Bewölkt
setstate test_json 2023-04-12 08:57:32 hfc4_iconAPI https://www.weatherbit.io/static/img/icons/c04d.png
setstate test_json 2023-04-12 08:57:32 hfc5_condition Aufgelockert Bewölkt
setstate test_json 2023-04-12 08:57:32 hfc5_iconAPI https://www.weatherbit.io/static/img/icons/c03d.png
setstate test_json 2023-04-12 08:57:32 hfc6_condition Aufgelockert Bewölkt
setstate test_json 2023-04-12 08:57:32 hfc6_iconAPI https://www.weatherbit.io/static/img/icons/c03d.png
Ja, so geht das hier auch - über http aber nicht
status=11/SEGV
Da ich nicht weiß wie gut Du im Thema bist, Seg fault ist in der Regel ein Problem von perl selbst. Yersinia hatte das segv spoaradisch ebenfalls. Soweit ich verstanden habe, ist es bei Dir aber sicher reproduzierbar. (richtig?)
Wenn Zeit, Lust und die Möglichkeit hast Testversionen des Moduls händisch einzuspielen, dann kann ich Dir anbieten diese zu erstellen. Im ersten Schritt baue ich mehr Logmeldungen ein, um die Stelle des Absturzes genauer einzugrenzen. Wenn das gelingt können wir vmtl einen work around finden.
Ich kann den Fehler reproduzieren und könnte Testversionen auch einspielen.
Wenn du magst, ich wäre bereit ;)
Perfekt, dann tasten wir uns mal an die Stelle ran. Modul im Anhang, bitte verbose 5. Bitte schau auch ob folgende Meldung beim Start von fhem erscheint (verbos >3): "json [JsonMod::JSON::StreamWriter] is pure perl. Consider installing Cpanel::JSON::XS" Hintergrund: falls Cpanel::JSON::XS installiert ist, soll das zum decodieren verwendet werden, andernfalls ein eingebauter decoder.
Zitat von: herrmannj am 13 April 2023, 11:52:47Hintergrund: falls Cpanel::JSON::XS installiert ist, soll das zum decodieren verwendet werden, andernfalls ein eingebauter decoder.
Es gibt schon ein paar FHEM Module, die dieses Modul benötigen, insofern besteht die Wahrscheinlichkeit, dass es schon vorhanden ist.
Wer es mittels eins Debian-Paketes nachinstallieren muss/möchte:
sudo apt install libcpanel-json-xs-perl
@FlatTv: falls es bei dir jedoch noch nicht installiert war, bitte erstmal noch nicht installieren damit wir vorher den Fehler eingrenzen können ;)
Für die Unterstützung zur Fehlersuche: bei mir war das Modul bereits vorhanden und wird gemäß der zugehörigen Logmeldung (aus dem Testmodul) auch benutzt.
Also Verbose=5 ist ja überhaupt nicht wirklich zu nutzen.
Allein das Modul BOSEST schreibt mit seinem Polling ununterbrochen ins Log und man kann das Modul auch nicht deaktivieren (oder zumindest ich nicht).
Wenn ich im Log nach ,,JsonMod::" Suche, bekomme ich kein Ergebnis.
Der Absturz ist wieder hier im Log.
2023.04.13 19:18:53 4: https://api.weatherbit.io/v2.0/forecast/daily?lang=de&city=Bremerhaven&key=dee8bda83d9d49f1acf5b2072a15fee0: HTTP response code 200
2023.04.13 19:18:53 5: HttpUtils https://api.weatherbit.io/v2.0/forecast/daily?lang=de&city=Bremerhaven&key=dee8bda83d9d49f1acf5b2072a15fee0: Got data, length: 5033
2023.04.13 19:18:53 5: HttpUtils response header:
HTTP/1.1 200 OK
server: openresty/1.19.3.1
date: Thu, 13 Apr 2023 17:18:53 GMT
content-type: application/json; charset=utf-8
content-length: 5033
keep-alive: timeout=5
x-ratelimit-limit: 55
x-ratelimit-remaining: 20
x-ratelimit-reset: 1681430399
x-proxy-cache: HIT
access-control-allow-origin: *
access-control-allow-methods: GET, OPTIONS, POST
access-control-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range
access-control-expose-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range
connection: close
2023.04.13 19:18:53 4: [WeatherBit] api encoding is , designated encoder is utf-8-strict
2023.04.13 19:18:53 5: [WeatherBit] start json decoding
json decoded using Cpanel
2023.04.13 19:18:53 5: [WeatherBit] finished json decoding
2023.04.13 19:18:53 5: [WeatherBit] start do readings
Ich habe nochmal den Debug erweitert, der READINGS Hash in JsonMod_DoReadings wird noch erstellt.
Dann im concat Sub knallt es, manchmal früher, manchmal später.
Eine Meldung habe ich mal loggen können
2023.04.13 20:24:10 4: [WeatherBit] api encoding is , designated encoder is utf-8-strict
2023.04.13 20:24:10 5: [WeatherBit] start json decoding
json decoded using Cpanel
2023.04.13 20:24:10 5: [WeatherBit] finished json decoding
2023.04.13 20:24:10 5: [WeatherBit] start do readings
2023.04.13 20:24:10 5: [WeatherBit] key ready
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=0
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_iconAPI
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=0
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_iconAPI
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=1
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_iconAPI
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=2
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_iconAPI
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=3
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_iconAPI
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=4
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_iconAPI
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=5
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_iconAPI
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=6
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_iconAPI
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=0
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_condition
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=0
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_condition
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=1
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_condition
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=2
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_condition
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:10 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:10 5: [WeatherBit] concat arg=3
2023.04.13 20:24:10 5: [WeatherBit] concat arg=_condition
2023.04.13 20:24:10 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=4
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_condition
2023.04.13 20:24:11 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=5
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_condition
2023.04.13 20:24:11 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=6
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_condition
2023.04.13 20:24:11 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=0
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_day_of_week
2023.04.13 20:24:11 3: [WeatherBit] warning: Bizarre copy of UNKNOWN in subroutine entry
in 'multi(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))'
2023.04.13 20:24:11 3: [WeatherBit] warning: Bizarre copy of UNKNOWN in list assignment at ./FHEM/98_JsonMod.pm line 285.
in 'multi(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))'
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=feature_fc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_day_of_week
2023.04.13 20:24:11 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=1
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_day_of_week
2023.04.13 20:24:11 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=1
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_day_of_week
2023.04.13 20:24:11 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=31290
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_day_of_week
2023.04.13 20:24:11 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:24:11 5: [WeatherBit] concat arg=hfc
2023.04.13 20:24:11 5: [WeatherBit] concat arg=1
2023.04.13 20:24:11 5: [WeatherBit] concat arg=_day_of_week
2023.04.13 20:24:11 5: [WeatherBit] sanitizedSetReading
2023.04.13 20:25:42 1: Including fhem.cfg
2023.04.13 20:25:42 3: WEB: port 8083 opened
vielen dank. Wie hast Du die Meldungen erzeugt? Anders gefragt, wenn da line 285 steht, stimmt das noch mit dem überein was ich bei mir sehe? (my @args = @_;)
Bonusfrage: Wenn ich bei deiner Ausgabe die concat Argumente anschaue, dann sollte das zweite count() sein. Der geht unmittelbar vor dem crash von 6 auf 0. Direkt danach (evtl sind das die Daten im Fehlerfall) ist das zweite arg plötzlich "feature_fc" also ein Text. Irgendeine Idee wo der Textinhalt "feature_fc" überhaupt herkommt?
Der count() war mir überhaupt nicht aufgefallen aber du hast völlig recht.
Leider sind meine maximalen Abfragen für heute erreicht, keine Ahnung wo der ,,feature_fc" her kommt.
sub JsonMod_DoReadings {
my ($hash, $data) = @_;
my $name = $hash->{'NAME'};
my $path = JsonMod::JSON::Path->new($data);
my $newReadings = {};
my $oldReadings = {};
foreach my $key (keys %{$hash->{'READINGS'}}) {
$oldReadings->{$key} = 0;
};
JsonMod_Logger($hash, 5, 'key ready');
# sanitize reading names to comply with fhem naming conventions
# (allowed chars: A-Za-z/\d_\.-)
my sub sanitizedSetReading {
my ($r, $v) = @_;
JsonMod_Logger($hash, 5, 'sanitizedSetReading');
# convert into valid reading
# special treatment of "umlaute"
my %umlaute = ("ä" => "ae", "Ä" => "Ae", "ü" => "ue", "Ü" => "Ue", "ö" => "oe", "Ö" => "Oe", "ß" => "ss" );
my $umlautkeys = join ("|", keys(%umlaute));
$r =~ s/($umlautkeys)/$umlaute{$1}/g;
# normalize remaining special chars
$r = Unicode::Normalize::NFD($r);
utf8::encode($r) if utf8::is_utf8($r);
$r =~ s/\s/_/g; # whitespace
$r =~ s/([^A-Za-z0-9\/_\.-])//g;
# prevent a totally stripped reading name
# todo, log it?
#$r = "_Identifier_$_index" unless($r);
$v //='';
utf8::encode($v) if utf8::is_utf8($v);
$newReadings->{$r} = $v;
$oldReadings->{$r} = 1;
#printf "1 %s %s %s %s\n", $r, length($r), $v, length($v);
};
my sub concat {
my @args = @_;
my $result = '';
foreach my $arg (@args) {
JsonMod_Logger($hash, 5, 'concat arg='.$arg);
$result .= $arg;
};
return $result;
};
schau mal bitte was bei Dir in Zeile 285 steht (und welche sub das ist)
So wie du sagtest, der concat() mit den Argumenten aus der readingList.
IMG_0750.png
Mist, das Bild kann ich nicht sehen, bekomme da einen 404 jetzt gehts. passt.
Aber ich denke wir könnten möglicherweise zumindest eine Spur haben. Es scheint so also ab der index entweder aus count() falsch rauskommt oder in concat() falsch reingeht. Dazwischen liegt dann ganz viel perl interna und da steckt wohl auch der bug.
Interessehalber: gib doch bitte auf dem pi auf der console folgendes ein und poste den output
- uname -m
- perl --version
geht jeweils um (ob) 32 oder 64 bit. Ich teste in der Zwischenzeit mal einige Ideen wie und ob man da was machen kann
Der count() zählt doch auch die 0 immer doppelt?!
Der Index von 0-6 wäre richtig, nur sehe ich die 0 zu jedem Argument doppelt.
Die Zeile wäre in concat()
my @args = @_;
pi@raspi3:~ $ uname -m
armv7l
pi@raspi3:~ $ perl --version
This is perl 5, version 32, subversion 1 (v5.32.1) built for arm-linux-gnueabihf-thread-multi-64int
(with 47 registered patches, see perl -V for more detail)
Copyright 1987-2021, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
pi@raspi3:~ $
ZitatDer count() zählt doch auch die 0 immer doppelt?!
Das ist korrekt. Im ersten Durchlauf (m1) wird das array aufgelöst. Dabei wird count() einmal evaluiert, das reading selbst wird jedoch erst in anschließenden Schleife (über das array) gesetzt und dort wird count() (=$index) auch erst erhöht (m2).
In deinem log (ps, Du hast da dankenswerterweise vmtl genau den "heissen" Teil erwischt) ist innerhalb concat mehrfach das zweite Argument "wirr". In deiner readinglist ist das immer count(), sprich der index. Der darf nur 0,0,1,2,3 .. laufen und weder text beinhalten noch 0,1,31290,1 lauten. Kann er theoretisch auch nicht, macht er aber offensichtlich doch
teste bitte das file im Anhang. 98_JsonMod.pm
Da ist ein angepasstes logging drin und zusätzlich habe ich den derzeitigen Hauptverdächtigen (count) modifiziert. Btw, Du kannst das verbose (aatr) für fhem gesamt auf 3 lassen und nur das verbose (attr) des moduls auf 5 stellen.
Falls das logging eines durchgangs von JsonMod durch logausgaben von anderen modulen unterbrochen wird (sollte eigentlich nicht) - die bitte drin lassen. Anders formuliert zwischen "[test_json] api encoding is , designated encoder is utf-8-strict" und "[test_json] finished do readings" keine Zeilen entfernen bitte, falls da welche sein sollten
es gäbe da im übrigen noch eine weiter Möglichkeit:
count() ist nur ein wrapper um $index um die interne variable vom user fernzuhalten. $index liegt aber sowieso im scope und man könnte die readinglist auch so schreiben:
multi(jsonPath('$.data[*].weather'), concat('hfc', $index, '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
Das alles unter der Annahme das count(), bzw perl dann bei der Parameterübergabe das auch wirklich verursacht. (Für Spass am Gerät kannste dann auch $index++ reinschreiben, bekommste einen 2 Wochen fc zum gleichen Preis ;) )
Bei yersinia war die Konstellation übrigens ähnlich: "concat(count(),.." Wäre schön wenn herauskristallisiert, dass das wirklich die Ursache ist und die workarounds funktionieren
Du warst ja noch richtig fleißig :o
Ich muss erstmal los und meinen Arbeitgeber glücklich machen.
Cool, das es hier weitergeht und FlatTV das wirklich verlässlich reproduzieren kann. :)
Umso besser, dass es schon einen Verdacht gibt.
Kurze (sOT) Frage, da ich es in #17 (https://forum.fhem.de/index.php?topic=133135.msg1272338#msg1272338) zufällig gesehen habe: spricht was dagegen zumindest teilweise FHEM-eigene Funktionen für die readingsname zu nutzen wie goodReadingName und makeReadingName (https://wiki.fhem.de/wiki/DevelopmentModuleAPI#goodReadingName)?
Ich konnte doch nicht die Finger davon lassen.
Es läuft erstmal, Auszug aus dem Log unten, ohne Absturz.
Ich hab jetzt mal alle Readings aktiviert und (nicht böse sein, wieder rumgefummelt) den Data Dumper aktiviert, um auch noch den Hash immer direkt mit auszugeben.
Mal sehen wie das heute Abend aussieht.
connection: close
2023.04.14 06:48:00 4: [WeatherBit] api encoding is , designated encoder is utf-8-strict
2023.04.14 06:48:00 5: [WeatherBit] start json decoding
json decoded using Cpanel
2023.04.14 06:48:00 5: [WeatherBit] finished json decoding
2023.04.14 06:48:00 5: [WeatherBit] start do readings
2023.04.14 06:48:00 2: [WeatherBit] start JsonPath
cp#0 0 eval m1(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 0
cp#3 concat input hfc 0 _iconAPI
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=0
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 0 HASH(0x6995698) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 0
cp#3 concat input hfc 0 _iconAPI
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=0
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 1 HASH(0x6668260) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 1
cp#3 concat input hfc 1 _iconAPI
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=1
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 2 HASH(0x64cfd80) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 2
cp#3 concat input hfc 2 _iconAPI
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=2
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 3 HASH(0x6444480) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 3
cp#3 concat input hfc 3 _iconAPI
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=3
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 4 HASH(0x64d7118) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 4
cp#3 concat input hfc 4 _iconAPI
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=4
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 5 HASH(0x64cbbd0) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 5
cp#3 concat input hfc 5 _iconAPI
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=5
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 6 HASH(0x6991280) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 6
cp#3 concat input hfc 6 _iconAPI
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=6
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_iconAPI
cp#0 0 eval m1(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
cp#2 count out 0
cp#3 concat input hfc 0 _condition
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=0
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_condition
cp#1 0 HASH(0x1264240) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
cp#2 count out 0
cp#3 concat input hfc 0 _condition
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=0
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_condition
cp#1 1 HASH(0x69752b0) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
cp#2 count out 1
cp#3 concat input hfc 1 _condition
2023.04.14 06:48:00 5: [WeatherBit] concat arg=hfc
2023.04.14 06:48:00 5: [WeatherBit] concat arg=1
2023.04.14 06:48:00 5: [WeatherBit] concat arg=_condition
cp#1 2 HASH(0x646d6b8) eval m2(json
Läuft seit heute Morgen jede Stunde ohne Probleme mit allen Readings.
2023.04.14 15:00:00 4: [WeatherBit] start request
2023.04.14 15:00:00 4: [WeatherBit] next request: 2023.04.14 16:00:00
2023.04.14 15:00:00 5: HttpUtils url=https://api.weatherbit.io/v2.0/forecast/daily?lang=de&city=Bremerhaven&key=meiner NonBlocking via https
2023.04.14 15:00:00 4: IP: api.weatherbit.io -> 15.235.118.221
2023.04.14 15:00:00 5: HttpUtils request header:
GET /v2.0/forecast/daily?lang=de&city=Bremerhaven&key=meiner HTTP/1.0
Host: api.weatherbit.io
User-Agent: fhem
Accept-Encoding: gzip,deflate
Accept: application/json
Accept-Charset: utf-8, iso-8859-1
2023.04.14 15:00:00 4: https://api.weatherbit.io/v2.0/forecast/daily?lang=de&city=Bremerhaven&key=meiner: HTTP response code 200
2023.04.14 15:00:00 5: HttpUtils https://api.weatherbit.io/v2.0/forecast/daily?lang=de&city=Bremerhaven&key=meiner: Got data, length: 5004
2023.04.14 15:00:00 5: HttpUtils response header:
HTTP/1.1 200 OK
server: openresty/1.19.3.1
date: Fri, 14 Apr 2023 13:00:00 GMT
content-type: application/json; charset=utf-8
content-length: 5004
keep-alive: timeout=5
x-ratelimit-limit: 55
x-ratelimit-remaining: 33
x-ratelimit-reset: 1681516799
x-proxy-cache: HIT
access-control-allow-origin: *
access-control-allow-methods: GET, OPTIONS, POST
access-control-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range
access-control-expose-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range
connection: close
2023.04.14 15:00:00 4: [WeatherBit] api encoding is , designated encoder is utf-8-strict
2023.04.14 15:00:00 5: [WeatherBit] start json decoding
json decoded using Cpanel
2023.04.14 15:00:00 5: [WeatherBit] finished json decoding
2023.04.14 15:00:00 5: [WeatherBit] start do readings
2023.04.14 15:00:00 2: [WeatherBit] start JsonPath
cp#0 0 eval m1(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
cp#2 count out 0
cp#3 concat input hfc 0 _iconAPI
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_iconAPI';
2023.04.14 15:00:00 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:00 5: [WeatherBit] concat arg=0
2023.04.14 15:00:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 0 HASH(0x754ac68) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
$VAR1 = 0;
cp#2 count out 0
cp#3 concat input hfc 0 _iconAPI
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_iconAPI';
2023.04.14 15:00:00 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:00 5: [WeatherBit] concat arg=0
2023.04.14 15:00:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 1 HASH(0x708a448) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
$VAR1 = 1;
cp#2 count out 1
cp#3 concat input hfc 1 _iconAPI
$VAR1 = 'hfc';
$VAR2 = 1;
$VAR3 = '_iconAPI';
2023.04.14 15:00:00 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:00 5: [WeatherBit] concat arg=1
2023.04.14 15:00:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 2 HASH(0x709a668) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
$VAR1 = 2;
cp#2 count out 2
cp#3 concat input hfc 2 _iconAPI
$VAR1 = 'hfc';
$VAR2 = 2;
$VAR3 = '_iconAPI';
2023.04.14 15:00:00 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:00 5: [WeatherBit] concat arg=2
2023.04.14 15:00:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 3 HASH(0x768ee38) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
$VAR1 = 3;
cp#2 count out 3
cp#3 concat input hfc 3 _iconAPI
$VAR1 = 'hfc';
$VAR2 = 3;
$VAR3 = '_iconAPI';
2023.04.14 15:00:00 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:00 5: [WeatherBit] concat arg=3
2023.04.14 15:00:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 4 HASH(0x74388f0) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
$VAR1 = 4;
cp#2 count out 4
cp#3 concat input hfc 4 _iconAPI
$VAR1 = 'hfc';
$VAR2 = 4;
$VAR3 = '_iconAPI';
2023.04.14 15:00:00 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:00 5: [WeatherBit] concat arg=4
2023.04.14 15:00:00 5: [WeatherBit] concat arg=_iconAPI
cp#1 5 HASH(0x709a398) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
$VAR1 = 5;
cp#2 count out 5
cp#3 concat input hfc 5 _iconAPI
$VAR1 = 'hfc';
$VAR2 = 5;
$VAR3 = '_iconAPI';
2023.04.14 15:00:00 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:00 5: [WeatherBit] concat arg=5
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_iconAPI
cp#1 6 HASH(0x7292860) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_iconAPI'), propertyf('icon', '', 'https://www.weatherbit.io/static/img/icons/%s.png'))
$VAR1 = 6;
cp#2 count out 6
cp#3 concat input hfc 6 _iconAPI
$VAR1 = 'hfc';
$VAR2 = 6;
$VAR3 = '_iconAPI';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=6
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_iconAPI
cp#0 0 eval m1(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
cp#2 count out 0
cp#3 concat input hfc 0 _condition
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_condition';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=0
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_condition
cp#1 0 HASH(0x7627cd8) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
$VAR1 = 0;
cp#2 count out 0
cp#3 concat input hfc 0 _condition
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_condition';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=0
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_condition
cp#1 1 HASH(0x75cf998) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
$VAR1 = 1;
cp#2 count out 1
cp#3 concat input hfc 1 _condition
$VAR1 = 'hfc';
$VAR2 = 1;
$VAR3 = '_condition';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=1
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_condition
cp#1 2 HASH(0x6e98ef0) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
$VAR1 = 2;
cp#2 count out 2
cp#3 concat input hfc 2 _condition
$VAR1 = 'hfc';
$VAR2 = 2;
$VAR3 = '_condition';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=2
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_condition
cp#1 3 HASH(0x70ab090) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
$VAR1 = 3;
cp#2 count out 3
cp#3 concat input hfc 3 _condition
$VAR1 = 'hfc';
$VAR2 = 3;
$VAR3 = '_condition';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=3
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_condition
cp#1 4 HASH(0x72f5228) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
$VAR1 = 4;
cp#2 count out 4
cp#3 concat input hfc 4 _condition
$VAR1 = 'hfc';
$VAR2 = 4;
$VAR3 = '_condition';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=4
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_condition
cp#1 5 HASH(0x75d30f0) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
$VAR1 = 5;
cp#2 count out 5
cp#3 concat input hfc 5 _condition
$VAR1 = 'hfc';
$VAR2 = 5;
$VAR3 = '_condition';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=5
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_condition
cp#1 6 HASH(0x768f198) eval m2(jsonPath('$.data[*].weather'), concat('hfc', count(), '_condition'), property('description'))
$VAR1 = 6;
cp#2 count out 6
cp#3 concat input hfc 6 _condition
$VAR1 = 'hfc';
$VAR2 = 6;
$VAR3 = '_condition';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=6
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_condition
cp#0 0 eval m1(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))
cp#2 count out 0
cp#3 concat input hfc 0 _day_of_week
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_day_of_week';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=0
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_day_of_week
cp#1 0 HASH(0x6e97d00) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))
$VAR1 = 0;
cp#2 count out 0
cp#3 concat input hfc 0 _day_of_week
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_day_of_week';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=0
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_day_of_week
cp#1 1 HASH(0x762fb28) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))
$VAR1 = 1;
cp#2 count out 1
cp#3 concat input hfc 1 _day_of_week
$VAR1 = 'hfc';
$VAR2 = 1;
$VAR3 = '_day_of_week';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=1
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_day_of_week
cp#1 2 HASH(0x70b0be0) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))
$VAR1 = 2;
cp#2 count out 2
cp#3 concat input hfc 2 _day_of_week
$VAR1 = 'hfc';
$VAR2 = 2;
$VAR3 = '_day_of_week';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=2
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_day_of_week
cp#1 3 HASH(0x75cb648) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))
$VAR1 = 3;
cp#2 count out 3
cp#3 concat input hfc 3 _day_of_week
$VAR1 = 'hfc';
$VAR2 = 3;
$VAR3 = '_day_of_week';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=3
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_day_of_week
cp#1 4 HASH(0x70bc270) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))
$VAR1 = 4;
cp#2 count out 4
cp#3 concat input hfc 4 _day_of_week
$VAR1 = 'hfc';
$VAR2 = 4;
$VAR3 = '_day_of_week';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=4
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_day_of_week
cp#1 5 HASH(0x7096f68) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))
$VAR1 = 5;
cp#2 count out 5
cp#3 concat input hfc 5 _day_of_week
$VAR1 = 'hfc';
$VAR2 = 5;
$VAR3 = '_day_of_week';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=5
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_day_of_week
cp#1 6 HASH(0x75c2368) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_day_of_week'), property('ts'))
$VAR1 = 6;
cp#2 count out 6
cp#3 concat input hfc 6 _day_of_week
$VAR1 = 'hfc';
$VAR2 = 6;
$VAR3 = '_day_of_week';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=6
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_day_of_week
cp#0 0 eval m1(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'))
cp#2 count out 0
cp#3 concat input hfc 0 _pop
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_pop';
2023.04.14 15:00:01 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:01 5: [WeatherBit] concat arg=0
2023.04.14 15:00:01 5: [WeatherBit] concat arg=_pop
cp#1 0 HASH(0x74d17c8) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'))
$VAR1 = 0;
cp#2 count out 0
cp#3 concat input hfc 0 _pop
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_pop';
2023.04.14 15:00:02 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:02 5: [WeatherBit] concat arg=0
2023.04.14 15:00:02 5: [WeatherBit] concat arg=_pop
cp#1 1 HASH(0x6f045a0) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'))
$VAR1 = 1;
cp#2 count out 1
cp#3 concat input hfc 1 _pop
$VAR1 = 'hfc';
$VAR2 = 1;
$VAR3 = '_pop';
2023.04.14 15:00:02 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:02 5: [WeatherBit] concat arg=1
2023.04.14 15:00:02 5: [WeatherBit] concat arg=_pop
cp#1 2 HASH(0x768f3c0) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'))
$VAR1 = 2;
cp#2 count out 2
cp#3 concat input hfc 2 _pop
$VAR1 = 'hfc';
$VAR2 = 2;
$VAR3 = '_pop';
2023.04.14 15:00:02 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:02 5: [WeatherBit] concat arg=2
2023.04.14 15:00:02 5: [WeatherBit] concat arg=_pop
cp#1 3 HASH(0x743b488) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'))
$VAR1 = 3;
cp#2 count out 3
cp#3 concat input hfc 3 _pop
$VAR1 = 'hfc';
$VAR2 = 3;
$VAR3 = '_pop';
2023.04.14 15:00:02 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:02 5: [WeatherBit] concat arg=3
2023.04.14 15:00:02 5: [WeatherBit] concat arg=_pop
cp#1 4 HASH(0x74498f0) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'))
$VAR1 = 4;
cp#2 count out 4
cp#3 concat input hfc 4 _pop
$VAR1 = 'hfc';
$VAR2 = 4;
$VAR3 = '_pop';
2023.04.14 15:00:02 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:02 5: [WeatherBit] concat arg=4
2023.04.14 15:00:02 5: [WeatherBit] concat arg=_pop
cp#1 5 HASH(0x769a4b8) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'))
$VAR1 = 5;
cp#2 count out 5
cp#3 concat input hfc 5 _pop
$VAR1 = 'hfc';
$VAR2 = 5;
$VAR3 = '_pop';
2023.04.14 15:00:02 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:02 5: [WeatherBit] concat arg=5
2023.04.14 15:00:02 5: [WeatherBit] concat arg=_pop
cp#1 6 HASH(0x75731f8) eval m2(jsonPath('$.data[*]'), concat('hfc', count(), '_pop'), propertyf('pop', '', '%s %%'))
$VAR1 = 6;
cp#2 count out 6
cp#3 concat input hfc 6 _pop
$VAR1 = 'hfc';
$VAR2 = 6;
$VAR3 = '_pop';
2023.04.14 15:00:02 5: [WeatherBit] concat arg=hfc
2023.04.14 15:00:02 5: [WeatherBit] concat arg=6
2023.04.14 15:00:02 5: [WeatherBit] concat arg=_pop
cp#0 0 eval m1(jsonPath('$.data[*]'), concat('hfc', count(), '_cloudCover'), propertyf('clouds', '', '%s %%'))
cp#2 count out 0
cp#3 concat input hfc 0 _cloudCover
$VAR1 = 'hfc';
$VAR2 = 0;
$VAR3 = '_cloudCover';
... eingekürzt
Der Vollständigkeit halber noch mein diff
--- "98_JsonMod 2.pm" 2023-04-14 15:12:51.507135923 +0200
+++ 98_JsonMod.pm 2023-04-14 15:12:51.507135923 +0200
@@ -284,7 +284,12 @@
my sub concat {
my @args = @_;
my $result = '';
+
print "cp#3 concat input @args\n";
+
+ use Data::Dumper;
+ print Dumper @args;
+
foreach my $arg (@args) {
JsonMod_Logger($hash, 5, 'concat arg='.$arg);
$result .= $arg;
@@ -447,6 +452,10 @@
foreach (@{$resultSet}) {
$resultObject = $_;
print "cp#1 $index $resultObject eval m2$args\n";
+
+ use Data::Dumper;
+ print Dumper $index;
+
eval 'm2'.$args; warn $@ if $@;
};
};
Du solltest vielleicht Deinen api-key entfernen.
Zitat von: betateilchen am 14 April 2023, 15:57:15Du solltest vielleicht Deinen api-key entfernen.
THX ::)
@herrmannj
Hallo Jörg,
danke für deinen Support.
Das Modul rennt! Ich habe das lokal jetzt so am laufen und keine Ausfälle.
Anbei der Diff zum Original.
Grüße aus dem Norden
Jörg 🖖
--- a/98_JsonMod.pm 2023-04-13 18:04:29.130206354 +0200
+++ b/98_JsonMod.pm 2023-04-14 21:37:47.381621591 +0200
@@ -374,7 +374,12 @@
my $resultObject;
my $index = 0;
- my sub count {
+ # forum 133135
+ # my sub count {
+ # return $index;
+ # };
+
+ local *count = sub {
return $index;
};
Zitat von: FlatTV am 14 April 2023, 15:45:04Läuft seit heute Morgen jede Stunde ohne Probleme mit allen Readings.
Schön. Dann haben wir perl wohl bei einem bug erwischt. Im Anhang die dann finale Version.
Da Du und Yersinia die einzigen seid wo mir das bekannt ist: vielleicht könntet ihr die Version im Anhang für 24h mit dieser def testen:
define confirm_segv JsonMod https://jsonplaceholder.typicode.com/comments
attr confirm_segv interval * * * * *
attr confirm_segv readingList multi(jsonPath('$.[*]'),concat(sprintf('%03d', count()), concat('-with_id-', property('id'), '-', sub {my $e = shift;; $e =~ s/@/_at_/;;$e;;}->(property('email')), '-', count)), concat(count(), concat(':', time, ':'), sub {my $t = substr(property('body'), 0, 48);; $t =~ s/[^a-zA-Z0-9 ]*//g;; $t}->()));;\
single(sub {return undef if $^O ne 'linux';; my $s = `ps -p $$ -o %cpu,rss --no-headers`;; my @a = split ' ', $s;; return $a[1]}->(), '999-sys');;
Es werden dummydaten geladen und die readingslist ist halbwegs komplex.
Grüße aus dem Norden in den Norden,
Joerg
Ich hab zwar kein Problem aber trotzdem mal die Testversion inkl. DEF auf eines meiner Testsysteme "geworfen"...
Muss man/ich da noch was tun?
Oder "nur" warten, ob es durchläuft?
Gruß, Joachim
Moin,
Danke.
Context: gibt ganz selten und nur auf ganz wenigen systemen einen bug in perl - und das nur manchmal. Die Version oben hat workarounds dafür drin, funktionell alles so wie es war
Die def lädt 500 Datensätze im Minutentakt und quält die durch die readinglist. Damit kommen in 24h ca 7k Aufrufe der vorher problematischen Funktionen zustande und die sollen fehlerfrei durchlaufen. Wenn Du vorher keine Probleme (segv im perl interpreter) hattest, wird es bei Dir keinen Unterschied machen.
Zitat von: herrmannj am 14 April 2023, 22:59:14Moin,
Danke.
Context: gibt ganz selten und nur auf ganz wenigen systemen einen bug in perl - und das nur manchmal. Die Version oben hat workarounds dafür drin, funktionell alles so wie es war
Die def lädt 500 Datensätze im Minutentakt und quält die durch die readinglist. Damit kommen in 24h ca 7k Aufrufe der vorher problematischen Funktionen zustande und die sollen fehlerfrei durchlaufen. Wenn Du vorher keine Probleme (segv im perl interpreter) hattest, wird es bei Dir keinen Unterschied machen.
Hm, ok.
Wobei ich JsonMod erst seit heute nutze bzw. heute (seit langem) mal wieder angeworfen habe/hatte ;)
Daher: keine Probleme...
Aber schadet ja nicht es mal mitlaufen zu lassen? ;)
System:
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Relativ aktuell (max. 1 Woche oder so außer "Takt")...
This is perl 5, version 32, subversion 1 (v5.32.1) built for arm-linux-gnueabihf-thread-multi-64int
(with 47 registered patches, see perl -V for more detail)
fhem habe ich extra noch mal aktualisiert, bevor ich diese Spezialversion eingespielt habe...
Lasse es halt mal laufen und geb Bescheid.
(kannst es ja ignorieren 8) )
Gruß, Joachim
doch, sehr gerne. Gerade weil der bug nur selten auftritt sind tests sehr hilfreich und sehr gern gesehen.
Edit: deine perl version ist auch identisch mit der von Joerg.
Zitat von: herrmannj am 14 April 2023, 22:23:50Zitat von: FlatTV am 14 April 2023, 15:45:04Läuft seit heute Morgen jede Stunde ohne Probleme mit allen Readings.
Schön. Dann haben wir perl wohl bei einem bug erwischt. Im Anhang die dann finale Version.
Da Du und Yersinia die einzigen seid wo mir das bekannt ist: vielleicht könntet ihr die Version im Anhang für 24h mit dieser def testen:
define confirm_segv JsonMod https://jsonplaceholder.typicode.com/comments
attr confirm_segv interval * * * * *
attr confirm_segv readingList multi(jsonPath('$.[*]'),concat(sprintf('%03d', count()), concat('-with_id-', property('id'), '-', sub {my $e = shift;; $e =~ s/@/_at_/;;$e;;}->(property('email')), '-', count)), concat(count(), concat(':', time, ':'), sub {my $t = substr(property('body'), 0, 48);; $t =~ s/[^a-zA-Z0-9 ]*//g;; $t}->()));;\
single(sub {return undef if $^O ne 'linux';; my $s = `ps -p $$ -o %cpu,rss --no-headers`;; my @a = split ' ', $s;; return $a[1]}->(), '999-sys');;
Es werden dummydaten geladen und die readingslist ist halbwegs komplex.
Grüße aus dem Norden in den Norden,
Joerg
Hab ich gerade gemacht, Test läuft seit 7:30 Uhr.
Zitat von: herrmannj am 14 April 2023, 22:23:50Schön. Dann haben wir perl wohl bei einem bug erwischt. Im Anhang die dann finale Version.
offtopic: hast Du schon einen Zeitplan, wann die anderen Dinge auf der ToDo-Liste zu JsonMod (insbesondere die Fehlerbehebung in der cron-Berechnung) umgesetzt werden können?
Kurze Zwischenrückmeldung:
läuft seit gestern ohne Auffälligkeiten...
Nur das hier kam im Log beim Start:
2023.04.14 22:47:30 3: json [JsonMod::JSON::StreamWriter] is pure perl. Consider installing Cpanel::JSON::XS
ist/wäre das für einen Test wichtig (gewesen)?
Ich lasse es heute oder bis morgen mal weiterlaufen...
Gruß, Joachim
Zitat von: MadMax-FHEM am 15 April 2023, 12:22:51Kurze Zwischenrückmeldung:
läuft seit gestern ohne Auffälligkeiten...
Nur das hier kam im Log beim Start:
2023.04.14 22:47:30 3: json [JsonMod::JSON::StreamWriter] is pure perl. Consider installing Cpanel::JSON::XS
ist/wäre das für einen Test wichtig (gewesen)?
Ich lasse es heute oder bis morgen mal weiterlaufen...
Gruß, Joachim
Nein, das ist nicht erforderlich. Allerdings kannst Du es so https://forum.fhem.de/index.php?topic=133135.msg1272236#msg1272236 installieren, dann sparst Du einige ms pro request
Zitat von: betateilchen am 15 April 2023, 09:29:34Zitat von: herrmannj am 14 April 2023, 22:23:50Schön. Dann haben wir perl wohl bei einem bug erwischt. Im Anhang die dann finale Version.
offtopic: hast Du schon einen Zeitplan, wann die anderen Dinge auf der ToDo-Liste zu JsonMod (insbesondere die Fehlerbehebung in der cron-Berechnung) umgesetzt werden können?
Di meinst die Wochentage? Die hatte ich tatsächlich nicht mehr auf dem zettel. Schau ich rein
Zitat von: herrmannj am 15 April 2023, 21:11:40Di meinst die Wochentage? Die hatte ich tatsächlich nicht mehr auf dem zettel. Schau ich rein
Prima, danke.
Es gab aber auch irgendwo noch einen Thread, in dem weitere Wünsche von JsonMod-Nutzern gesammelt wurden. Muss mal schauen, ob ich den wiederfinde.
Edit: https://forum.fhem.de/index.php?topic=111489.0
Da sind in den letzten Beiträgen noch ein paar Fragen, Wünsche und Ideen aufgeführt und teilweise in anderen Threads verlinkt.
So, ich denke der Patch könnte so eingecheckt werden.
Hier lief der Test ohne Probleme.
In allen 3 bei mir aktiven JsonMod Devices, waren auch alle Readings aktiviert.
THX nochmal.
Bei mir läuft es auch immer noch problemlos :)
Gruß, Joachim
Vielen Dank an euch. Bei mir liefs auch durch (hat es vorher aber auch). Dann entlasse ich das modul als segv geheilt ins update.
Zitat von: herrmannj am 16 April 2023, 12:08:30Vielen Dank an euch. Bei mir liefs auch durch (hat es vorher aber auch). Dann entlasse ich das modul als segv geheilt ins update.
Gerne.
Dann beende ich den Test mal und schicke das Testsystem (bis zum nächsten Test) in "Ruhestand" ;)
Gruß, Joachim
Zitat von: herrmannj am 15 April 2023, 21:11:40Zitat von: betateilchen am 15 April 2023, 09:29:34offtopic: hast Du schon einen Zeitplan, wann die anderen Dinge auf der ToDo-Liste zu JsonMod (insbesondere die Fehlerbehebung in der cron-Berechnung) umgesetzt werden können?
Di meinst die Wochentage? Die hatte ich tatsächlich nicht mehr auf dem zettel. Schau ich rein
Wir hatten da vor einem Jahr mal eine Grundsatzdiskussion zum Thema cron@JsonMod:
https://forum.fhem.de/index.php?topic=126519.0
Da war das Thema "Komma in cron-Ausdrücken" auch noch ein Thema, weil dabei Einträge verlorengehen.
Zitat von: herrmannj am 14 April 2023, 22:23:50Da Du und Yersinia die einzigen seid wo mir das bekannt ist: vielleicht könntet ihr die Version im Anhang für 24h mit dieser def testen:
Ich muss leider erstmal passen und kann frühstens in 1,5 Wochen verlässlich testen. :'( Wenn es brennt würde ich mich hier sowieso melden. Aber vielen Dank für den Fix und das Testen! :)
Zitat von: yersinia am 16 April 2023, 20:05:39Zitat von: herrmannj am 14 April 2023, 22:23:50Da Du und Yersinia die einzigen seid wo mir das bekannt ist: vielleicht könntet ihr die Version im Anhang für 24h mit dieser def testen:
Ich muss leider erstmal passen und kann frühstens in 1,5 Wochen verlässlich testen. :'( Wenn es brennt würde ich mich hier sowieso melden. Aber vielen Dank für den Fix und das Testen! :)
Kein Problem, der bug in perl ist mit hoher confidence gefunden, der workaround funktioniert und wird per fhem update verteilt. Ich meine mich zu erinnern, dass du einige Abfragen hattest die bei dir problematisch waren. Du könntest die bei Gelegenheit, nachdem du fhem aktualisiert hast, erneut testen.