HM-OU-LED16 state does not work

I’m currently migrating my OH1.x installation to OH2.0 (snapshot). Almost everything is working pretty good right now. The one issue I’m facing is the Homematic LED display.

it used to work with the following command in OH1.x

LED_12.sendCommand (3)

where 0 to 3 where the different colors.

In OH2 this gives the following error message:

2016-12-14 10:51:09.092 [ERROR] [ematic.handler.HomematicThingHandler] - org.eclipse.smarthome.core.library.types.DecimalType cannot be cast to org.eclipse.smarthome.core.library.types.StringType
java.lang.ClassCastException: org.eclipse.smarthome.core.library.types.DecimalType cannot be cast to org.eclipse.smarthome.core.library.types.StringType
        at org.openhab.binding.homematic.converter.type.StringTypeConverter.toBinding(StringTypeConverter.java:1)[179:org.openhab.binding.homematic:2.0.0.201612120809]
        at org.openhab.binding.homematic.converter.type.AbstractTypeConverter.convertToBinding(AbstractTypeConverter.java:100)[179:org.openhab.binding.homematic:2.0.0.201612120809]
        at org.openhab.binding.homematic.handler.HomematicThingHandler.handleCommand(HomematicThingHandler.java:173)[179:org.openhab.binding.homematic:2.0.0.201612120809]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$3.call(ThingManager.java:367)[103:org.eclipse.smarthome.core.thing:0.9.0.201612091054]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$3.call(ThingManager.java:1)[103:org.eclipse.smarthome.core.thing:0.9.0.201612091054]
        at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:179)[96:org.eclipse.smarthome.core:0.9.0.201612091054]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]

Do I have to state the color in a different way in OH2?

Thanks in advance
Chris

in case this is of any relevance: I’m using Homegear as the gateway device.

The datapoint for the state is an Options value. OH2 was somewhat more lenient in conversion, but OH2 strictly converts Option values to Strings. So try “OFF”, “GREEN”, “ORANGE” or “RED”

This doesn’t work either. The error message is different, but an error nonetheless.

2016-12-14 17:28:37.014 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (DEFAULT.2016-12-14T17:28:36.944+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {
  sendCommand(<XFeatureCallImplCustom>,<XStringLiteralImpl>)
} ] threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IllegalArgumentException: The argument 'command' must not be null or empty.]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)[102:org.eclipse.smarthome.core.scheduler:0.9.0.201612091054]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[102:org.eclipse.smarthome.core.scheduler:0.9.0.201612091054]
Caused by: java.lang.IllegalArgumentException: The argument 'command' must not be null or empty.
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
        at org.eclipse.smarthome.core.items.events.ItemEventFactory.assertValidArguments(ItemEventFactory.java:345)
        at org.eclipse.smarthome.core.items.events.ItemEventFactory.createCommandEvent(ItemEventFactory.java:186)
        at org.eclipse.smarthome.core.items.events.ItemEventFactory.createCommandEvent(ItemEventFactory.java:204)
        at org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(BusEvent.java:80)
        at org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(BusEvent.java:47)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_101]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_101]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_101]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:1085)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:1060)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._invokeFeature(XbaseInterpreter.java:1046)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeFeature(XbaseInterpreter.java:991)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:114)[127:org.eclipse.smarthome.model.script:0.9.0.201612091054]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:901)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:864)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:223)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:446)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:227)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:189)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.ClosureInvocationHandler.doInvoke(ClosureInvocationHandler.java:46)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at org.eclipse.xtext.xbase.interpreter.impl.AbstractClosureInvocationHandler.invoke(AbstractClosureInvocationHandler.java:29)[143:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
        at com.sun.proxy.$Proxy126.apply(Unknown Source)[:]
        at org.eclipse.smarthome.model.script.internal.actions.TimerExecutionJob.execute(TimerExecutionJob.java:38)[127:org.eclipse.smarthome.model.script:0.9.0.201612091054]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[102:org.eclipse.smarthome.core.scheduler:0.9.0.201612091054]
        ... 1 more

I tried both

LED_01.sendCommand("GREEN")

and

sendCommand(LED_01,"GREEN")

The solution to my other problem with the HM-Sec-Tis made me look into this again.

I had the LEDs configured as Number Items, because of the 0, 1, 2 and 3 values. SInce I now have to use “GREEN”, “RED”, … I have to use STRING as the type for the item and then it works :slight_smile:

Problem solved