Item JS transform error

I am reading the UPS statistics using OH2, but the temp is in Fahrenheit

I have tried the following, but this fails for the Celcius transform…

Number UpsBatteryTemp    "Temperature [%.1f ℉]" 	{ networkupstools="ups1:battery.temperature" }
Number UpsBatteryTempC   "JS(toCelcius.js):%.1f ℃]"	{ networkupstools="ups1:battery.temperature" }

Should I be able to invoke the transform for the item directly ?

Hi Steve.
Looks like you are missing a few things

Try:

Number UpsBatteryTemp    "Temperature [%.1f ℉]" 	{ networkupstools="ups1:battery.temperature" }
Number UpsBatteryTempC   "Temperature [JS(toCelcius.js):%.1f ℃]"	{ networkupstools="ups1:battery.temperature" }

Thanks, I spotted the typo just, however the JS call causes a NULL pointer error.

The function is very simple to test

// Wrap everything in a function
(function(i) {
    return '123.45';
})(input)
// input variable contains data passed by openhab

The log has

18:24:45.987 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /basicui/app
java.lang.NullPointerException
at org.eclipse.smarthome.transform.javascript.internal.JavaScriptTransformationService.transform(JavaScriptTransformationService.java:70)[191:org.eclipse.smarthome.transform.javascript:0.9.0.201612221226]
at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.transform(ItemUIRegistryImpl.java:410)[134:org.eclipse.smarthome.ui:0.9.0.201612221226]
at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.getLabel(ItemUIRegistryImpl.java:337)[134:org.eclipse.smarthome.ui:0.9.0.201612221226]

I have a workaround using rules, but would like to understand why the item transform does not work.

Items

Number UpsBatteryTemp  "Temperature [%.1f ℃]" { networkupstools="ups1:battery.temperature" }
Number UpsBatteryTempF "Temperature [%.1f ℉]"

My workaround rule

// ----------------------------------------------------------------------------------------------------------------
// UPS Monitor
// ----------------------------------------------------------------------------------------------------------------
rule UPSBatteryTemperatures
when Item UpsBatteryTemp changed
then
    var c=UpsBatteryTemp.state as DecimalType
    var f=(c * 1.8 + 32)
    logInfo("Test", "DEBUG --- UPSBattryTemp changed to "+ UpsBatteryTemp.state.toString() + ". Updating UpsBatteryTempF to: " + f)
	UpsBatteryTempF.postUpdate(f)
end

Just faced the similar issue.
That was the plan:

Number Ups_Runtime "UPS Runtime [JS(sec2min.js):%d Min]"

but it seems that Min is considered as a part of formatting template and not a free text.

The following does not work as well:

Number Ups_Runtime "UPS Runtime [JS(sec2min.js):%d] Min"

Any solution besides using proxy item?