HTTPMOD liefert immer den vorherigen Wert

Begonnen von Bollean, 17 November 2020, 09:57:01

Vorheriges Thema - Nächstes Thema

Bollean

Hallo zusammen,

ich habe ein Problem mit HTTPMOD. Ziel ist es, eine Webseite mit einer Regex zu durchsuchen, und mir am Ende einen Wert zurückzugeben, logisch :) Dieser Wert, den ich suche, ändert sich täglich.
Leider ist es nun so, dass ich immer den Wert vom gestrigen Tag bekomme. Sobald der Wert (z.B. Mittwoch) auf der Webseite aktualisiert wird, ändert sich auch auch der der Wert des Readings, aber er hat dann den Wert von Dienstag. Sobald am Donnerstag der neue Wert kommt, zeigt mein Reading den von Mittwoch usw.


define ValueToday HTTPMOD https://www.webseite.de/test.php 70000
attr ValueToday userattr icon reading01Name reading01Regex stateFormat timeout
attr ValueToday  enableControlSet 1
attr ValueToday enforceGoodReadingNames 1
attr ValueToday  enableCookies 0
attr ValueToday  icon car
attr ValueToday verbose 7
attr ValueToday  reading01Name wert
attr ValueToday reading01Regex <br><br>User\s:.([\w\s]*)
attr ValueToday stateFormat ValueToday: wert
attr ValueToday timeout 20

define ValueToday_write notify ValueToday { \
my $us = (ReadingsVal("ValueToday", "wert", ""));;\
$us = encode_utf8( $us );;\
system ("echo $us  > /home/pi/test/us.txt");;\
}


Log:


2020.11.17 07:25:36 5: ValueToday: set called with reread
2020.11.17 07:25:36 4: ValueToday: GetUpdate called (reread)
2020.11.17 07:25:36 5: ValueToday: AddToQueue adds type update to URL https://www.webseite.de/test.php, no data, no headers, retry 0, initial queue len: 0
2020.11.17 07:25:36 5: ValueToday: HandleSendQueue called from HTTPMOD::AddToSendQueue, qlen = 1
2020.11.17 07:25:36 4: ValueToday: HandleSendQueue sends update with timeout 20 to https://www.webseite.de/test.php, No Data, No Header
2020.11.17 07:25:37 3: ValueToday_message return value: -1
2020.11.17 07:25:51 5: ValueToday: ReadCallback called from bosshoss_X
2020.11.17 07:25:51 4: ValueToday: Read callback: request type was update retry 0,
header: HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 17 Nov 2020 07:25:51 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Set-Cookie: PHPSESSID=xxx; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache, body length 16119
2020.11.17 07:25:51 5: ValueToday: Read callback: body
<html lang="en">

2020.11.17 08:27:55 4: ValueToday: BodyDecode found charset header and set decoding to UTF-8 (bodyDecode was set to auto)
2020.11.17 08:27:55 4: ValueToday: BodyDecode is decoding the response body as UTF-8
2020.11.17 08:27:55 5: ValueToday: ExtractSid called, context reading, num 0
2020.11.17 08:27:55 4: ValueToday: checking for redirects, code=200, ignore=0
2020.11.17 08:27:55 4: ValueToday: no redirects to handle
2020.11.17 08:27:55 5: ValueToday: Read callback sets LAST_REQUEST to update
2020.11.17 08:27:55 5: ValueToday: CheckAuth decided no authentication required
2020.11.17 08:27:55 5: ValueToday: Read starts parsing response to update with defined readings: 01
2020.11.17 08:27:55 5: ValueToday: ExtractReading wertwith regex /(?^:<br><br>WertHeute:.([\w\s]*))/...
2020.11.17 08:27:55 5: ValueToday: ExtractReading for reading01-1 sets wert to 81343994
2020.11.17 08:27:55 5: ValueToday: ExtractReading value as hex is 3831333433393934
2020.11.17 08:27:55 4: ValueToday: Read response matched 1, unmatch 0 Reading(s)
2020.11.17 08:27:55 5: ValueToday: Read response to update matched wert
2020.11.17 08:27:56 3: ValueToday return value: -1
2020.11.17 08:27:56 5: ValueToday: HandleSendQueue called from HTTPMOD::ReadCallback, qlen = 0
2020.11.17 08:27:56 5: ValueToday: HandleSendQueue found no usable entry in queue



Gehe ich direkt über den Browser und schau mir den Quelltext an, finde ich den neuen Wert, und nicht den alten.
ich stehe vollig auf dem Schauch....

Könnt ihr mir helfen? Welche Infos sind noch nötig?

thx!
Christian