Hi all,
this is probably a noob error, but I have a problem getting a transformation to work.I migrated from 1.8.3. to OH2b3.
I’m reading data from a web service (volkszaehler.org middleware, which stores meter data). The webserver delivers data in XML form and there is a rule on how to read data from it.
However, OH2 complains that the requested XSLT transformation is not available. Using a different form, I can also get the data in JSON, but the OH2 runtime also complains about that one.
The error message is always the same:
2016-06-26 22:31:21.162 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type XSLT
2016-06-26 22:31:21.162 [WARN ] [ab.binding.http.internal.HttpBinding] - couldn’t transform response because transformationService of type ‘XSLT’ is unavailable
Here’s the item definition:
Number Haushaltsstrom_Verbrauch “Haushaltsstrom [%.1f W]” (Strom,Stromverbrauch) {http=“<[http://192.168.xxx.xxx/middleware.php/data/1d20a940-b45e-11e4-ad68-xxx.xml?from=-1Minute&to=+1Minute:60000:XSLT(volkszaehler_avg.xsl)]”}
And the transform rule volkszaehler_avg.xsl, which lives in /etc/openhab2/transform/volkszaehler_avg.xsl also exists.
Using the JSON form, the error stays the same:
20 16-06-30 12:50:43.726 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPATH
2016-06-30 12:50:43.726 [WARN ] [ab.binding.http.internal.HttpBinding] - couldn’t transform response because transformationService of type ‘JSONPATH’ is unavailable
item:
Number Haushaltsstrom_Verbrauch “Haushaltsstrom [%.1f W]” (Strom,Stromverbrauch) {http=“<[haushaltsstrom:30000:JSONPATH($.data.average)]”}
The url ist defined in http.cfg:
haushaltsstrom.url=http://192.168.xxx.xxx/middleware.php/data/1d20a940-b45e-11e4-ad68-xxx.json?average
haushaltsstrom.updateInterval=30000
The Web service output for the JSON variant is something like this:
{“version”:“0.3”,“data”:{“uuid”:“1d20a940-b45e-11e4-ad68-xxx”,“from”:1467233208920,“to”:1467319978716,“min”:[1467270840269,439.86855390537],“max”:[1467308160611,4479.6995527236],“average”:795.636,“consumption”:19177,“rows”:543,“tuples”:…
So it’s the average 795.636 that i’m after.
Any ideas? Do I need to enable some transforms before using them?