Transformation service JS for pattern Heizoel.js not found!

I get the following WARN every time my Http binding receives the webpage.

Transformation service  JS for pattern Heizoel.js not found!

The Transformation Service is installed and i have other bindings witch use it successfully

Here is my Thing Code

UID: http:url:1bf89b2603
label: Heizöl24
thingTypeUID: http:url
  authMode: BASIC
    - ""
  ignoreSSLErrors: false
  delay: 0
  stateMethod: POST
  refresh: 600
  commandMethod: GET
  contentType: text/plain
  timeout: 3000
  bufferSize: 2048
  - id: UnitPrice
    channelTypeUID: http:number
    label: Preis
    description: ""
      mode: READONLY
      stateContent: #other Contend
      unit: €/100l
      stateTransformation: JSONPATH:$.Items[0].UnitPrice ∩ JS:Heizoel.js

Here is the Heizoel script:

(function(i) {
  result = Math.round(i.replace('.',',')
  return (result);

The Jsonpath Transformation works for a String because it returns [123.456] in the JSONPath Online Evaluator and sets a String to 123.456 but not the Number Item so i have to Transform it a second time.

I have also tried it with REGEX there is the same Problem as stated above it dos not find the Transformation service.

Please help me

Greetings Markus

Just a guess:
Remove spaces surrounding .

1 Like

Yes, that is it Thanks
Also i cant have the unit: €/100l doesn’t work.
Also i have changed the Javascript

(function(i) {
  result = parseFloat(i)
  return (result);

Units Of Measurement | openHAB don’t include currencies - support for currencies would open a can of worms (currency conversions are dependent on location and time).

Dear Markus,

I tried to get your code working, but the http request returns no data. All I get is:

[WARN ] [p.internal.http.HttpResponseListener] - Requesting '' (method='POST', content='null') failed: 400 Bad Request

Do you have a tip?



I have deleted the stateContent of the Channel for Privacy reasons. Without that the Request dosent work/failed.

Here is my stateContent

stateContent: '{"ZipCode":"xxxxx","Amount":2000,"Stations":1,"Product":{"Id":1,"ClimateNeutral":false},"Parameters":[{"Key":"MaxDelivery","Id":5,"Modifier":-1,"Name":"maximal","ShortName":null,"DisplayName":"max.
        möglich (7-18
        Hänger","ShortName":"groß","DisplayName":"TKW mit

Here you must change xxxxx to your zip code.
If you want a different search inspekt the website with F12 while searching for prices.

Greetings Markus

Is this really necessary? The output of a transform is STRING anyway. If the only purpose of the JS transform is to convert it to float, it’s pointless because the transformer will convert the float back to string.

Thank you Markus, that did the trick!