HTTP Regex -

Hi,

just for sharing…
This worked for me:

Item:
Number Zuhause_Strom “Stromverbrauch” { http="<[http://IP/InstantView/request/getPowerProfile.html?n=1/:10000:REGEX(.([0-9]{1,6}).)]" }

Website:
http://IP/InstantView/request/getPowerProfile.html?n=1

Wirkleistung 1.25.0 201226013851w 201226013851w 1 1 false
203 

XML(this is what OH gets):

<?xml version="1.0" encoding="UTF-8"?>
<values xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/InstantView/request/powerProfile.xsd">
    <header>
            <name>Wirkleistung</name>
            <obis>1.25.0</obis>
            <startts>201226010829w</startts>
            <endts>201226010829w</endts>
            <samplerate>1</samplerate>
            <no>1</no>
            <error>false</error>
    </header>
    <v>325</v>
</values>

It seems \d+ or such is not working. I don’t know why.

Debugging with:
ssh to your OH-machine -> “ssh -p 8101 openhab@localhost”
Password: -> RTFM
“log:set info org.openhab.binding.http”
“log:tail”

Have Fun!
Stay healthy.