Skip to main content

PyPI

lirc2hass

Listen for input events detected by InputLIRC and generate events in Home Assistant. Primarily useful for triggering Home Assistant automations using Logitech Harmony remotes via an LIRC-compatible remote control.

The lirc2hass daemon generates Home Assistant events when input events are received from an IR receiver by InputLIRC. Home Assistant automations can be triggered by these events, which can then call any services available to Home Assistant, such as turning lights on and off, close blinds, etc.

It is the missing link that allows buttons on the Logitech Harmony remote to trigger any device that can be controlled by Home Assistant, where the Home Assistant server cannot be physically collocated with the Harmony Hub. (If it were, then you could use the LIRC integration directly on the HA server.)

Installation

lirc2hass should run on most Linux installations (tested on Rasperry Pi OS) and requires the following:

  • an IR receiver that is supported by inputlirc and connected locally to the system.
  • inputlirc package installed and configured on the underlying operating system to read and process input from the IR receiver.

Install the latest release of this package via PyPi:

pip install lirc2hass

Run the daemon using lirc2hass hass_base_url -a , where hass_base_url is the base URL for your instance of Home Assistant.

systemd configuration

Configure systemd to start the daemon at boot by installing lirc2hass.service into /etc/systemd/system after editing to suit your installation.

If the daemon is run as a non-root user, ensure that user has the necessary privileges to read from the LIRC socket. On Debian-based systems, membership of group input is required to read the LIRC socket, located at /var/run/lirc/lircd.

Logitech Harmony configuration

TODO

  • Add Windows MCE controller as a device in Harmony setup
  • Position IR receiver to reliably receive IR commands from Harmony (or mini-IR blaster)

Home Assistant configuration

TODO

  • (optional) Add new Home Assistant admin user
  • Create long-lived authorisation token for user
  • Pass token to lirc2hass using --hass-auth-token option

Options

Option Type/Default Description
-a | --hass-auth-token auth_token Enable sending of authorisation header, using auth_token as the token.
-A | --hass-auth-token-file filename Read authorisation token from filename.
-l | --lirc-sock-path /var/run/lirc/lircd Set path to LIRC socket.
-c | --max-reconnect-delay 64 Set maximum reconnect delay for the LIRC socket. The daemon reconnects automatically on disconnection using an exponential backoff delay with this value as the maximum.
-r | --min-repeat-time-ms 740 Ignore repeated keystrokes that are generated within the specified time (in ms).
-v | --verbose Set logging verbosity (repeat to increase).
-V | --version Show currently installed version.

Release files for lirc2hass 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lirc2hass 0.1.0
File Size Uploaded
lirc2hass-0.1.0.tar.gz 5.8 kB Details

Release files / lirc2hass-0.1.0.tar.gz

Download URL lirc2hass-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
afc1bdefbdba9fbb0055fa852a6314af17f685e2e2457a7ba70820f3cb86e722
BLAKE2b-256 checksum
How to use checksums
b26d97f6cb655c664aaf521d4881405cd632e427693a165d29d4ef8350a7b023
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page