Guide to add your own remote

From OpenELEC
Jump to: navigation, search
20px   OpenELEC Configuration Guide to add your own remote

This guide will show you howto add your own remote using ir-keytable.

Firstly login to your OpenELEC machine via SSH and install the nano text editor

First stop relevant services for OpenELEC 5.95.x and up

systemctl stop eventlircd.service
systemctl stop kodi.service

For general info on LIRC, visit

If you want to use this explanation/guide you need to know where the files can be found or to be placed in OpenElec: & lircd.conf in the share "/storage/configfiles/"
Lircmap.xml in "/storage/userdata/"
remote.xml in "/storage/userdata/keymaps/"

When using the 3 mentioned files you need to adjust the contents of (use Notepad++ i.e. when editing Windows) and place this file in storage/configfiles:

killall lircd
ir-keytable -p lirc
lircd --device=/dev/lirc0 /storage/.config/lircd.conf

It takes time to create the lircd.conf and Lircmap.xml. But after that.... the only thing you need is to define all the commands to be executed in remote.xml, which is the goal of all the efforts.

Available Kodi commands on this link, chapter 5.1 (for use in remote.xml).

Available code-names for recording "irrecord -list namespace".

Create a ir keytable:

First you need to run this commands:

killall eventlircd
killall lircd
ir-keytable -p NEC,RC-5,RC-6,JVC,SONY,LIRC,OTHER
ir-keytable -c
ir-keytable -t

You can now create a ir-keytable that fits your remote control.

The hexadecimal scancode needs to to be assigned to a function of the key. scancode = 3d will become 0x003d, scancode = 01 becomes 0x0001 etc.

start pushing buttons and create a list with all buttons you need and there corresponding function. you can have a look at /etc/rc_keymaps/rc6_mce for reference. Remember that you need to use the new KEY_ map names for it to work, like KEY_POWER and so on.

This is a manual job so have a notepad or whatever open an paste in the button code there and add actions like this:

# table my_remote, type: remote_type
0x800f0400 KEY_NUMERIC_0
0x800f0401 KEY_NUMERIC_1
0x800f0402 KEY_NUMERIC_2
0x800f0403 KEY_NUMERIC_3
0x800f0404 KEY_NUMERIC_4
0x800f0405 KEY_NUMERIC_5
0x800f0406 KEY_NUMERIC_6
0x800f0407 KEY_NUMERIC_7
0x800f0408 KEY_NUMERIC_8
0x800f0409 KEY_NUMERIC_9
0x800f040a KEY_DELETE
0x800f040b KEY_ENTER
0x800f040c KEY_POWER
0x800f040d KEY_PROG1
0x800f040e KEY_MUTE
0x800f040f KEY_INFO

Now save your file in the Configfiles share with some name, my_remote for example

Now run the following command from a ssh promt:

ir-keytable -c -p NEC,RC-5,RC-6,JVC,SONY,LIRC,OTHER -w /storage/.config/my_remote

Or create a script and reboot.

Create a script to load the map on boot

Edit the script or add it if it doesn't exist yet in the Configfiles share when connecting via Samba to your OpenELEC box,

or use SSH and run the editor nano (oldskool people might prefer vi) for editing the script

nano /storage/.config/

Add the following line to it:

ir-keytable -c -p NEC,RC-5,RC-6,JVC,SONY,LIRC,OTHER -w /storage/.config/my_remote

Reboot and that should be it. :)

Reference more keytables