openhab-addons/bundles/org.openhab.binding.lirc
Wouter Born d6476042ec
Update license headers to 2025 (#18015)
* Update license headers to 2025

Signed-off-by: Wouter Born <github@maindrain.net>
2025-01-02 00:30:12 +01:00
..
src/main Update license headers to 2025 (#18015) 2025-01-02 00:30:12 +01:00
NOTICE added migrated 2.x add-ons 2020-09-21 03:37:19 +02:00
pom.xml Prepare for OH 5.0.0 (#17906) 2024-12-15 20:30:05 +01:00
README.md [Documentation] Markdown improvements f to m (#13866) 2022-12-08 21:36:05 +01:00

LIRC Binding

This binding integrates infrared transceivers through LIRC or WinLIRC.

A list of remote configuration files for LIRC is available here.

Supported Things

This binding supports LIRC and WinLIRC as bridges for accessing the configured remotes.

LIRC must be started with TCP enabled. On systemd based systems, TCP can be enabled by editing the file /usr/lib/systemd/system/lirc.service and adding --listen to the end of the ExecStart line. An example systemd service file for LIRC is shown below.

[Unit]
Description=Linux Infrared Remote Control
After=network.target

[Service]
RuntimeDirectory=lirc
ExecStart=/usr/sbin/lircd --nodaemon --driver=default --device=/dev/lirc0 --listen

[Install]
WantedBy=multi-user.target

By default, LIRC will listen on IP address 0.0.0.0 (any available IP address) and port 8765. If you would rather run LIRC on a specific port or IP address, you can use --listen=192.168.1.100:9001 instead.

Discovery

Discovery of the LIRC bridge is not supported. However, remotes will be automatically discovered once a bridge is configured.

Example Configuration

Things

Bridge lirc:bridge:local [ host="192.168.1.120", portNumber="9001" ] {
    Thing remote Onkyo_RC_799M [ remote="Onkyo_RC-799M" ]
    Thing remote Samsung [ remote="Samsung" ]
}

Bridge:

  • host: IP address or hostname of the LIRC server. Defaults to localhost
  • port: The port number the LIRC server is listening on. Defaults to 8765

Remote:

  • remote: The name of the remote as known by LIRC

Items

String Remote_AVReceiver { channel="lirc:remote:local:Onkyo_RC_799M:transmit" }
String Remote_TV { channel="lirc:remote:local:Samsung:transmit" }

Rules

rule "LIRC Test"
when
    Channel 'lirc:remote:local:Samsung:event' triggered KEY_DVD
then
    // Toggle base boost on the AV Receiver
    Remote_AVReceiver.sendCommand("KEY_BASEBOOST")
    // Increase the volume by 5.
    Remote_AVReceiver.sendCommand("KEY_VOLUMEUP 5")
end

Channels

This binding currently supports following channels:

Channel Type ID Item Type Description
event Trigger Triggers when a button is pressed.
transmit String Used to transmit IR commands to LIRC.