Control your older LG TV via HomeKit

LG TV Controller for HomeKit

Flash to an M5Atom RS232 Kit, and add your LG TV to your HomeKit home. Should work with most other ESP32 kits as well.

Quick Start

Flash the M5Atom:

  • Download the latest release
  • Download NodeMCU PyFlasher
  • Plug in your M5Atom RS232 Kit
  • Launch NodeMCU PyFlasher
    • Set your serial port
    • Select the downloaded .bin file as your NodeMCU firmware
    • Select 'Dual I/O (DIO)' as Flash mode
    • Erase flash to 'yes'
  • Click 'Flash NodeMCU'

Connect to your TV:

  • Purchase a DB9 cable, trim one end, and connect the pins such that:
    • PIN 2 -> TX
    • PIN 3 -> RX
    • PIN 5 -> GND
  • You'll need a USB power supply since the TV does not supply 12v

Configure the M5Atom:

  • Power on the M5Atom
  • Hold down the button for 3 seconds until the LED flashes cyan quickly
  • Press the button 3 times, the LED should triple-blink
  • Hold the button for 3 seconds again to enter AP configuration mode
  • The LED should flash yellow
  • Connect to the 'LGTV XXXXXX' WiFi access point that should now be available and enter your WiFi details and setup code

Connect to HomeKit:

  • Open Home.app on your iDevice
  • Add new Accessory
  • Press "My device isnt listed or cannot scan"
  • Select the LGTV
  • Enter the setup code entered earlier
  • Set room/automation options
  • You can now control tv power/inputs from Home.app

Serial Configuration

You can configure the WiFi settings and Setup Pin from a serial connection

  • Open Serial Monitor
  • Enter 'S ' to define the HomeKit pairing pin (eg 'S 11122333')
  • Enter 'W' to enter WiFi connection details
  • Enter ? for list of all commands

Building Manually

  • Clone the repository
  • Open repository in PlatformIO
  • Build and Upload

Status LED

  • Yellow:
    • Pulsing: WiFi Details Required
    • Flashing: WiFi Connecting
  • Magenta:
    • Pulsing: Waiting to pair with HomeKit
  • Green:
    • Solid: Connected and ready to recieve HomeKit commands

QR Code

You can generate a QR code to scan with Home.app by using the QR code generator tool

# python3 gen_qrcode 31 111-22-333 HSPN output.png

Alternatively, you can use an online QR code generator such as the-qrcode-generator.com, just enter the generated setup payload which is printed after you enter your custom pairing pin (eg X-HM://00KUG4GWTHSPN)

Other ESP Boards

This controller should work fine on other ESP boards, with the following setup:

  • GPIO 19 - UART RX (will need to be converted to 5v logic level)
  • GPIO 22 - UART TX (will need to be converted to 5v logic level)
  • GPIO 27 - NeoPixel Compatible LED (SK6812/WS2812C/etc)
Comments
  • Issue with WIFI hotspot

    Issue with WIFI hotspot

    Hello, My device arrived today and I've followed your instructions and from what I can see successfully flashed the ATOM device. The issue I have is I've followed the instructions for putting the device in to AP mode but it doesn't seem to be broadcasting IE i'n not seeing the LG wifi. Also I have added a picture of how I've connected the DB9 cable to the ATOM device can you confirm this is correct? Thanks in advance!

    Screenshot 2021-09-14 at 16 57 53
  • Volume Bar Bug

    Volume Bar Bug

    Hi, sorry me again… So while the TV is on the volume bar keeps flashing up on the screen as if the volume is being controlled however the volume remains the same.

    Also some feature requests: 1)would it be possible to add other options to the selector such as a live tv (to flick back from HDMI input) or a guide option? 2)Is it possible to expose volume control in HK as a light bulb so Volume can be adjusted with a slider? 3) Do you think OTA updates could ever be enabled to keep the device on the latest version?

    Thanks in advance!

  • Baud Rate

    Baud Rate

    Hello, I've ordered the ATOM RS232 and I'm doing some pre-emptive reading before it's arrival. What baud rate needs to be selected when flashing the ATOM? Thanks in advance!

  • Add DTV Antenna to Input list.

    Add DTV Antenna to Input list.

    Hi Unreality, unsure if you still have no time for this project but thought I’d ask again just in case. The device works perfectly but would it be possible to add DTV Antenna to the list of inputs? The rs-232 code I found online for it is “ xb 01 00[CR]” this would enable users to switch back to normal tv after switching to HDMI. This really would complete this for me and I’d not bother you again. Thanks in advance!

  • Add option to return to tv?

    Add option to return to tv?

    Hi Unreality, thanks again for fixing the other issues for me. My device now works perfectly. Would it at all be possible to add a live tv option to the current build as currently once a HDMI source is selected there is no way to return to normal tv? Thanks in advance!

Dummy code for using an ESP32 as a lightbulb in Apples HomeKit.

ESP32 HomeKit Lightbulb A dummy implementation of a HomeKit lightbulb using the ESP HomeKit SDK by Espressif for the ESP32. Prerequisites PlatformIO U

Apr 27, 2022
HomeKit connected smart thermostat based on Arduino using HomeSpan.
HomeKit connected smart thermostat based on Arduino using HomeSpan.

HomeSpan Thermostat HomeKit connected smart thermostat based on Arduino using HomeSpan. Background and Motivation I have a 24 V Heat-only system with

Jan 3, 2023
A simple tool using PC mouse via USART to control MCU and LCD/OLED (with LVGL library), if your screen cannot be controlled by touch.
A simple tool using PC mouse via USART to control MCU and LCD/OLED (with LVGL library), if your screen cannot be controlled by touch.

LVGL_USB_Mouse A simple tool using PC mouse via USART to control MCU and LCD/OLED (with LVGL library), if your screen cannot be controlled by touch. 如

May 5, 2022
Control Heidelberg Wallbox Energy Control over WiFi using ESP8266 and configure your own local load management
Control Heidelberg Wallbox Energy Control over WiFi using ESP8266 and configure your own local load management

< scroll down for English version and additional information > wbec WLAN-Anbindung der Heidelberg WallBox Energy Control über ESP8266 Die Heidelberg W

Jan 3, 2023
Dec 25, 2022
My attempt at comparing the 5455 XDK kernel against an older build, NOT COMPILABLE CODE (Mainly psudocode with sections filled in)

xboxkrnl.exe build 5445 XDK CHK My attempt at comparing the 5455 XDK kernel an older build, NOT COMPILABLE CODE (Mainly psudocode with sections filled

Dec 4, 2021
⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.
⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.

A cross compiler for shader languages. Convert between SPIR-V, GLSL / GLSL ES, HLSL, Metal Shader Language, or older versions of a given language. Cross Shader wraps glslang and SPIRV-Cross, exposing a simpler interface to transpile shaders.

Dec 30, 2022
A C library for RP2040-powered boards to control LCDs via the I2C protocol

picoi2clcd A C library to control I2C LCD displays using the Rapsberry Pi Pico (or really any board using the RP2040 microcontroller). License All of

Oct 16, 2021
Allows you to easily control via MQTT any Micronova equiped pellet stove. (MCZ, Extraflame, Laminox, and many others brands!)
Allows you to easily control via MQTT any Micronova equiped pellet stove. (MCZ, Extraflame, Laminox, and many others brands!)

micronova_controller Kits are available on Tindie! Currently out of stock. V2 will be in stock soon! Here is an overview of the additions: possibility

Dec 19, 2022
Dec 19, 2021
Budgie Control Center is a fork of GNOME Control Center for the Budgie 10 Series.

Budgie Control Center Budgie Control Center is a fork of GNOME Settings / GNOME Control Center with the intent of providing a simplified list of setti

Dec 12, 2022
Watch TV channels on your device via internet from all over the world for free. IPTV API Implemented with QT C++
Watch TV channels on your device via internet from all over the world for free. IPTV API Implemented with QT  C++

IPTV Desktop Description IPTV-Desktop is GUI application made with Qt C++ using IPTV API, which was developed by iptv-org. Watch free tv channels via

Oct 24, 2022
Control your mouse using razer synapse

rzctl Control your mouse using razer synapse Compile in x64 Not tested for x86 Credits Process Hacker - https://github.com/processhacker/processhacker

Nov 23, 2022
Remote control for your QMK-powered keyboard

QMK RC QMK RC is a project that aims to bring the same convenience to controlling your QMK keyboard from your computer, as QMK did to programming keyb

Dec 24, 2022
A free and open-source cross-platform application to control your Philips hue compatible lights💡
A free and open-source cross-platform application to control your Philips hue compatible lights💡

?? OpenHue ?? A cross platform application to control your Philips hue compatible lights. licensed under the gpl 3.0 license. Currently in super early

Dec 28, 2022
A simple program to control the status LEDs of your Raspberry Pi!

ledcontrol is a program which was developed especially for the Raspberry Pi. With the help of this program you can easily turn on or off the status leds of your Raspberry Pi. Or even let them blink in different rythm!

Jun 24, 2022
Learn how to connect your Flexispot (LoctekMotion) desk to the internet. This repository contains a collection of scripts to get your started, combined with research and instructions.
Learn how to connect your Flexispot (LoctekMotion) desk to the internet. This repository contains a collection of scripts to get your started, combined with research and instructions.

(image source: Windows Central) Turn your LoctekMotion/FlexiSpot desk into a smart desk Recently I acquired a new standing desk from FlexiSpot. During

Dec 28, 2022
emPOWer your commits. Pointlessly flex on your coworkers with bespoke commit hashes, all with the convenience of a single command.
emPOWer your commits. Pointlessly flex on your coworkers with bespoke commit hashes, all with the convenience of a single command.

git-power emPOWer your commits. Pointlessly flex on your coworkers with bespoke commit hashes, all with the convenience of a single command.

Dec 19, 2022
A header maker, this project will create your header file with all your declaration in

Headermaker Install: git clone https://github.com/rmechety42/Headermaker.git cd Headermaker make install Usage: Headermaker src_folder_you_want_to

Dec 8, 2022