Skip to content

schwarzenbergf/irtrans

Repository files navigation

hacs Community Forum License Github release latest Project Maintenance irtrans

iRTrans

Component to integrate with irtrans.

This component will set up the following platforms.

Platform Description
irtrans Sensor - Show content from iRTrans LAN device
event Event Triggers from (learned) Remotes
service Service call for each Remote to send IR commands

Requirements

iRTrans appliances are devices which are able to send and receive (and to learn) IR (infrared) signals. For more details see here. This integration supports only so called LAN devices (which have an Ethernet or WiFi connection). It has been tested with a device with IR Database and works probaly just with such a device. Learning of IR signals is not (yet) supported. There are good applications from iRTrans GmbH to do this.

How it works

The communication with the iRTrans device follows these API rules.

The basic procedure works as follows:

After successfully connected to an iRTrans device the configuration is read from the device. In the first step all the IR Remotes are fetched. In the second step for each Remote all available commands are read. Remotes and associated commands (buttons) are then stored as attributes of the Sensor entity, which will be created as representation of the iRTrans device.

irtrans_sensor In this example 6 remotes (denon, dvbt2 ...) with their associated commands have been fetched from the iRTrans device.

Sending IR commands

For each Remote a so called entity_service will be created with the following naming convention:

send_irtrans_ir_command_remote_name

where remote_name is the name of a (learned) IR Remote. This service can be used to fire IR commands. Here is an example how it looks in Developer Tools:

Developer Tools

Automations can also be used to fire IR commands. Here is an example for an Automation Action:

description: "Fire IR command for vol+ of Remote lgsmarttv"
mode: single
trigger: []
condition: []
action:
  - service: irtrans.send_irtrans_ir_command_lgsmarttv
    data:
      remote: lgsmarttv
      ir_cmd: vol+
    target:
      entity_id: sensor.irtrans_sensor

There are many UI (lovelace) cards for Remote senders/receivers available. Here is one example, how to assign a service-call to a button of such a Remote card. The Generic Remote Control Card allows individual configuration for each button of a Remote:

type: custom:generic-remote-control-card
name: LG TV
remote_template: simple
buttons:
  power:
    call: irtrans.send_irtrans_ir_command_lgsmarttv
    data:
      entity_id: sensor.irtrans_sensor
      remote: lgsmarttv
      ir_cmd: onoff

In this example the name of the card is LG TV, the button to use is power, the Remote name is lgsmarttv and the assigned command is onoff.

Listening to IR commands

The integration provides event support for IR commands which has been received by the iRTrans device. Only IR commands which are known (learned) by the iRTrans device will trigger an event. Here is an example off an Automation Trigger on an iRTrans event:

description: "Trigger on button vol+ from Remote lgsmarttv"
mode: single
trigger:
  - platform: event
    event_type: irtrans_event
    event_data:
      remote: lgsmarttv
      button: vol+
condition: []
action: []

Installation

Install with HACS (recommended)

HACS can be used to install this integration. Just search for iRTrans and install it directly from HACS. HACS will keep track of updates and you can easily upgrade iRTrans to latest version. If iRTrans is not (yet) available when using the Explore & Download Repositories in the HACS page use the menu (three dots) in the upper right corner to add a Custom Repository : https://github.com/schwarzenbergf/irtrans.git .

Add Custom Repository

After adding this repository and adding iRTrans to HACS (Explore & Download Repositories) do not forget to restart HA.

Install manually

  1. Install this integration by creating a custom_components folder in the same folder as your configuration.yaml, if it doesn't already exist.
  2. Create another folder irtrans in the custom_components folder. Copy all files from irtrans into the irtrans folder. Do not copy files from master branch, download latest release (.zip) from here and copy the content of custom_components/irtrans/ to the a/m irtrans folder.

Configuration is done in the UI

After installing iRTrans (and the required restart of HA), add iRTrans to HA via

Settings --> Devices & Services.

Just use Add Integration button and search for iRTrans. Fill in Host Address & Port (default 21000) of the iRTrans device and you are done.

Config

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines