Skip to content

About

USB-UIRT CLI for sending/learning IR codes

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

USB-UIRT CLI

USB-UIRT IR code transmitter/learner, based on EventGhost's USB-UIRT plugin.

This script lets you send IR codes from the command line. I use this, for example, to send a "power on/off" command to my LG TV when I press Ctrl+Alt+T (via PowerToys Keyboard Manager). It also lets you learn those IR codes from a remote control, and save them to a file for later use.

Installation

The available uuirtdrv.dll from the USB-UIRT Windows Drivers is 32-bit, so the CLI must run under 32-bit Python.

If EventGhost is installed in C:\Program Files (x86)\EventGhost, usb_uirt_cli.cmd automatically uses EventGhost's bundled 32-bit Python and the installed USB-UIRT driver DLL. No extra Python setup is needed.

Without EventGhost:

  1. Install the USB-UIRT Windows driver.

  2. Copy i386\uuirtdrv.dll from the USB-UIRT driver archive to the directory containing usb_uirt_cli.cmd, or make sure uuirtdrv.dll is installed somewhere Windows can load it.

  3. Install a 32-bit Python from Python Releases for Windows. Choose a Windows installer (32-bit) / Windows x86 executable installer.

  4. Configure usb_uirt_cli.cmd to find 32-bit Python using one of these options:

    • Do nothing if EventGhost is still installed; the wrapper uses C:\Program Files (x86)\EventGhost\py.exe automatically.
    • Do nothing if the Python launcher can find your 32-bit Python; the wrapper tries to run py -3-32, so that may just work.
    • Set environment variable USB_UIRT_PYTHON globally to the exact 32-bit python.exe path.
      setx USB_UIRT_PYTHON "C:\Users\you\AppData\Local\Programs\Python\Python313-32\python.exe"
    • Or edit usb_uirt_cli.cmd locally and set the path near the top:
      set "USB_UIRT_PYTHON=C:\Users\you\AppData\Local\Programs\Python\Python313-32\python.exe"

The wrapper tries, in order: USB_UIRT_PYTHON, EventGhost's bundled Python, and then py -3-32.

Usage

usb_uirt_cli.cmd info
usb_uirt_cli.cmd list
usb_uirt_cli.cmd send lg-tv-power-on-off
usb_uirt_cli.cmd send-raw "0000 006C ..."

The CLI preserves EventGhost's transmit behavior: it opens USB-UIRT, detects Pronto versus UIRT format the same way the EventGhost plugin does, calls UUIRTTransmitIR(code, format, repeat, wait), then closes the device.

To learn a new code:

:: Just print the learned code:
usb_uirt_cli.cmd learn
:: These variants save the learned code to commands.json:
usb_uirt_cli.cmd learn lg-tv-mute
usb_uirt_cli.cmd learn lg-tv-mute --name "LG TV Mute"

In case you already have codes in an EventGhost configuration file, you can import them:

usb_uirt_cli.cmd import-eventghost ....xml --include-disabled

About

USB-UIRT CLI for sending/learning IR codes

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages