Project · code
LG webOS TVs
A Home Assistant integration for LG televisions, with picture settings, a pointer remote and calibration controls.
- Kind
- code
- Tags
- home-assistant, webos, python
ha-lg-webos-tv controls LG televisions from Home Assistant over the TV’s own WebSocket protocol. It is in the HACS default list.
It follows the design of Home Assistant’s built-in webOS integration and adds to it:
- a remote with pointer movement, clicks, scrolling and text entry
- picture settings as numbers and selects: picture mode, backlight, contrast and the rest
- sound output and channel selection
- notifications on the screen
- services for launching apps, sending any button, changing settings and calling an arbitrary endpoint
It holds one connection per TV and the TV pushes its state. A check every ten seconds confirms the connection is alive; it does not poll for state. TVs are found on the network automatically and paired by accepting a prompt on the screen. Turning a TV on uses Wake-on-LAN.
What it took
Most of the work has been in what newer webOS versions changed: webOS 25 and 26 changed how a TV pairs.
- Setting a soundbar's volume through a TV that cannot read it: volume control when the TV cannot see the soundbar’s level.
- A callback that awaits disconnect deadlocks the connection: a deadlock in the client library, carried as a fix in a fork until upstream takes it.
- Home Assistant serves config/www without authentication: why the screenshot button was removed.
Links to
Notes
Code
- ha-lg-webos-tv LG WebOS TV Integration for Home Assistant
Linked from
Related by meaning
- Linux companion agent Project
- ha-linux-agent Code
- Bluetooth devices without the app Project