this is openHab2.2 and I’m trying to control an LED strip with IR remote from a raspberry pi. Everything works as intended from the command line, both on the raspi with the IR transmitter installed or from some other machine in the network when I tested it with nc.
I installed the LIRC binding via the paper UI, there is a thing LIRC SERVER with Location, Hostname, Port set correctly. There is another related thing, named IR_i24 with 2 chanels, Button Event and Transmit Command, the latter detailed as lirc:remote:f642d87f:i24:transmit and String. The remote name i24 was correctly autodiscovered by the Binding.
Next, I open the Editor and create an .items file with
String i24Transmit {channel="lirc:remote:f642d87f:i24:transmit"}
And I have a rule:
rule "rule triggered by LedColor received command "
when
Item LedColor received command
then
if (receivedCommand==ON) {
logInfo("IR-Led", "LedColor received command ON")
sendCommand("i24Transmit","KEY_POWER")
}
if (receivedCommand==OFF) {
logInfo("IR-Led", "LedColor received command OFF")
sendCommand("i24Transmit","KEY_Exit")
}
end
The problems start when I click that item, from the openhab.log:
2018-02-07 15:09:37.984 [INFO ] [clipse.smarthome.model.script.IR-Led] - LedColor received command ON
2018-02-07 15:09:38.000 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.eclipse.smarthome.binding.lirc.handler.LIRCRemoteHandler@1e6a30b': null
java.lang.NullPointerException: null
at org.eclipse.smarthome.binding.lirc.internal.connector.LIRCConnector.sendCommand(LIRCConnector.java:145) [259:org.eclipse.smarthome.binding.lirc:0.10.0.b1]
at org.eclipse.smarthome.binding.lirc.internal.connector.LIRCConnector.transmit(LIRCConnector.java:141) [259:org.eclipse.smarthome.binding.lirc:0.10.0.b1]
at org.eclipse.smarthome.binding.lirc.internal.connector.LIRCConnector.transmit(LIRCConnector.java:124) [259:org.eclipse.smarthome.binding.lirc:0.10.0.b1]
at org.eclipse.smarthome.binding.lirc.handler.LIRCBridgeHandler.transmit(LIRCBridgeHandler.java:171) [259:org.eclipse.smarthome.binding.lirc:0.10.0.b1]
at org.eclipse.smarthome.binding.lirc.handler.LIRCRemoteHandler.handleCommand(LIRCRemoteHandler.java:65) [259:org.eclipse.smarthome.binding.lirc:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor297.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [109:org.eclipse.smarthome.core:0.10.0.b1]
at com.sun.proxy.$Proxy170.handleCommand(Unknown Source) [259:org.eclipse.smarthome.binding.lirc:0.10.0.b1]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
I read some related threads here including https://community.openhab.org/t/problems-with-implementing-lirc-to-control-ir-devices/38123 , created new things in config files following the example in the Binding’s short docu and got no further.
I let the openhab-cli console list me all links and I see
i24Transmit -> lirc:remote:f642d87f:i24:transmit
lirc_remote_f642d87f_i24_event -> lirc:remote:f642d87f:i24:event
lirc_remote_f642d87f_i24_transmit -> lirc:remote:f642d87f:i24:transmit
so it looks like the system already created items for both channels. If I sendCommand to the auto-created items I get the very same exception, though.
Checking from the console I see the key has been written ino the item before the crash occurs:
lirc_remote_f642d87f_i24_transmit (Type=StringItem, State=KEY_Exit, Label=Transmit Command, Category=null)
Clearly missing something basic here but I’m out of ideas.
Thanks in advance for all pointers or detailling questions!
Daniel