Neue Version von HTTPMOD mit neuen Features zum Testen

Begonnen von StefanStrobel, 05 Dezember 2015, 08:31:32

Vorheriges Thema - Nächstes Thema

amenomade

Nicht, dass ich wüsste. Aber andersrum ist es vielleicht möglich, indem Du get01Name-01 auf X10 setzt.
Zu probieren...

EDIT: wobei... was passiert, wenn Du get01Name auf X10-1 setzt?
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

StefanStrobel

(get|set|reading)[0-9]+AlwaysNum

Gruß
    Stefan

amenomade

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

andies

Zitat von: StefanStrobel am 12 November 2019, 22:31:51
(get|set|reading)[0-9]+AlwaysNum
wunderbar, passt - danke!


Gesendet von iPad mit Tapatalk Pro
FHEM 6.1 auf RaspPi3 (Raspbian:  6.1.21-v8+; Perl: v5.32.1)
SIGNALduino (433 MHz) und HM-UART (868 MHz), Sonoff, Blitzwolf, Somfy RTS, CAME-Gartentor, Volkszähler, Keyence-Sensor, Homematic-Sensoren und -thermostat, Ferraris-Zähler für Wasseruhr, Openlink-Nachbau Viessmann

StefanStrobel

Hallo,

nachdem keine Bug-Meldungen mehr kamen, habe ich die neue Version gerade eingecheckt.

Gruss
    Stefan

meier81

Hallo an alle,

habe gestern mein fhem geupdatet und promt Fehler bezüglich der neuen HTTPMOD-Version bekommen.

Hier mal meine Config (hab nur einen Benzinpreis angefügt):


define Agip HTTPMOD http://www.clever-tanken.de/tankstelle_details/1531 900
attr Agip userattr reading01Name reading01Regex reading02Name reading02Regex readingOExpr timeout
attr Agip enableControlSet 1
attr Agip event-on-change-reading .*
attr Agip group Benzinpreise
attr Agip icon gasoline
attr Agip reading01Name Diesel
attr Agip reading01Regex "price-type-name">Diesel</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9])
attr Agip reading02Name SuperE10
attr Agip reading02Regex "price-type-name">Super E10</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9])
attr Agip readingOExpr $val =~ s/<[\d\D]+>//;;$val
attr Agip room Allgemein->Benzinpreise
attr Agip stateFormat D:Diesel€;; E10:SuperE10€
attr Agip timeout 5


und hier der Auszug aus dem Log:


2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading01Regex "price-type-name">Diesel</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: Backslash found where operator expected at (eval 1371) line 1, near "d\"

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading01Regex "price-type-name">Diesel</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: String found where operator expected at (eval 1371) line 1, near "}"current-price-.""

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading01Regex "price-type-name">Diesel</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: (Missing operator before "current-price-."?)

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading01Regex "price-type-name">Diesel</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: Backslash found where operator expected at (eval 1371) line 1, near "9\"

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading01Regex "price-type-name">Diesel</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: (Missing operator before \?)

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading02Regex "price-type-name">Super E10</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: Backslash found where operator expected at (eval 1372) line 1, near "d\"

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading02Regex "price-type-name">Super E10</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: String found where operator expected at (eval 1372) line 1, near "}"current-price-.""

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading02Regex "price-type-name">Super E10</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: (Missing operator before "current-price-."?)

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading02Regex "price-type-name">Super E10</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: Backslash found where operator expected at (eval 1372) line 1, near "9\"

2019.11.19 11:53:33 3: Agip: PrecompileRegexAttr for reading02Regex "price-type-name">Super E10</div>[\d\D]{700,900}"current-price-.">([0-9\.]+[^0-9]+suffix-price-.">[0-9]) created warning: (Missing operator before \?)


Kann mir da von euch jemand weiterhelfen, bin mit dem regex-Sachen nicht so der Crack.

Danke und Gruß

Markus
QNAP NAS mit Debian VM, darauf FHEM, debmatic, influxdb2 und Grafana || HB-RF-ETH || SIGNALduino 433MHz mit Maple mini || WS980 Wetterstation || Xiaomi Mi Robot mit valetudo-FW || Buderus web KM100 || div. Tasmota-Devices

meier81

So,

hab eben nochmals geschaut und das ganze wie im Wiki-stehend abgeändert:


defmod Agip HTTPMOD http://www.clever-tanken.de/tankstelle_details/1531 900
attr Agip userattr reading01OExpr reading02OExpr
attr Agip enableControlSet 1
attr Agip event-on-change-reading .*
attr Agip group Benzinpreise
attr Agip icon gasoline
attr Agip reading01Name Diesel
attr Agip reading01OExpr $val + 0.009
attr Agip reading01Regex "price-type-name">Diesel<[\d\D]{600,900}"current-price-.">(\d.\d\d)
attr Agip reading02Name SuperE10
attr Agip reading02OExpr $val + 0.009
attr Agip reading02Regex "price-type-name">Super.E10<[\d\D]{600,900}"current-price-.">(\d.\d\d)
attr Agip room Allgemein->Benzinpreise
attr Agip stateFormat D: Diesel€;; E10: SuperE10€
attr Agip timeout 5


So funktioniert jetzt alles, da war meine Definition wohl etwas älter bzw. etwas anders.

Gruß

Markus
QNAP NAS mit Debian VM, darauf FHEM, debmatic, influxdb2 und Grafana || HB-RF-ETH || SIGNALduino 433MHz mit Maple mini || WS980 Wetterstation || Xiaomi Mi Robot mit valetudo-FW || Buderus web KM100 || div. Tasmota-Devices

meier81

Ich hab nur noch eine Info für euch, hab eben beim durchschauen des LOGs folgende Meldungen nach dem Neustart gefunden:


2019.11.19 15:06:59 1: PERL WARNING: "my" variable $fDefault masks earlier declaration in same scope at ./FHEM/98_HTTPMOD.pm line 2813, <$fh> line 236.


und


2019.11.19 15:08:00 1: PERL WARNING: Use of uninitialized value $regopt in substitution (s///) at ./FHEM/98_HTTPMOD.pm line 596.


Gruß

Markus
QNAP NAS mit Debian VM, darauf FHEM, debmatic, influxdb2 und Grafana || HB-RF-ETH || SIGNALduino 433MHz mit Maple mini || WS980 Wetterstation || Xiaomi Mi Robot mit valetudo-FW || Buderus web KM100 || div. Tasmota-Devices

StefanStrobel

Hallo Markus,

danke für die Hinweise.
Ich habe eine neue Version eingecheckt, die die Fehler beheben sollte.

Gruss
    Stefan

Tommy82

Hi,
ich habe nach gestriegen Update heute den Log voll mit:
2019.11.19 00:04:23.867 1: PERL WARNING: Use of uninitialized value $regopt in substitution (s///) at ./FHEM/98_HTTPMOD.pm line 596.
2019.11.19 00:04:23.872 1: stacktrace:
2019.11.19 00:04:23.872 1:     main::__ANON__                      called by ./FHEM/98_HTTPMOD.pm (596)
2019.11.19 00:04:23.873 1:     main::HTTPMOD_PrecompileRegexAttr   called by ./FHEM/98_HTTPMOD.pm (1883)
2019.11.19 00:04:23.873 1:     main::HTTPMOD_GetRegex              called by ./FHEM/98_HTTPMOD.pm (1995)
2019.11.19 00:04:23.873 1:     main::HTTPMOD_ExtractReading        called by ./FHEM/98_HTTPMOD.pm (2930)
2019.11.19 00:04:23.874 1:     main::HTTPMOD_Read                  called by FHEM/HttpUtils.pm (634)
2019.11.19 00:04:23.874 1:     main::__ANON__                      called by fhem.pl (751)
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

amenomade

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Tommy82

Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

frank

ich denke das problem wurde heute 15:27 gemeldet und 19:24 von stefan gefixt.  ;)
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

amenomade

Zitat von: frank am 19 November 2019, 20:46:59
ich denke das problem wurde heute 15:27 gemeldet und 19:24 von stefan gefixt.  ;)
Ja, hatte vergessen ;)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

StefanStrobel

Hallo,

ich habe gerade nochmal eine neue Version eingecheckt, die das Vorcompilieren bei der preProcessRegex wieder entfernt.
Bei s// ist das wohl nochmal anders zu handhaben, das muss ich mir erst in Ruhe ansehen.

Gruss
   Stefan