[SOLVED] Http Binding Regex help

Hi to everyone!

I need your help…

I am trying to load on a sitemap a temperature value from a page

The page contains ONLY the temperature

temp

my code till now it this and nothing is working…anyone can help me out?

the link for the page which i want to read the value is

http://192.168.2.20/openhab.html

Thanks!

My code

SITEMAP

     Frame label="HTTP Binding" {
	Text item=HTTPstring icon="temperature"

}

ITEMS

Number HTTPstring “HTTP [%.2f °C]” { http="<[http://192.168.2.20/openhab.html:1000:REGEX((.*))" }

Error from the logs

2018-12-26 01:25:46.285 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type ‘http’ of item ‘HTTPstring’ could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: bindingConfig ‘<[http://192.168.2.20/openhab.html:1000:REGEX((.*))’ doesn’t contain a valid binding configuration
at org.openhab.core.binding.internal.BindingConfigReaderDelegate.processBindingConfiguration(BindingConfigReaderDelegate.java:51) ~[?:?]

SOLVED

Solution from vzorglub

Number HTTPstring "HTTP [%.2f °C]" { http="<[http://192.168.2.20/openhab.html:1000:REGEX((.*?))]" }

Couple of questions

  • Is the HTTP binding installed?
  • Is the REGEX transformation installed?

Hi vzorglub, yes both are installed via paper gui

HTTP Binding

Regex

is my syntax of the command right?

Try that:

Number HTTPstring "HTTP [%.2f °C]" { http="<[http://192.168.2.20/openhab.html:1000:REGEX((.*?))" }

I tried it and after some tries i found that if i remove the HTTP:// and replace the HTTP from the begin to HTTP1 with lowercase i dont get any error but still the value in the sitemap does not update!

Number HTTPstring "HTTP [%.2f °C]" { **http**="<[http://192.168.2.20/openhab.html:1000:REGEX((.*?))" }

Without error

Number HTTPstring "HTTP [%.2f °C]" { http1="<[192.168.2.20/openhab.html:1000:REGEX((.*?))" }

Duh!!
We both are dummies…
You are missing a ] at the end of your binding string:

Number HTTPstring "HTTP [%.2f °C]" { http="<[http://192.168.2.20/openhab.html:1000:REGEX((.*?))]" }
1 Like

Man i love you! :stuck_out_tongue:

I feel stupid now cause i didn’t notice it…!!! :stuck_out_tongue:

Thanks a lot and have a nice day my friend!

Solution from vzorglub

Number HTTPstring "HTTP [%.2f °C]" { http="<[http://192.168.2.20/openhab.html:1000:REGEX((.*?))]" }