Probleme mit HTTPMOD und extractAllJson

Begonnen von Isnogud0815, 12 September 2022, 11:32:42

Vorheriges Thema - Nächstes Thema

Isnogud0815

Hallo frank


2022.09.12 14:13:15 4: def: BodyDecode is decoding the response body as utf-8 (charset header utf-8, bodyDecode set to auto)
2022.09.12 14:13:15 4: def: extracted JSON values to internal
2022.09.12 14:13:15 5: def: GetCookies is looking for Cookies
2022.09.12 14:13:15 4: def: GetCookies parsed Cookie: AWSALB Wert V9njxxxxx/QG/m4brxxxxx Rest Expires=Mon, 19 Sep 2022 12:13:15 GMT; Path=/
2022.09.12 14:13:15 4: def: GetCookies parsed Cookie: AWSALBCORS Wert V9njxxxxx/QG/m4brxxxxx Rest Expires=Mon, 19 Sep 2022 12:13:15 GMT; Path=/; SameSite=None; Secure
2022.09.12 14:13:15 5: def: ExtractSid called, context set, num 01
2022.09.12 14:13:15 4: def: checking for redirects, code=200, ignore=0
2022.09.12 14:13:15 4: def: no redirects to handle
2022.09.12 14:13:15 5: def: Read callback sets LAST_REQUEST to set01
2022.09.12 14:13:15 5: def: CheckAuth decided no authentication required

frank

das sieht ja immer noch so aus wie ganz am anfang.
der log eintrag direkt davor zeigt auch noch den body, oder?

2022.09.12 14:13:15 4: def: extracted JSON values to internal
sieht man eventuell etwas in einem "list def"?

ZitatenforceGoodReadingNames
makes sure that reading names are valid and especially that extractAllJSON creates valid reading names.
starting with featurelevel > 5.9 HTTPMOD uses this feature by default. So you don't need to set it to 1, but you can disable it by setting it to 0
schon mal ausgeschaltet?
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

Isnogud0815

Heureka - ich habs gefunden


bodyDecode auto
enableControlSet 1
enforceGoodReadingNames 1
extractAllJSON 1
get01Data { "username": "xxxxx" }
get01Header Content-Type: application/json
get01Name Wasserhistorie
get01URL https://www.link-tap.com/api/getWateringHistory
room HTTPMOD
set01ExtractAllJSON 1
showBody 1
showError 1
showMatched 1
verbose 5


Statt set01URL usw muss ich get01URL usw nehmen um das mit POST an den Server zu übertragen, danach kann er den zurückgelieferten body lesen und auswerten
(siehe https://forum.fhem.de/index.php?topic=100901.0  Kommentar von shrek71)

Trotzdem Dank an alle !!! Ihr seid super !!!

Aeroschmelz

#18
Hallo,

Danke für den Beitrag, der hat mir sehr weiter geholfen. Die Daten werden ja leider nicht besonders FHEM freundlich übertragen. Darf ich dich fragen, wie du diese aufbereitest?
READINGS:
     2023-04-05 23:14:35   LAST_ERROR      connect to https://www.link-tap.com:443 timed out
     2023-04-08 03:15:43   LAST_REQUEST    update
     2023-04-08 03:15:43   MATCHED_READINGS
     2023-04-08 03:15:43   UNMATCHED_READINGS
     2023-03-31 13:49:30   message         The minimum interval of calling this API is 10 minutes.
     2023-04-07 19:33:09   result          ok
     2023-04-07 19:33:09   status_01_D     0
     2023-04-07 19:33:09   status_01_H     18
     2023-04-07 19:33:09   status_01_M     29
     2023-04-07 19:33:09   status_01_S     2
     2023-04-07 19:33:09   status_01_Y     20230328
     2023-04-07 19:33:09   status_01___v   0
     2023-04-07 19:33:09   status_01_createdAt 2023-03-28T16:29:57.627Z
     2023-04-07 19:33:09   status_01_macaddr 6692D81D004B1200_1
     2023-04-07 19:33:09   status_01_ss    57
     2023-04-07 19:33:09   status_01_vol   0
     2023-04-07 19:33:09   status_02_D     0
     2023-04-07 19:33:09   status_02_H     18
     2023-04-07 19:33:09   status_02_M     37
     2023-04-07 19:33:09   status_02_S     5
     2023-04-07 19:33:09   status_02_Y     20230328
     2023-04-07 19:33:09   status_02___v   0
     2023-04-07 19:33:09   status_02_createdAt 2023-03-28T16:37:46.504Z
     2023-04-07 19:33:09   status_02_macaddr 6692D81D004B1200_1
     2023-04-07 19:33:09   status_02_ss    46
     2023-04-07 19:33:09   status_02_vol   0
     2023-04-07 19:33:09   status_03_D     2
     2023-04-07 19:33:09   status_03_H     18
     2023-04-07 19:33:09   status_03_M     45
     2023-04-07 19:33:09   status_03_S     31
     2023-04-07 19:33:09   status_03_Y     20230328
     2023-04-07 19:33:09   status_03___v   0
     2023-04-07 19:33:09   status_03_createdAt 2023-03-28T16:45:39.481Z
     2023-04-07 19:33:09   status_03_macaddr 6692D81D004B1200_1
     2023-04-07 19:33:09   status_03_ss    39
     2023-04-07 19:33:09   status_03_vol   0
     2023-04-07 19:33:09   status_04_D     1
     2023-04-07 19:33:09   status_04_H     19
     2023-04-07 19:33:09   status_04_M     8
     2023-04-07 19:33:09   status_04_S     0
     2023-04-07 19:33:09   status_04_Y     20230328
     2023-04-07 19:33:09   status_04___v   0
     2023-04-07 19:33:09   status_04_createdAt 2023-03-28T17:08:54.037Z
     2023-04-07 19:33:09   status_04_macaddr 6692D81D004B1200_1
     2023-04-07 19:33:09   status_04_ss    53
     2023-04-07 19:33:09   status_04_vol   0



Danke

VG
Marcus