Neue Version von HTTPMOD mit neuen Features zum Testen

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

Vorheriges Thema - Nächstes Thema

frank

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

somansch


holle75

#707
@StefanStrobel
Hallo Stefan, ich habe ein HTTPMOD Device was meine Solaranlage ausliest. Dieses fährt mir wegen dem "cannotFork-Problem" innerhalb von zwei Tagen das RAM auf dem Raspi3 voll.

Link: https://forum.fhem.de/index.php/topic,84372.msg1032191.html#msg1032191

da es gerade eliminiert ist, direkt aus der cfg:
define XtenderReadout HTTPMOD none 10
attr XtenderReadout userattr get01Format get01Name get01Poll:0,1 get01PollDelay get01Regex get01URL get02Format get02Name get02Poll:0,1 get02Regex get02URL get03Name get03OMap get03Poll:0,1 get03PollDelay get03Regex get03URL get04Format get04Name get04Poll:0,1 get04Regex get04URL get05Format get05Name get05Poll:0,1 get05Regex get05URL get06Format get06Name get06Poll:0,1 get06PollDelay get06Regex get06URL get07Format get07Name get07Poll:0,1 get07PollDelay get07Regex get07URL readingMaxAge readingMaxAgeReplacement readingMaxAgeReplacementMode:text,reading,internal,expression,delete
attr XtenderReadout event-min-interval .*:1800
attr XtenderReadout event-on-change-reading Charge_Discharge_W:20,PV_Power_KW:0.05,PV_Power_W:50,Volt_Batt:0.3,SoC,Battery_cycle_phase,Temp_Batt,PV_Day_KWh
attr XtenderReadout event-on-update-reading .*
attr XtenderReadout get01Format %.1f
attr XtenderReadout get01Name SoC
attr XtenderReadout get01Poll 1
attr XtenderReadout get01PollDelay 60
attr XtenderReadout get01Regex <FloatValue>([1-9][0-9]\.?[0-9]?[0-9]?)
attr XtenderReadout get01URL https://einServer.com/webservice.asmx/ReadUserInfo?email=net@xx.com&pwd=xxxxxx&installationNumber=111111&device=BSP&infoId=7002
attr XtenderReadout get02Format %.2f
attr XtenderReadout get02Name Volt_Batt
attr XtenderReadout get02Poll 1
attr XtenderReadout get02Regex <FloatValue>([1-3][0-9]\.?[0-9]?[0-9]?)
attr XtenderReadout get02URL https://einServer.com/webservice.asmx/ReadUserInfo?email=net@xx.com&pwd=xxxxxx&installationNumber=111111&device=BSP&infoId=7000
attr XtenderReadout get03Name Battery_cycle_phase
attr XtenderReadout get03OMap 0:Bulk, 1:Absorption, 2:Equalize, 3:Floating, 6:R.Floating ,7:Per.Absorption
attr XtenderReadout get03Poll 1
attr XtenderReadout get03PollDelay 60
attr XtenderReadout get03Regex <FloatValue>([0-9])
attr XtenderReadout get03URL https://einServer.com/webservice.asmx/ReadUserInfo?email=net@xx.com&pwd=xxxxxx&installationNumber=111111&device=VT1&infoId=11038
attr XtenderReadout get04Format %.2f
attr XtenderReadout get04Name PV_Power_KW
attr XtenderReadout get04Poll 1
attr XtenderReadout get04Regex <FloatValue>([0-1]\.?[0-9]?[0-9]?)
attr XtenderReadout get04URL https://einServer.com/webservice.asmx/ReadUserInfo?email=net@xx.com&pwd=xxxxxx&installationNumber=111111&device=VT1&infoId=11004
attr XtenderReadout get05Format %2d
attr XtenderReadout get05Name Charge_Discharge_W
attr XtenderReadout get05Poll 1
attr XtenderReadout get05Regex <FloatValue>([-.0-9]+)
attr XtenderReadout get05URL https://einServer.com/webservice.asmx/ReadUserInfo?email=net@xx.com&pwd=xxxxxx&installationNumber=111111&device=BSP&infoId=7003
attr XtenderReadout get06Format %.1f
attr XtenderReadout get06Name Temp_Batt
attr XtenderReadout get06Poll 1
attr XtenderReadout get06PollDelay 60
attr XtenderReadout get06Regex <FloatValue>([.0-9]*)
attr XtenderReadout get06URL https://einServer.com/webservice.asmx/ReadUserInfo?email=net@xx.com&pwd=xxxxxx&installationNumber=111111&device=BSP&infoId=7029
attr XtenderReadout get07Format %.2f
attr XtenderReadout get07Name PV_Day_KWh
attr XtenderReadout get07Poll 1
attr XtenderReadout get07PollDelay 600
attr XtenderReadout get07Regex <FloatValue>([0-1]?[0-9]\.?[0-9]?[0-9]?)
attr XtenderReadout get07URL https://einServer.com/webservice.asmx/ReadUserInfo?email=net@xx.com&pwd=xxxxxx&installationNumber=111111&device=VT1&infoId=11007
attr XtenderReadout group Xtender
attr XtenderReadout readingMaxAge 1200
attr XtenderReadout readingMaxAgeReplacement "outdated - was " . $val
attr XtenderReadout readingMaxAgeReplacementMode expression
attr XtenderReadout stateFormat {sprintf("Phase: %s - SoC: %.1f - PV: %2d Watt", ReadingsVal($name,"Battery_cycle_phase",0), ReadingsVal($name,"SoC",0), ReadingsVal($name,"PV_Power_W",0))}
attr XtenderReadout userReadings PV_Power_W {ReadingsVal("XtenderReadout","PV_Power_KW",0)*1000}
attr XtenderReadout verbose 2


Vielleicht hast du eine Idee, welches "böse" RegEx im Device genau das Problem verursacht ?

lieb Gruß und Danke fürs Schauen
H.

Edit: mehr Info (OS, PERL-Version, ...) im anderen Thread. Denke, dass das auch für andere Problemgeschädigte interessant sein dürfte.

holle75

Dank @RudolfKoenigs Hinweis auf

attr <DEVICE> regexDecode utf-8

sieht es bis jetzt fantastisch aus. Dankeschön!

Ich beobachte.

uwirt

#709
Ich habe das Problem dass aus der Webseite aus welcher ich Daten extrahieren will nur das erste Reading angezeigt wird. Die regex-Funktion habe ich mit dem online regex tester geprüft und es sollte eigentlich matchen.

Ein Teil der Datei die ich extrahieren möchte sieht wie folgt aus:

Zitat
                        <tbody><th scope="col">Prognosen</th><tr>
                         
                          <th scope="col">
                            <span>Donnerstag<span>26.3.</span></span>
                          </th>
                          <th scope="col">
                            <span>Freitag<span>27.3.</span></span>
                          </th>
                        </tr>
                        <tr>
                          <td>Erle</td>
                          <td>
                            <span class="slider_bg" alt="schwache Belastung">
                              <span class="slider" style="margin-left:40%">
                                <span class="sl_button"></span>
                              </span>
                            </span>
                          </td>
                          <td>
                            <span class="slider_bg" alt="schwache Belastung">
                              <span class="slider" style="margin-left:40%">
                                <span class="sl_button"></span>
                              </span>
                            </span>
                          </td>
                        </tr>
                        <tr>
                          <td>Esche</td>
                          <td>
                            <span class="slider_bg" alt="schwache Belastung">
                              <span class="slider" style="margin-left:40%">
                                <span class="sl_button"></span>
                              </span>
                            </span>
                          </td>
                          <td>
                            <span class="slider_bg" alt="schwache Belastung">
                              <span class="slider" style="margin-left:40%">
                                <span class="sl_button"></span>
                              </span>
                            </span>
                          </td>
                        </tr>
                        <tr>
                          <td>Hasel</td>
                          <td>
                            <span class="slider_bg" alt="schwache Belastung">
                              <span class="slider" style="margin-left:40%">
                                <span class="sl_button"></span>
                              </span>
                            </span>
                          </td>
                          <td>
                            <span class="slider_bg" alt="schwache Belastung">
                              <span class="slider" style="margin-left:40%">
                                <span class="sl_button"></span>
                              </span>
                            </span>
                          </td>
                        </tr>
                      </tbody></table>
                      <p class="laut">Keine Belastung durch folgende Pollen:</p>
                      <p>Ambrosia, Ampfer, Beifuss, Birke, Buche,
Edelkastanie, Eiche, Gerste, Gräser, Hagebuche, Löwenzahn, Linde,
Pappel, Platane, Roggen, Ulme, Wegerich, Weide, Weizen</p>

Die Definition:


defmod Pollenflug_2 HTTPMOD http://meteonews.ch/de/Biowetter/G2658903/Saanenmöser 86400
attr Pollenflug_2 userattr get1CheckAllReadings:0,1 reading01Name reading01RegOpt reading01Regex reading02Name reading02RegOpt reading02Regex reading03Name reading03RegOpt reading03Regex
attr Pollenflug_2 devStateStyle style="text-align:right;;;;"
attr Pollenflug_2 enableControlSet 1
attr Pollenflug_2 get1CheckAllReadings 1
attr Pollenflug_2 reading01Name Erle
attr Pollenflug_2 reading01Regex (?s)Erle.+?alt="(.+? Belastung)">.+?margin-left:(.+?%)
attr Pollenflug_2 reading02Name Esche
attr Pollenflug_2 reading02Regex (?s)>\Esche+?alt="(.+? Belastung)">.+?margin-left:(.+?%)
attr Pollenflug_2 reading03Name Hasel
attr Pollenflug_2 reading03Regex (?s)Hasel+?alt="(.+? Belastung)">.+?margin-left:(.+?%)
attr Pollenflug_2 room Wetterprognose

setstate Pollenflug_2 2020-03-26 12:53:14 Erle-1 schwache Belastung
setstate Pollenflug_2 2020-03-26 12:53:14 Erle-2 40%


Ich möchte die Werte für alle Allergene auslesen. Nur leider zeigt es mir nur diejenigen für Erle an. Das attribut "getCheckAllreadings 1" scheint wohl nichts zu nützen?!
FHEM / Ubuntu / fitlet2
HomeMatic: CCU3|HmIP-STHD|HmIP-PCBS|HmIP-PCBS2|HmIP-PCBS-BAT|HM-WDC7000|HM-WDS100-C6-O|HM-WDS40|HM-LC-Sw1-FM|HM-LC-RGBW-WM|HM-ES-PMSw1-Pl|HM-ES-TX-WM
NAS: DS218+|DS209j|DS216+II|DS412+
Devices: Panasonic Webcams|Withings|Gardena Smart|Tuya

frank

direkt hinter esche und hasel fehlt zb jeweils ein punkt in der regex.
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

uwirt

Ach ja ... das wars ... manchmal sieht man halt den Wald vor lauter Punkten nicht mehr.

Besten Dank für die rasche Hilfe!
FHEM / Ubuntu / fitlet2
HomeMatic: CCU3|HmIP-STHD|HmIP-PCBS|HmIP-PCBS2|HmIP-PCBS-BAT|HM-WDC7000|HM-WDS100-C6-O|HM-WDS40|HM-LC-Sw1-FM|HM-LC-RGBW-WM|HM-ES-PMSw1-Pl|HM-ES-TX-WM
NAS: DS218+|DS209j|DS216+II|DS412+
Devices: Panasonic Webcams|Withings|Gardena Smart|Tuya

FHEm2005

Ich wollte mir von der Seite https://www.mags.nrw/coronavirus-fallzahlen-nrw die Fallzahlen für einen bestimmten Bereich anzeigen lassen. Dazu habe ich Folgendes definiert:
define COVID19 HTTPMOD https://www.mags.nrw/coronavirus-fallzahlen-nrw 10

Die 10 Sekunden am Ende gelten nur während der Testphase.

Ich bekomme nur den HTTP-Header angezeigt. Ich war es gewohnt den Buffer angezeigt zu bekommen. Das INTERNAL 'httpheader' sieht wie folgt aus:

HTTP/1.1 200 OK
Date: Fri, 27 Mar 2020 09:27:39 GMT
Strict-Transport-Security: max-age=31536000; preload
Content-Type: text/html; charset=utf-8
Content-Language: de
X-Frame-Options: SAMEORIGIN
Cache-Control: public, max-age=7200
Vary: Cookie,Accept-Encoding
X-XSS-Protection: 1; mode=block
X-Content-Options: nosniff
X-Content-Type-Options: nosniff
X-Permitted-Cross-Domain-Policies: master-only
Content-Encoding: gzip
Content-Length: 27619
Connection: close


Werden unter bestimmten Unständen die Daten einer Seite nicht angezeigt?

Attribute sind zu diesem Zeitpunkt außer 'room' keine weiteren gesetzt.  Was kann ich machen um den 'buf' angezeigt zu bekommen?

Gruß Eberhard
Raspi3: FHEM, CULV3 (V1.61), EnOcean Pi 868, nanoCUL433, HUE-Bridge; Raspi4: Node-red, MQTT, Gaszähler auslesen mit ESP32-CAM, BSB-LAN

frank

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

Chris8888

Hallo zusammen,

ich versuche nun seit 2 Tagen mich dem Thema HTTPMOD zu nähern.
Verstehen tue ich ehrlicherweise immer noch nur Bahnhof.

Es geht doch im Grunde darum aus einer Webseite einen bestimmten Teil in eine Variable zu schreiben, oder?
Ich habe jetzt das halbe Internet (okay, so viel nicht) zu demThema versucht zu verstehen, ich stosse aber deutlich an meine Grenzen.
Auch das Nachstellen der vielen Beispiele hilft nicht.
RegEx-Tester und so weiter...alles versucht zu verstehen.

Mir bleiben also nur 3 Moglichkeiten:
1. Ihr habt eine Tipp für eine kleines Einsteigerseminar für Doofe.

2. Ich gebe auf.

3. Jemand hilft mir mit meinem Anwendungsfall (Web-Gui meienr Wallbox) und schubst mich in die richtige Richtung.
Mein HTML-Code:
<html>

<head>

  <title>ABL3W226002111 - CPA Diagnosis</title> 

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta http-equiv="expires" content="0" />
  <meta http-equiv="refresh" content="40; URL=/sys_diag.html">
  <link rel="stylesheet" type="text/css" media="screen" href="/format.css" />

  <link rel="icon" type="image/png" href="/html/icons/favicon-16x16.png">
</head>

<body>


<div id="header">
  <img src="/html/icons/abls-logo.png" style="height: 40px; float: left;">
  <h1 style="float:left; text-align:center; line-height:53px; width:70%">Charge Point Administration</h1>
 
  <form action="lang_sel.html" method="GET"><select name="lang"><option selected="selected" value="en" />en&nbsp;</option>
<option value="de" />de&nbsp;</option>
<option value="ru" />ru&nbsp;</option>
</select><input type="submit" value="choose" /></form>
 
</div>

<ul id="liste" style="clear:left;">

    <li id=""><a href="/index.html">Overview</a></li>
    <li id=""><a href="/bc_show.html">Configuration</a></li>
    <li id=""><a href="/dc_show.html">Devices</a></li>
    <li id=""><a href="/pc_show.html">Products</a></li>
   
   
    <li id=""><a href="/ca_show.html">Certificates</a></li>

    <li id="ChoosenTab"><a href="/sys_diag.html">Diagnosis</a></li>
    <li id=""><a href="/show_log.html">Logs</a></li>

    <!-- <li id=""><a href="/ev_log.html">EV Log</a></li> -->
    <li id=""><a href="/sys_care.html">Maintenance</a></li>
     
    <!--  <li id=""><a href="/about.html">About</a></li> -->
   
    <!-- <li><a href="/loginout.html">Log Out</a></li> -->
</ul>

<div id="inhalt">



<h2>List of Devices</h2>

<table id="sys_diag">
<tr><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=host100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th colspan="2" class="second_column">Host </th>
<th> ABL, SBC-II (S/N 808829102298)</th></tr>
<tr><td colspan="3"></td><td>Logical ID: host100, Physical ID: 0_0_0_0</td></tr>
<tr><td colspan="3"></td><td>HW: D, SW: 1.6p1, OS: 1.6p1</td></tr>
<tr><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=nad100" ><img src="/html/icons/status_nok.png" title="MISCONFIGURED" /></a></th>
<th colspan="2" class="second_column">Network Device </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: nad100, Physical ID: ppp0</td></tr>
<tr><td colspan="3"></td><td><li>Network State: Not connected</li>
</td></tr>
<tr><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=smgw100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th colspan="2" class="second_column">LGW </th>
<th> SEALAG, S5210LOGGINGGATEWAY (S/N 192901df)</th></tr>
<tr><td colspan="3"></td><td>Logical ID: smgw100, Physical ID: 3_2_7_100</td></tr>
<tr><td colspan="3"></td><td>HW: 1.1, SW: 1.38</td></tr>
<tr><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=evse100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th colspan="2" class="second_column">EVSE </th>
<th> ABL, EVCC2-redesign</th></tr>
<tr><td colspan="3"></td><td>Logical ID: evse100, Physical ID: 4_1_4_1</td></tr>
<tr><td colspan="3"></td><td>Device-Type: EVSE, Bus-Type: Modbus ASCII, Port: 1 , Id: 1</td></tr>
<tr><td colspan="3"></td><td>HW: 1.0, SW: V4.1</td></tr>
<tr><td colspan="3"></td><td><li>State: A1 ( A1_UNPLUGGED )</li>
<li>Actual Current Limit: 12.0 A (Ic)</li>
<li>Loadsetter's Current Limit: 12.0 A (Icmax)</li>
<li>Max. Current Limit: 16.0 A (min (Idefault & Irated))</li>
<li>Rated Current: 32.0 A</li>
<li>Default Current: 16.0 A</li>
</td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=io100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">General Purpose IO </th>
<th> ABL, EVCC2-redesign</th></tr>
<tr><td colspan="3"></td><td>Logical ID: io100, Physical ID: 4_1_5_1, Parent device: 4_1_4_1</td></tr>
<tr><td colspan="3"></td><td><li>Value of Channel 0 : 0</li><li>Value of Channel 1 : 0</li></td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=meter101" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Meter </th>
<th> ABL, EVCC2-redesign</th></tr>
<tr><td colspan="3"></td><td>Logical ID: meter101, Physical ID: 4_1_1_1, Parent device: 4_1_4_1</td></tr>
<tr><td colspan="3"></td><td>Device-Type: Meter, Bus-Type: Modbus ASCII, Port: 1 , Id: 1</td></tr>
<tr><td colspan="3"></td><td>HW: 1.0, SW: V4.1</td></tr>
<tr><td colspan="3"></td><td><table class="diag_meter_values"><tr><th>Measurand</th><th>Value</th><th>Unit</th><th>Description</th><th>Timestamp</th></tr><tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">no value</td><td> A</td><td>L1</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">no value</td><td> A</td><td>L2</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">no value</td><td> A</td><td>L3</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
</table></td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=auth100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Card Reader </th>
<th> ABL, RFIDM60</th></tr>
<tr><td colspan="3"></td><td>Logical ID: auth100, Physical ID: 4_1_3_1</td></tr>
<tr><td colspan="3"></td><td>Device-Type: RFID, Bus-Type: Modbus ASCII, Port: 1 , Id: 1</td></tr>
<tr><td colspan="3"></td><td>HW: 1.0, SW: V1.3</td></tr>
<tr><td colspan="3"></td><td><li>Last authentication by: 000000AEE274EB</li><li>Last type of authentication: ISO14443</li><li>Last time of authentication at: 2020/03/23 06:58:47</li>
</td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=meter100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Meter </th>
<th> Gavazzi, EM340-DIN AV2 3 X S1 X (S/N 181294)</th></tr>
<tr><td colspan="3"></td><td>Logical ID: meter100, Physical ID: 3_2_1_1, Parent device: 3_2_7_100</td></tr>
<tr><td colspan="3"></td><td>Device-Type: Meter, Bus-Type: Modbus RTU, Port: 2 , Id: 1</td></tr>
<tr><td colspan="3"></td><td>HW: 341, SW: B 4</td></tr>
<tr><td colspan="3"></td><td><table class="diag_meter_values"><tr><th>Measurand</th><th>Value</th><th>Unit</th><th>Description</th><th>Timestamp</th></tr><tr><td> ENERGY_ACTIVE_EXPORT_REGISTER </td> <td style="text-align:right;">0.0</td><td> kWH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_ACTIVE_IMPORT_REGISTER </td> <td style="text-align:right;">258.339</td><td> kWH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_REACTIVE_EXPORT_REGISTER </td> <td style="text-align:right;">17.389</td><td> kVARH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_REACTIVE_IMPORT_REGISTER </td> <td style="text-align:right;">0.003</td><td> kVARH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_ACTIVE_IMPORT_INTERVAL </td> <td style="text-align:right;">258.3</td><td> kWH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_REACTIVE_IMPORT_INTERVAL </td> <td style="text-align:right;">0.0</td><td> kVARH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> POWER_ACTIVE_IMPORT </td> <td style="text-align:right;">0.0</td><td> W</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> POWER_REACTIVE_IMPORT </td> <td style="text-align:right;">0.0</td><td> VAR</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">0.0</td><td> A</td><td>L1</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">0.0</td><td> A</td><td>L2</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">0.0</td><td> A</td><td>L3</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> VOLTAGE </td> <td style="text-align:right;">234.1</td><td> V</td><td>L1-N</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> VOLTAGE </td> <td style="text-align:right;">231.9</td><td> V</td><td>L2-N</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> VOLTAGE </td> <td style="text-align:right;">231.2</td><td> V</td><td>L3-N</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> OPERATING_HOURS </td> <td style="text-align:right;">0.0</td><td> H</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
</table></td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=breaker100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Breaker </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: breaker100, Physical ID: PB-0-1</td></tr>
<tr><td colspan="3"></td><td><li>Type: RCCB</li><li>Maximum current: 0</li><li>Logical-ID Trigger Device: [meter100, evse100]</li>
</td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=phro100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Phase Rotation </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: phro100, Physical ID: PHR-0-1</td></tr>
<tr><td colspan="3"></td><td>Phases will be mapped from 123N -> 123N
</td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=limit100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Limit </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: limit100, Physical ID: LIM-PL-1</td></tr>
<tr><td colspan="3"></td><td><li>Type: STATIC</li><li>Maximum Current: 16.0 A</li></td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=limit200" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Limit </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: limit200, Physical ID: LIM-SL-1</td></tr>
<tr><td colspan="3"></td><td><li>Type: STATIC</li><li>Maximum Current: 16.0 A</li></td></tr>
</table>



Devices indented under an EVSE are used by this EVSE.

</div>


<div id="footer">
Page loaded at: 2020/03/24 18:13:55 UTC acc. to operating system's time; This page reloads every 40 seconds.
<br/>
Copyright 2018 ABL,
<a href="http://www.abl.de">http://www.abl.de</a>,
<a href="mailto:info@abl.de">info@abl.de</a>
</div>

</body>

</html>


Ich benötige aus:
<tr><td> ENERGY_ACTIVE_IMPORT_INTERVAL </td> <td style="text-align:right;">258.3</td><td> kWH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
den Wert 258.3 in die Variable Verbrauch und
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">0.0</td><td> A</td><td>L1</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
den Wert 0.0 in die Variable aktuelle-Leistung

Ich bin dankbar für jede Hilfe!

Viele Grüße
Christian
FHEM 6.0 auf einem PI4 mit div. Homematic-Komponenten, Alexa, Tablet-UI und Homebridge...und läuft einfach. Erweitert mit CCU3 und Homematic-IP...und läuft immer noch.

yersinia

Hast du mal ein list deines httpmod devices?

Aus dem Bauch heraus würde ich die userattr so setzen:
attr DEVICE enableControlSet 1
attr DEVICE webCmd reread
attr DEVICE userattr reading010Name reading010OExpr reading010Regex reading020Name reading020OExpr reading020Regex
attr DEVICE reading010Name Verbrauch
attr DEVICE reading010OExpr $val =~ s/,/\./;; $val;;
attr DEVICE reading010Regex ENERGY_ACTIVE_IMPORT_INTERVAL[\s]*<\/td>[\s]*<td style="text-align:right;">([\d]+[.][\d])
attr DEVICE reading020Name Leistung
attr DEVICE reading020OExpr $val =~ s/,/\./;; $val;;
attr DEVICE reading020Regex CURRENT_IMPORT[\s]*<\/td>[\s]*<td style="text-align:right;">([\d]+[.][\d])
viele Grüße, yersinia
----
FHEM 6.3 (SVN) on RPi 4B with RasPi OS Bullseye (perl 5.32.1) | FTUI
nanoCUL->2x868(1x ser2net)@tsculfw, 1x433@Sduino | MQTT2 | Tasmota | ESPEasy
VCCU->14xSEC-SCo, 7xCC-RT-DN, 5xLC-Bl1PBU-FM, 3xTC-IT-WM-W-EU, 1xPB-2-WM55, 1xLC-Sw1PBU-FM, 1xES-PMSw1-Pl

Chris8888

#716
Hi,

schon mal vielen Dank für deine Hilfe!

Hier meine Device:
Internals:
   BUSY       0
   CFGFN     
   CHANGED   
   DEF        http://192.168.99.17:8300/sys_diag.html 700000
   FUUID      5e78fa86-f33f-a241-32da-0f3fe36afa67be9d
   Interval   700000
   LASTSEND   1585073639.77027
   MainURL    http://192.168.99.17:8300/sys_diag.html
   ModuleVersion 3.5.22 - 7.2.2020
   NAME       wallbox
   NOTIFYDEV  global
   NR         80994
   NTFY_ORDER 50-wallbox
   STATE      ???
   TRIGGERTIME 1585773639.76723
   TRIGGERTIME_FMT 2020-04-01 22:40:39
   TYPE       HTTPMOD
   addr       http://192.168.99.17:8300
   auth       0
   buf       
   code       200
   compress   1
   conn       
   data       
   displayurl http://192.168.99.17:8300/sys_diag.html
   header     
   host       192.168.99.17
   httpbody   <html>

<head>

  <title>ABL3W226002111 - CPA Diagnosis</title> 

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta http-equiv="expires" content="0" />
  <meta http-equiv="refresh" content="40; URL=/sys_diag.html">
  <link rel="stylesheet" type="text/css" media="screen" href="/format.css" />

  <link rel="icon" type="image/png" href="/html/icons/favicon-16x16.png">
</head>

<body>


<div id="header">
  <img src="/html/icons/abls-logo.png" style="height: 40px; float: left;">
  <h1 style="float:left; text-align:center; line-height:53px; width:70%">Charge Point Administration</h1>
 
  <form action="lang_sel.html" method="GET"><select name="lang"><option selected="selected" value="en" />en&nbsp;</option>
<option value="de" />de&nbsp;</option>
<option value="ru" />ru&nbsp;</option>
</select><input type="submit" value="choose" /></form>
 
</div>

<ul id="liste" style="clear:left;">

    <li id=""><a href="/index.html">Overview</a></li>
    <li id=""><a href="/bc_show.html">Configuration</a></li>
    <li id=""><a href="/dc_show.html">Devices</a></li>
    <li id=""><a href="/pc_show.html">Products</a></li>
   
   
    <li id=""><a href="/ca_show.html">Certificates</a></li>

    <li id="ChoosenTab"><a href="/sys_diag.html">Diagnosis</a></li>
    <li id=""><a href="/show_log.html">Logs</a></li>

    <!-- <li id=""><a href="/ev_log.html">EV Log</a></li> -->
    <li id=""><a href="/sys_care.html">Maintenance</a></li>
     
    <!--  <li id=""><a href="/about.html">About</a></li> -->
   
    <!-- <li><a href="/loginout.html">Log Out</a></li> -->
</ul>

<div id="inhalt">



<h2>List of Devices</h2>

<table id="sys_diag">
<tr><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=host100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th colspan="2" class="second_column">Host </th>
<th> ABL, SBC-II (S/N 808829102298)</th></tr>
<tr><td colspan="3"></td><td>Logical ID: host100, Physical ID: 0_0_0_0</td></tr>
<tr><td colspan="3"></td><td>HW: D, SW: 1.6p1, OS: 1.6p1</td></tr>
<tr><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=nad100" ><img src="/html/icons/status_nok.png" title="MISCONFIGURED" /></a></th>
<th colspan="2" class="second_column">Network Device </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: nad100, Physical ID: ppp0</td></tr>
<tr><td colspan="3"></td><td><li>Network State: Not connected</li>
</td></tr>
<tr><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=smgw100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th colspan="2" class="second_column">LGW </th>
<th> SEALAG, S5210LOGGINGGATEWAY (S/N 192901df)</th></tr>
<tr><td colspan="3"></td><td>Logical ID: smgw100, Physical ID: 3_2_7_100</td></tr>
<tr><td colspan="3"></td><td>HW: 1.1, SW: 1.38</td></tr>
<tr><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=evse100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th colspan="2" class="second_column">EVSE </th>
<th> ABL, EVCC2-redesign</th></tr>
<tr><td colspan="3"></td><td>Logical ID: evse100, Physical ID: 4_1_4_1</td></tr>
<tr><td colspan="3"></td><td>Device-Type: EVSE, Bus-Type: Modbus ASCII, Port: 1 , Id: 1</td></tr>
<tr><td colspan="3"></td><td>HW: 1.0, SW: V4.1</td></tr>
<tr><td colspan="3"></td><td><li>State: A1 ( A1_UNPLUGGED )</li>
<li>Actual Current Limit: 12.0 A (Ic)</li>
<li>Loadsetter's Current Limit: 12.0 A (Icmax)</li>
<li>Max. Current Limit: 16.0 A (min (Idefault & Irated))</li>
<li>Rated Current: 32.0 A</li>
<li>Default Current: 16.0 A</li>
</td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=io100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">General Purpose IO </th>
<th> ABL, EVCC2-redesign</th></tr>
<tr><td colspan="3"></td><td>Logical ID: io100, Physical ID: 4_1_5_1, Parent device: 4_1_4_1</td></tr>
<tr><td colspan="3"></td><td><li>Value of Channel 0 : 0</li><li>Value of Channel 1 : 0</li></td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=meter101" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Meter </th>
<th> ABL, EVCC2-redesign</th></tr>
<tr><td colspan="3"></td><td>Logical ID: meter101, Physical ID: 4_1_1_1, Parent device: 4_1_4_1</td></tr>
<tr><td colspan="3"></td><td>Device-Type: Meter, Bus-Type: Modbus ASCII, Port: 1 , Id: 1</td></tr>
<tr><td colspan="3"></td><td>HW: 1.0, SW: V4.1</td></tr>
<tr><td colspan="3"></td><td><table class="diag_meter_values"><tr><th>Measurand</th><th>Value</th><th>Unit</th><th>Description</th><th>Timestamp</th></tr><tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">no value</td><td> A</td><td>L1</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">no value</td><td> A</td><td>L2</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">no value</td><td> A</td><td>L3</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
</table></td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=auth100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Card Reader </th>
<th> ABL, RFIDM60</th></tr>
<tr><td colspan="3"></td><td>Logical ID: auth100, Physical ID: 4_1_3_1</td></tr>
<tr><td colspan="3"></td><td>Device-Type: RFID, Bus-Type: Modbus ASCII, Port: 1 , Id: 1</td></tr>
<tr><td colspan="3"></td><td>HW: 1.0, SW: V1.3</td></tr>
<tr><td colspan="3"></td><td><li>Last authentication by: 000000AEE274EB</li><li>Last type of authentication: ISO14443</li><li>Last time of authentication at: 2020/03/23 06:58:47</li>
</td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=meter100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Meter </th>
<th> Gavazzi, EM340-DIN AV2 3 X S1 X (S/N 181294)</th></tr>
<tr><td colspan="3"></td><td>Logical ID: meter100, Physical ID: 3_2_1_1, Parent device: 3_2_7_100</td></tr>
<tr><td colspan="3"></td><td>Device-Type: Meter, Bus-Type: Modbus RTU, Port: 2 , Id: 1</td></tr>
<tr><td colspan="3"></td><td>HW: 341, SW: B 4</td></tr>
<tr><td colspan="3"></td><td><table class="diag_meter_values"><tr><th>Measurand</th><th>Value</th><th>Unit</th><th>Description</th><th>Timestamp</th></tr><tr><td> ENERGY_ACTIVE_EXPORT_REGISTER </td> <td style="text-align:right;">0.0</td><td> kWH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_ACTIVE_IMPORT_REGISTER </td> <td style="text-align:right;">258.339</td><td> kWH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_REACTIVE_EXPORT_REGISTER </td> <td style="text-align:right;">17.389</td><td> kVARH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_REACTIVE_IMPORT_REGISTER </td> <td style="text-align:right;">0.003</td><td> kVARH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_ACTIVE_IMPORT_INTERVAL </td> <td style="text-align:right;">258.3</td><td> kWH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> ENERGY_REACTIVE_IMPORT_INTERVAL </td> <td style="text-align:right;">0.0</td><td> kVARH</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> POWER_ACTIVE_IMPORT </td> <td style="text-align:right;">0.0</td><td> W</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> POWER_REACTIVE_IMPORT </td> <td style="text-align:right;">0.0</td><td> VAR</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">0.0</td><td> A</td><td>L1</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">0.0</td><td> A</td><td>L2</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> CURRENT_IMPORT </td> <td style="text-align:right;">0.0</td><td> A</td><td>L3</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> VOLTAGE </td> <td style="text-align:right;">234.1</td><td> V</td><td>L1-N</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> VOLTAGE </td> <td style="text-align:right;">231.9</td><td> V</td><td>L2-N</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> VOLTAGE </td> <td style="text-align:right;">231.2</td><td> V</td><td>L3-N</td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
<tr><td> OPERATING_HOURS </td> <td style="text-align:right;">0.0</td><td> H</td><td></td><td style="text-align:center;" > 2020/03/24 18:13:25</td></tr>
</table></td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=breaker100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Breaker </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: breaker100, Physical ID: PB-0-1</td></tr>
<tr><td colspan="3"></td><td><li>Type: RCCB</li><li>Maximum current: 0</li><li>Logical-ID Trigger Device: [meter100, evse100]</li>
</td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=phro100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Phase Rotation </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: phro100, Physical ID: PHR-0-1</td></tr>
<tr><td colspan="3"></td><td>Phases will be mapped from 123N -> 123N
</td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=limit100" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Limit </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: limit100, Physical ID: LIM-PL-1</td></tr>
<tr><td colspan="3"></td><td><li>Type: STATIC</li><li>Maximum Current: 16.0 A</li></td></tr>
<tr><td></td><th class="first_column"><a title="See real-time diagnosis of this device" href="/dev_diag.html?logical_id=limit200" ><img src="/html/icons/status_ok.png" title="OK" /></a></th>
<th class="second_column">Limit </th>
<th> </th></tr>
<tr><td colspan="3"></td><td>Logical ID: limit200, Physical ID: LIM-SL-1</td></tr>
<tr><td colspan="3"></td><td><li>Type: STATIC</li><li>Maximum Current: 16.0 A</li></td></tr>
</table>



Devices indented under an EVSE are used by this EVSE.

</div>


<div id="footer">
Page loaded at: 2020/03/24 18:13:55 UTC acc. to operating system's time; This page reloads every 40 seconds.
<br/>
Copyright 2018 ABL,
<a href="http://www.abl.de">http://www.abl.de</a>,
<a href="mailto:info@abl.de">info@abl.de</a>
</div>

</body>

</html>

   httpheader HTTP/1.1 200 OK
Content-type: text/html
Content-length: 11313
Connection: close
Charset: UTF-8
Date: Tue, 24 Mar 2020 18:13:56 GMT
   httpversion 1.0
   hu_blocking 0
   hu_filecount 24
   hu_port    8300
   hu_portSfx :8300
   ignoreredirects 1
   loglevel   4
   path       /sys_diag.html
   protocol   http
   redirects  0
   timeout    2
   url        http://192.168.99.17:8300/sys_diag.html
   value      0
   QUEUE:
   READINGS:
   REQUEST:
     data       
     header     
     ignoreredirects 0
     retryCount 0
     type       update
     url        http://192.168.99.17:8300/sys_diag.html
     value      0
   sslargs:
Attributes:
   enableControlSet 1
   enableCookies 1
   enforceGoodReadingNames 1
   handleRedirects 1
   room       AMAD
   showBody   1
   userattr   getHeader1 getHeader2 reading01Name reading01OExpr reading01Regex reading02Name reading02OExpr reading02Regex


Ich teste deinen Vorschlag direkt mal...

VG
Christian

Update:
Klappt wunderbar! YES!
Vielen Dank, Yersinia!
Ich versuche darüber das Thema besser zu verstehen...

Update 2:
Letzte Frage:
Ich hätte gerne noch aus:
<tr><td colspan="3"></td><td><li>State: A1 ( A1_UNPLUGGED )</li>
Das A1 in die Variable: Zustand
Als RegEx habe ich versucht: State: [\d\d]
Die Variable bleibt aber leer....ich schnalle es nicht.

Helft ihr mir nochmal weiter? Besten Dank!

FHEM 6.0 auf einem PI4 mit div. Homematic-Komponenten, Alexa, Tablet-UI und Homebridge...und läuft einfach. Erweitert mit CCU3 und Homematic-IP...und läuft immer noch.

FHEm2005

#717
Zitat von: frank am 27 März 2020, 12:14:28
vielleicht hilft das cookie attribut.

Ich habe bei HTTPMOD kein Attribut für Cookies gefunden  :(

Gruß Eberhard
Raspi3: FHEM, CULV3 (V1.61), EnOcean Pi 868, nanoCUL433, HUE-Bridge; Raspi4: Node-red, MQTT, Gaszähler auslesen mit ESP32-CAM, BSB-LAN

FHEm2005

Das attr hieß enableCookie. Ich hatte unter cookie gesucht.

GE
Raspi3: FHEM, CULV3 (V1.61), EnOcean Pi 868, nanoCUL433, HUE-Bridge; Raspi4: Node-red, MQTT, Gaszähler auslesen mit ESP32-CAM, BSB-LAN

FHEm2005

#719
Erledigt. Hatte mein Hirn auf Durchzug. Sorry.
Gruß Eberhard
Raspi3: FHEM, CULV3 (V1.61), EnOcean Pi 868, nanoCUL433, HUE-Bridge; Raspi4: Node-red, MQTT, Gaszähler auslesen mit ESP32-CAM, BSB-LAN