Skip to content

Repository files navigation

HDMI Switch

A lightweight Windows 11 system tray utility that automatically switches your LG TV to the correct HDMI input when your PC starts. Built for LG webOS TVs (2018+) using the SSAP WebSocket protocol.

Features

  • Auto HDMI switch on boot -- switches your LG TV to the configured HDMI input every time Windows starts
  • Wake-on-LAN -- optionally wakes your LG TV before switching (sends WOL magic packet)
  • One-time pairing -- pair with your TV once, credentials persist across reboots
  • MAC auto-discovery -- automatically detects your TV's MAC address during pairing
  • System tray -- runs silently in the background with a tray icon for quick access
  • Retry logic -- configurable retry attempts with delay for reliable switching even when the TV is slow to boot
  • Auto-start with Windows -- registers itself in the Windows startup registry (toggle on/off from settings)
  • Single .exe -- self-contained binary, no .NET runtime or installer needed

Requirements

  • Windows 11 (x64)
  • LG webOS TV (2018 or newer) on the same local network
  • TV setting: LG Connect Apps enabled (Settings > Network)

Installation

  1. Download HDMISwitch.exe from Releases
  2. Place it anywhere (e.g. C:\Users\<you>\Apps\HDMISwitch.exe)
  3. Run it -- the Settings window opens on first launch

Setup

  1. Enter your LG TV's IP address
  2. Click Pair with TV -- accept the pairing prompt shown on your TV screen
  3. The MAC address will auto-fill (used for Wake-on-LAN)
  4. Select your HDMI port (1-4)
  5. Check Wake TV (WOL) if you want the app to power on your TV before switching
  6. Check Start with Windows to launch automatically on boot
  7. Click Save

That's it. On every boot, the app will silently wake your TV (if enabled) and switch to your HDMI input.

WOL Setup (Optional)

For Wake-on-LAN to work, enable these in your LG TV settings:

  1. Settings > General > Mobile TV On > Turn On Via WiFi = ON
  2. Settings > General > TV Management > Quick Start+ = OFF
  3. Ethernet connection recommended (WiFi WOL is unreliable)

System Tray

Once running, the app sits in the system tray. Right-click the icon for:

  • Settings -- open the settings window
  • Switch Now -- manually trigger an HDMI switch
  • Exit -- close the app

Double-click the tray icon to open Settings.

How It Works

The app communicates with your LG TV using the SSAP (Simple Service Access Protocol) over a secure WebSocket connection (wss://TV_IP:3001). On startup:

  1. Sends a WOL magic packet to wake the TV (if enabled)
  2. Waits for the TV to boot (~5 seconds)
  3. Connects via WebSocket and authenticates with the stored client key
  4. Sends ssap://tv/switchInput with the configured HDMI port
  5. Retries up to 5 times (configurable) if the TV isn't ready

Building from Source

Prerequisites

Build

dotnet publish -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true

The output binary will be at:

bin\Release\net9.0-windows10.0.22621.0\win-x64\publish\HDMISwitch.exe

Tech Stack

  • C# / .NET 9 with Windows Forms
  • WebSocket (System.Net.WebSockets) for LG SSAP protocol
  • UDP for Wake-on-LAN magic packets
  • Windows Registry for auto-start
  • Published as a self-contained, trimmed, single-file .exe (~34 MB)

Configuration

Settings are stored at %APPDATA%\HDMISwitch\config.json:

{
  "tvIp": "192.168.1.x",
  "tvMac": "AA:BB:CC:DD:EE:FF",
  "hdmiPort": 1,
  "clientKey": "...",
  "wolEnabled": true,
  "autoStart": true,
  "retryCount": 5,
  "retryDelayMs": 3000
}

License

MIT

About

Windows APP to automatically switch LG TV to the selected HDMI input when PC starts

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages