rossko57
(Rossko57)
May 7, 2021, 10:23am
4
Apparently it is only used for outbound commands in this binding at present.
opened 09:25AM - 03 Jan 20 UTC
closed 09:05AM - 09 Jan 22 UTC
bug
When trying to add a channel to an Item with Unit of measurement, like for examp… le Number:Temperature, MQTT Binding isn't able to process this item and throws an exception:
2020-01-03 10:17:25.033 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler@172b164': null
java.lang.NumberFormatException: null
at java.math.BigDecimal.<init>(BigDecimal.java:494) ~[?:1.8.0_65]
at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_65]
at java.math.BigDecimal.<init>(BigDecimal.java:806) ~[?:1.8.0_65]
at org.openhab.binding.mqtt.generic.values.NumberValue.update(NumberValue.java:91) ~[?:?]
at org.openhab.binding.mqtt.generic.ChannelState.publishValue(ChannelState.java:333) ~[?:?]
at org.openhab.binding.mqtt.generic.AbstractMQTTThingHandler.handleCommand(AbstractMQTTThingHandler.java:128) ~[?:?]
at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
at com.sun.proxy.$Proxy29896.handleCommand(Unknown Source) [?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemFollowProfile.onStateUpdateFromItem(SystemFollowProfile.java:60) [bundleFile:?]
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_65]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]
If you either chain on another transformation in channel stateTransformation
, or apply a profile to the link to Item, that adds text " kWh" you should be able to properly update a quantity type Item.