MQTT Light level Item issue

Hey all, I’ve been scratching my head over this for a few days and I can’t seem to get my item definition quite right.
I built an arduino MQTT device to place outside and retrieve info from a few sensors, Every 2 minutes it sends out a status update for each sensor. I get Temperature Humidity Pressure and Altitude from a BME280 sensor and light level from a simple photocell.

The problem I’m having is when I receive an update from the light level sensor, If the value is less than 10 OH seems to think that the value is NULL, otherwise it works fine. I don’t understand whats going on here.

I’m running OpenHABian on a RPI2 OpenHAB v 2.1.0-1

My Item looks like:

Number sprinklerLightLevel "Light Level [%.1f %%]" (sprinkler) {mqtt="<[myBroker:STATUS/SPRINKLER/LIGHTLEVEL:state:default]"}

the error i get is:
2017-09-06 16:05:53.399 [WARN ] [] - given new state is NULL, couldn’t post update for ‘sprinklerLightLevel’

I’m going to guess when the number is less than 10 there ends up being a whitespace before or after the actual digit. Try a JS transform to trim off the white space.

OK I tried this:

Number sprinklerLightLevel "Light Level [%.1f]" <temperature> (sprinkler) {mqtt="<[myBroker:STATUS/SPRINKLER/LIGHTLEVEL:state:JS(number.js)]"}

But now I’m getting this error:

2017-09-06 17:27:52.274 [ERROR] [.mqtt.internal.MqttMessageSubscriber] - Error processing MQTT message.
org.openhab.core.transform.TransformationException: An error occurred while loading script.
	at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform([183:org.openhab.core.compat1x:2.1.0]
	at org.openhab.binding.mqtt.internal.MqttMessageSubscriber.processMessage([182:org.openhab.binding.mqtt:1.10.0]
	at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage([]
	at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage([]

I have also installed the javascript transformation, via paperui > addons > transformation.
I’m unsure if that is the only step, but there were no instruction on how to install it in the manual.

OH I Figured it out, so sorry if you’ve wasted any time helping me.
I simply forgot to create transform file number.js in the tranform directory
here’s the code in case anyone else misses that bit:

result = input.trim();

TYSM for your help though