I am running OH3 on a RPi4.
I already use the html binding which is working well for json and RegEx. I was able to use a simple float RegEx with a page inside my local network. But that page contained just the float string, no additional html code or anything else.
This is the channel that works:
Type number : Channel_Vito_mittl_Ausgangstemp_Luft "Vito_mittl_Ausgangstemp_Luft" [ stateExtension="read?DP=0x16b1&Type=TempL", stateTransformation="REGEX:(^[-+]?[0-9]+\\.[0-9]+)" ]
So RegEx in general seems to work.
Also, my RPi can ping external sites and fetch json stuff from there so I assume network access ok too.
As soon as I try to fetch data from an html page using RegEx, it fails. Here is what I got:
html page source http://www.n-tv.de
<!doctype html> <html class="no-js" lang="de"> <head> <title>Nachrichten, aktuelle Schlagzeilen und Videos - n-tv.de</title> <base href="[https://www.n-tv.de/](view-source:https://www.n-tv.de/)"> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="author" content="n-tv NACHRICHTEN" />
...
Things file:
Thing http:url:ntv "ntv" [baseURL="https://www.n-tv.de", refresh="100", timeout="3000"] {
Channels:
Type string : Channel_ntv "ntv [%s]" [stateTransformation="REGEX:.*html*.>(.*)<title.*"]
}
Items file:
String ntv "ntv [%s]" <line> (gSomeGroup) [ "Measurement" ] {channel="http:url:ntv:Channel_ntv", expire="12h"}
For now I am just trying to fetch anything from the n-tv.de site, e.g. the string
<html class="no-js" lang="de"> <head>
I even tried “…RegEx:(.*)”] to get the whole html but that failed too. And yes, I tried to increase the buffer size to 100k
There are no errors in the log.
Any help is appreciated.