2020-09-21 01:58:32 +02:00
|
|
|
# LIRC Binding
|
|
|
|
|
2021-04-24 20:39:51 +02:00
|
|
|
This binding integrates infrared transceivers through [LIRC](https://www.lirc.org) or [WinLIRC](http://winlirc.sourceforge.net).
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
A list of remote configuration files for LIRC is available [here](http://lirc-remotes.sourceforge.net/remotes-table.html).
|
|
|
|
|
|
|
|
## 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.
|
|
|
|
|
|
|
|
```ini
|
|
|
|
[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
|
|
|
|
|
2022-12-08 21:36:05 +01:00
|
|
|
```java
|
2020-09-21 01:58:32 +02:00
|
|
|
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:
|
|
|
|
|
2022-12-08 21:36:05 +01:00
|
|
|
- **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
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
Remote:
|
|
|
|
|
2022-12-08 21:36:05 +01:00
|
|
|
- **remote**: The name of the remote as known by LIRC
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
### Items
|
|
|
|
|
2022-12-08 21:36:05 +01:00
|
|
|
```java
|
2020-09-21 01:58:32 +02:00
|
|
|
String Remote_AVReceiver { channel="lirc:remote:local:Onkyo_RC_799M:transmit" }
|
|
|
|
String Remote_TV { channel="lirc:remote:local:Samsung:transmit" }
|
|
|
|
```
|
|
|
|
|
|
|
|
### Rules
|
|
|
|
|
2022-12-08 21:36:05 +01:00
|
|
|
```java
|
2020-09-21 01:58:32 +02:00
|
|
|
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. |
|