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.
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:
-
Install the USB-UIRT Windows driver.
-
Copy
i386\uuirtdrv.dllfrom the USB-UIRT driver archive to the directory containingusb_uirt_cli.cmd, or make sureuuirtdrv.dllis installed somewhere Windows can load it. -
Install a 32-bit Python from Python Releases for Windows. Choose a
Windows installer (32-bit)/Windows x86 executable installer. -
Configure
usb_uirt_cli.cmdto 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.exeautomatically. - 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_PYTHONglobally to the exact 32-bitpython.exepath.setx USB_UIRT_PYTHON "C:\Users\you\AppData\Local\Programs\Python\Python313-32\python.exe"
- Or edit
usb_uirt_cli.cmdlocally and set the path near the top:set "USB_UIRT_PYTHON=C:\Users\you\AppData\Local\Programs\Python\Python313-32\python.exe"
- Do nothing if EventGhost is still installed; the wrapper uses
The wrapper tries, in order: USB_UIRT_PYTHON, EventGhost's bundled Python,
and then py -3-32.
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