Combining JS and JSON in MQTT incoming transformation


I am trying to get a JSON and Javascript incoming transformation to run.
If I get the mqtt message 1 on the topic i expect to get 0.2 in the item.
The result now is that I get 1 on the item after receiving the message and the error message:

2020-07-05 20:25:20.257 [WARN ] [t.generic.ChannelStateTransformation] - Transformation service  JS for pattern counter_precipitation.js not found!

I have both transformations installed.
It was working before but I did some modifications and I can’t figure out how to get it to run again.

  • Platform information:
    • Hardware: _CPUArchitecture/RAM/storage_RPi4 4GB
    • openHAB version:

example mqtt message



		Type number : raingauge                     "Niederschlagmesser"		 		  [stateTopic="C-BoilerRoom/tele/SENSOR", transformationPattern="JSONPATH:$.COUNTER.C1∩JS:counter_precipitation.js"]


Number:Length          		  OU_Garden_Rain_Gauge            		 "Niederschlag total [%.1f mm]"	           								   <rain>                           (OU_Garden, Weather)                                                                         {channel="mqtt:topic:mosquitto:cboilerroom:raingauge"}


(function(i) {
	if (isNaN(i)) {
		return (i);
	return(i * 0.2);
}) (input)

JS javascript transformation service needs to be installed

You mean this one?
Already had this installed

I got it solved!
There was something wrong with the transformation service. It was showing that it was installed but not working.
I uninstalled it. Did a reboot and reinstalled it. Now its working. Thanks!