I am pretty sure your problem is that the MQTT client sends the unit (%RH) as well and not just a number. This prevents openhab from using the default setup of transformations to conver the MQTT message to a float value (for your Number item).
You should be able to strip away the unit part (%RH) of the message from the MQTT client by using a transformation/regex expression in the item definition so that openhab can concentrate on converting the actual value.
Sadly I cannot tell you in detail how to configure said transformation/regex,
One thing I always do when I hit MQTT problems is to fire up MyMQTT on my android phone and subscribe to what you are hoping to see in OH.
That way you get to see what is happening and if you have the correct topic addressing etc.
I’ve a sneaky feeling that the leading “/” shouldnt be there but I might be wrong
Thank you!
But there is something wrong. Even I write in the transform/numonly.js as below:
(function(rh) {
return 0.3
})(input);
The result is same with above.
Is anything wrong with my openhab.cfg?
mqtt:rpibroker.url=tcp://i.thu-skyworks.org:1883