Lirc add custom actions

Hi,
i managed to get osmc remote controlled via an infrared remote with lirc, it works smooth, thanks for supporting that.

what i want to do now, is adding custom actions to some of the buttons of the used ir remote. i know this is possible with lirc by creating a lircrc config file, but i didn’t managed to get it done. the concrete usecase i want is something like: when KEY_1 then turn on light in livingroom. the routines for turning light off and on are already there, so invoking a shell command would be enough.

thanks a lot for your help

A lircrc file is what you want:

I have only tried this once before and I was able to get a script to run when I pressed a certain remote button but I remember the configuration syntax being quite cryptic and don’t remember exactly how I did it…

There’s two things that might be tripping you up if you have already tried this, one is that lirc runs as root, so putting a lircrc file under the osmc users home directory won’t do anything, so I recommend you save it at /etc/lirc/lircrc

The second is that only remote’s that are handled by lirc can use this feature - eg a remote that you have had to choose a lircd.conf profile in the remotes section. For any other remote that “just works”, including CEC they are not processed by lircd, so cannot make use of a lircrc.

thanks a lot for your answer. the second point is it most likely. i added the codes for my remote to lircd.conf in /etc/lirc/, but never changed something in osmc as it worked right away.

when i’m back at home i will try to:

  1. copy the config into a new named config file under /etc/lirc
  2. choose the new config in osmc
  3. try out some simple commands in lircrc