HTTP Binding Cache does not work

I am using the http binding to get the values from my local weather station. I want to use the cache to prevent OpenHab from downloading same page for each value.

When I use a configuration like

Number WeObsAbsPress "Relativer Luftdruck" <pressure> { http="<[http://192.168.1.30/livedata.htm:5000:REGEX(.*?AbsPress.*?value=\"([0-9]*.[0-9]*)\".*)]" }

it works but when I change it to the cached version

Number WeObsInTemp "Temperatur innen" <temperature> { http="<[WeatherObserverCache:5001:REGEX(.*?inTemp.*?value=\"([0-9]*.[0-9]*)\".*)]" }

with cache configured

WeatherObserverCache.url=http://192.168.1.30/livedata.htm

I got the error:

2017-06-11 15:17:12.606 [ERROR] [ab.binding.http.internal.HttpBinding] - given config key 'format' does not follow the expected pattern '<id>.<url|updateInterval>'
2017-06-11 15:17:12.607 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=337, bundle=193/mvn:org.openhab.binding/org.openhab.binding.http/1.10.0-SNAPSHOT]: Unexpected problem updating configuration org.openhab.http
java.lang.NumberFormatException: For input string: "5000.0"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)[:1.8.0_121]
	at java.lang.Integer.parseInt(Integer.java:580)[:1.8.0_121]
	at java.lang.Integer.valueOf(Integer.java:766)[:1.8.0_121]
	at org.openhab.binding.http.internal.HttpBinding.updated(HttpBinding.java:461)[193:org.openhab.binding.http:1.10.0.201706081420]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

even as the format is not explicitly configured in conf/services/http.cfg nor in userdata/config/org/openhab/http.cfg (I have removed that file)

After removing the old configuration via the openhab console only these configuration is left:

openhab> config:list "(service.pid=org.openhab.http)"
----------------------------------------------------------------
Pid:            org.openhab.http
BundleLocation: mvn:org.openhab.binding/org.openhab.binding.http/1.10.0-SNAPSHOT
Properties:
   WeatherObserverCache.url = http://192.168.1.30/livedata.htm
   service.pid = org.openhab.http

but now I got the error

2017-06-11 16:10:11.710 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'REGEX' is unavailable

Is the Regex transformation not available in combination with the http cache?

Seems as the transformation error was only a temporary error, got no new errors since yesterday

hey @ohmicha
I got the same weather station.
could you post all your config and items for this?
would be a great time saver. :slight_smile:

german is perfect :wink: danke

I will post it when I return to the office with the weather station at the beginning of February

I am using ambient weather observerIP 4.1.4 firmware

Number WeObsInTemp "Temperatur innen [%.1f °C]" <temperature> { http="<[WeatherObserverCache:5000:REGEX(.*?inTemp.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsInHumi "Feuchtigkeit innen [%d %%]" <humidity> { http="<[WeatherObserverCache:5000:REGEX(.*?inHumi.*?value=\"([0-9]*)\".*)]" }
Number WeObsAbsPress "Relativer Luftdruck [%.2f mb]" <pressure> { http="<[WeatherObserverCache:5000:REGEX(.*?AbsPress.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsRelPress "Absoluter Luftdruck [%.2f mb]" <pressure> { http="<[WeatherObserverCache:5000:REGEX(.*?RelPress.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsOutTemp "Temperatur draußen [%.1f °C]" <temperature> { http="<[WeatherObserverCache:5000:REGEX(.*?outTemp.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsOutHumi "Feuchtigkeit draußen [%d %%]" <humidity> { http="<[WeatherObserverCache:5000:REGEX(.*?outHumi.*?value=\"([0-9]*)\".*)]" }
Number WeObsWinDir "Windrichtung [%d]" { http="<[WeatherObserverCache:5000:REGEX(.*?windir.*?value=\"([0-9]*)\".*)]" }
Number WeObsAvgWind "Windgeschwindigkeit [%.1f]" { http="<[WeatherObserverCache:5000:REGEX(.*?avgwind.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsGutSpeed "Windböen [%.1f]" { http="<[WeatherObserverCache:5000:REGEX(.*?gustspeed.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsDailyGust "Max. tgl. Windböen [%.1f]" { http="<[WeatherObserverCache:5000:REGEX(.*?dailygust.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsSolarRad "Sonneneinstrahlung [%.2f]" { http="<[WeatherObserverCache:5000:REGEX(.*?solarrad.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsUv "UV [%d]" { http="<[WeatherObserverCache:5000:REGEX(.*?uv.*?value=\"([0-9]*)\".*)]" }
Number WeObsUvI "UV Index [%d]" { http="<[WeatherObserverCache:5000:REGEX(.*?uvi.*?value=\"([0-9]*)\".*)]" }
Number WeObsRainOfHourly "Stdl. Regenmenge [%.2f mm]" { http="<[WeatherObserverCache:5000:REGEX(.*?rainofhourly.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsRainOfDaily "Tgl. Regenmenge [%.2f mm]" { http="<[WeatherObserverCache:5000:REGEX(.*?rainofdaily.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsRainOfWeekly "Wöchtl. Regenmenge [%.2f mm]" { http="<[WeatherObserverCache:5000:REGEX(.*?rainofweekly.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsRainOfMonthly "Montatl. Regenmenge [%.2f mm]" { http="<[WeatherObserverCache:5000:REGEX(.*?rainofmonthly.*?value=\"([0-9]*.[0-9]*)\".*)]" }
Number WeObsRainOfYearly "Jährl. Regenmenge [%.2f mm]" { http="<[WeatherObserverCache:5000:REGEX(.*?rainofyearly.*?value=\"([0-9]*.[0-9]*)\".*)]" }