FHEM Forum

FHEM => Sonstiges => Thema gestartet von: cotecmania am 12 Mai 2016, 19:01:58

Titel: HTTPMOD erzeugt falsche Readings
Beitrag von: cotecmania am 12 Mai 2016, 19:01:58
Hallo,

habe soeben meine Userreadings erweitert (editieren der fhem.cfg  :-[) und nach Abspeichern waren falsche Readings vorhanden.
Es betrifft nur Readings mit Blanks :


FALSCH :
ESP                   Chip ID 13926976     2016-05-12 16:40:59

RICHTIG :
ESP Chip ID       13926976                 2016-05-12 18:53:51


Hier der aktuelle List :
Internals:
   BUSY       0
   DEF        http://192.168.1.171/ 3600
   Interval   3600
   LASTSEND   1463072031.6647
   MainURL    http://192.168.1.171/
   NAME       ESP8266_01
   NR         975
   STATE      Uptime: 0d 0h 9m
   TRIGGERTIME 1463075631.65772
   TRIGGERTIME_FMT 2016-05-12 19:53:51
   TYPE       HTTPMOD
   addr       http://192.168.1.171:80
   buf        HTTP/1.1 200 OK

Content-Type: text/html

Content-Length: 1632

Connection: close

Access-Control-Allow-Origin: *



<script language="javascript"><!--
function dept_onchange(frmselect) {frmselect.submit();}
//--></script><head><title>ESP8266_01</title><style>* {font-family:sans-serif; font-size:12pt;}h1 {font-size:16pt; color:black;}h6 {font-size:10pt; color:black; text-align:center;}.button-menu {background-color:#ffffff; color:blue; margin: 10px; text-decoration:none}.button-link {padding:5px 15px; background-color:#0077dd; color:#fff; border:solid 1px #fff; text-decoration:none}.button-menu:hover {background:#ddddff;}.button-link:hover {background:#369;}th {padding:10px; background-color:black; color:#ffffff;}td {padding:7px;}table {color:black;}.div_l {float: left;}.div_r {float: right; margin: 2px; padding: 1px 10px; border-radius: 7px; background-color:#080; color:white;}.div_br {clear: both;}</style></head><h1>Welcome to ESP Easy: ESP8266_01</h1><BR><a class="button-menu" href=".">Main</a><a class="button-menu" href="config">Config</a><a class="button-menu" href="hardware">Hardware</a><a class="button-menu" href="devices">Devices</a><a class="button-menu" href="tools">Tools</a><BR><BR><form><table><TH>System Info<TH><TH><TR><TD>Load:<TD>10% (LC=31475)<TR><TD>Uptime:<TD>9 minutes<TR><TD>Wifi RSSI:<TD>-64 dB<TR><TD>IP:<TD>192.168.1.171<TR><TD>GW:<TD>0.0.0.0<TR><TD>Build:<TD>106<TR><TD>Unit:<TD>1<TR><TD>STA MAC:<TD>18:fe:34:d4:82:40<TR><TD>AP MAC:<TD>1a:fe:34:d4:82:40<TR><TD>ESP Chip ID:<TD>13926976<TR><TD>Flash Chip ID:<TD>1458400<TR><TD>Flash Size:<TD>4096 kB<TR><TD>Free Mem:<TD>24648<TR><TD>Boot cause:<TD>Cold boot<TR><TH>Node List:<TH>IP<TH>Age<TR><TD><TD></table></form><h6>Powered by www.esp8266.nu</h6></body>
   code       200
   conn
   data
   displayurl http://192.168.1.171/
   header
   host       192.168.1.171
   httpheader HTTP/1.1 200 OK

Content-Type: text/html

Content-Length: 1632

Connection: close

Access-Control-Allow-Origin: *
   httpversion 1.0
   hu_blocking 0
   hu_filecount 1
   ignoreredirects 0
   loglevel   4
   path       /
   protocol   http
   redirects  0
   timeout    2
   url        http://192.168.1.171/
   value      0
   QUEUE:
   Readings:
     2016-05-12 16:40:59   Boot            cause Manual reboot
     2016-05-12 18:53:51   Boot cause      Cold boot
     2016-05-12 18:53:51   Build           106
     2016-05-12 16:40:59   ESP             Chip ID 13926976
     2016-05-12 18:53:51   ESP Chip ID     13926976
     2016-05-12 16:40:59   Flash           Chip ID 1458400
     2016-05-12 18:53:51   Flash Chip ID   1458400
     2016-05-12 18:53:51   Flash Size      4096
     2016-05-12 16:40:59   Free            Mem 25920
     2016-05-12 18:53:51   Free Mem        24648
     2016-05-12 18:53:51   IP              192.168.1.171
     2016-05-12 18:53:51   Load            10
     2016-05-12 18:53:51   Title           ESP8266_01
     2016-05-12 18:53:51   Unit            1
     2016-05-12 18:53:51   Uptime          9
   Request:
     data
     header
     ignoreredirects 0
     retryCount 0
     type       update
     url        http://192.168.1.171/
     value      0
   Defptr:
     Readingbase:
       Boot cause reading
       Build      reading
       ESP Chip ID reading
       Flash Chip ID reading
       Flash Size reading
       Free Mem   reading
       IP         reading
       Load       reading
       Title      reading
       Unit       reading
       Uptime     reading
       Wifi RSSI  reading
     Readingnum:
       Boot cause 07
       Build      03
       ESP Chip ID 09
       Flash Chip ID 10
       Flash Size 05
       Free Mem   06
       IP         02
       Load       12
       Title      08
       Unit       04
       Uptime     01
       Wifi RSSI  11
     Readingoutdated:
     Readingsubnum:
       Boot cause
       Build
       ESP Chip ID
       Flash Chip ID
       Flash Size
       Free Mem
       IP
       Load
       Title
       Unit
       Uptime
   Sslargs:
Attributes:
   reading01Name Uptime
   reading01Regex Uptime:<TD>([\d]+)
   reading02Name IP
   reading02Regex IP:<TD>([\d.]+)
   reading03Name Build
   reading03Regex Build:<TD>([\d]+)
   reading04Name Unit
   reading04Regex Unit:<TD>([\d]+)
   reading05Name Flash Size
   reading05Regex Flash Size:<TD>([\d]+)
   reading06Name Free Mem
   reading06Regex Free Mem:<TD>([\d]+)
   reading07Name Boot cause
   reading07Regex Boot cause:<TD>([\w ]+)
   reading08Name Title
   reading08Regex title>([\w ]+)
   reading09Name ESP Chip ID
   reading09Regex ESP Chip ID:<TD>([\d]+)
   reading10Name Flash Chip ID
   reading10Regex Flash Chip ID:<TD>([\d]+)
   reading11Name Wifi RSSI
   reading11Regex Wifi RSSI:<TD>([\d]+)
   reading12Name Load
   reading12Regex Load:<TD>([\d]+)
   room       Interfaces
   stateFormat {my $minutes = (ReadingsVal($name,"Uptime",0)); my $days=$minutes/60/24; my $hours=$minutes/60;  sprintf("Uptime: %dd %dh %dm", abs($days), $hours%24, $minutes%60)}
   userattr   reading01Name reading01Regex reading02Name reading02Regex reading03Name reading03Regex reading04Name reading04Regex reading05Name reading05Regex reading06Name reading06Regex reading07Name reading07Regex reading08Name reading08Regex reading09Name reading09Regex reading10Name reading10Regex reading11Name reading11Regex reading12Name reading12Regex


Gruss
Joe
Titel: Antw:HTTPMOD erzeugt falsche Readings
Beitrag von: dev0 am 12 Mai 2016, 19:42:39
Readings mit einem Space sind generell keine gute Idee, wenn deine Installation halbwegs aktuell ist gibt es dazu beim Start auch Warnungen.
Titel: Antw:HTTPMOD erzeugt falsche Readings
Beitrag von: StefanStrobel am 12 Mai 2016, 20:34:20
Hallo,

das einzig sinnvolle, was ich in HTTPMOD hier tun kann wäre vermutlich solche Readings gleich bei der Definition mit einer Fehlermeldung abzulehnen.
Ich pack es mal auf die Wunschliste für eine nächste Version.

Gruss
    Stefan
Titel: Antw:HTTPMOD erzeugt falsche Readings
Beitrag von: cotecmania am 12 Mai 2016, 22:42:55
Hi,

was habe ich dann für eine Alternative, wenn ich fast gleiche Readings im HTML habe wie diese ?

     2016-05-12 18:53:51   ESP Chip ID     13926976
     2016-05-12 18:53:51   Flash Chip ID   4678536


Gruss
Joe
Titel: Antw:HTTPMOD erzeugt falsche Readings
Beitrag von: frank am 12 Mai 2016, 23:12:52
Zitatwas habe ich dann für eine Alternative,
bitte etwas mehr kreativität!  :)

     2016-05-12 18:53:51   ESP_Chip_ID     13926976
     2016-05-12 18:53:51   Flash_Chip_ID   4678536
Titel: Antw:HTTPMOD erzeugt falsche Readings
Beitrag von: cotecmania am 13 Mai 2016, 09:58:34
Hallo,

Uuuups, also geht es wirklich nur um die Bezeichner (Name) ?
Ich habe das falsch verstanden und dachte das Suchen im HTML mit Regex und Leerzeichen hat da ein Problem.
Klar umbenennen ist kein Problem.
Ich werds testen ...

Gruss
Joe