Issue receiving IR commands via lirc


I am stuck trying to receive IR commands via lirc binding and reacting on it in rules.
I’m running OH2 v2.3.0-snapshot (#1227) on raspberry pi 3 with a TSOP4838 IR receiver attached.
Lirc itself seems to work, at least I can see commands coming in when running $ mode2 -d /dev/lirc0
In PaperUI I installed the lirc binding and when searching for new things, the remote (in my case a Panasonic_TV) get’s listed and is shown as ONLINE.

Based on the oh2 doc I tried to create a simple rule for testing, but when pressing “KEY_VOLUMEUP” I don’t get the expected Info in /var/log/openhab2/openhab2.log…

rule “LIRC test”
Channel ‘lirc:remote:bd5cc655:PANASONIC_TV:event’ triggered KEY_VOLUMEUP
logInfo(“lirc”, “LIRC Test triggered KEY_VOLUMEUP”)

From what I read I cannot create an item for this but should be able to use the Channel directly in my rules file.
Any suggestions how I can further debug this issue?

Many Thanks

Are you seeing any events in events.log when you press the button?

No, there are no events created.
Any ideas how I could track the issue?

Does the Lirc binding support channel events? It will talk about them in the binding readme. Not all bindings support them.

Not quite sure, but in the binding readme ( the blow rule is reference, so I’d say yes, the binding supports channel events.?!

rule “LIRC Test”
Channel ‘lirc:remote:local:Samsung:event’ triggered KEY_DVD
// Toggle base boost on the AV Receiver
sendCommand(Remote_AVReceiver, “KEY_BASEBOOST”)
// Increase the volume by 5.
sendCommand(Remote_AVReceiver, “KEY_VOLUMEUP 5”)

Then at this point there is either something wrong with your Thing definition, binding configuration, or they device that is sending the event. I don’t know this binding so won’t be if much more help.

I’ve got it working :slight_smile:
The issue was not with openhab2 but with a proper setting of lircd.

In case someone comes across a similar issue, I’d like to summarize, what I’ve done on my rpi3:

  1. hardwire IR sensor and install lirc according to [1]
  2. low-level test
    $ mode2 -d /dev/lirc0
    –> when pressing buttons on the rc, you should see some codes
  3. setup configuration lirc_options.conf
    listen = :9001
    device = /dev/lirc0
    driver = default
  4. install lirc binding in oh2
    –> if lircd is running properly you should see the LIRC server in oh2 as online
  5. Make sure you have a suitable .lircd.conf in /etc/lirc/lircd.conf.d/
    –> you can test this by running $ irw
    –> pressing buttons on the remote should result in a sensible message
  6. When searching for new thing in oh2, the should get listed
    –> pressing buttons on the remote should result in events within oh2 (see e.g. /var/log/openhab2/event.log)

Good luck