Hello,
i have a HTTP Binding Problem an i need help please :
i have a web based IP Thermometer and i want to use the Themperatur which is displayed be the Web IP Thermometer in the openhab. The HTTP respone from my web based thermometer looks like
Sensors | |||
---|---|---|---|
State | Name | Type | Current Value |
|
aussen |
Temp. |
5.1 °C |
|
innen |
Temp. |
24.8 °C |
I designed the regex: for inside (.*?s216">)(-?\d{1,3}.\d{1}) which returned the following two strings. Testsed it with the site http://regexstorm.net/tester
index 0
position 855
$ 1
$ 2 24.8
so far so good
openhab.cfg i added HTTP Bindings
http:IPThermo.url=http://192.168.19.24
http:IPThermo.updateInterval=1000
demo.items i added
Number ThermoInnen “ThermoInnen [%.1f °C]” {http="<[IPThermometer:1000:REGEX(.*?s215">)(-?\d{1,3}.\d{1})]"}
demo.sitemap i added
Number item=ThermoInnen “ThermoInnen [%d C]” icon=“temperature-max”
.items file i added
Number ThermoInnen “ThermoInnen [%.1f °C]” {http="<[IPThermometer:1000:REGEX(.*?s215">)(-?\d{1,3}.\d{1})]"}
But the digits 24.8 are not displayed!
Nnow my questions
- Question
how can i get the $ 2 24.8 wich is returned bei the regex, and how can i display the digists
2.question
plaese say me how i can extract the digits 24.8 from my web based thermometer an how can i display the digits. i am open for other ways, because my way is not running
Thank you verrrrrrrrrrrrrrrrrrrrrrrrrry mutch
Klaus