Automatically Switch HDR/SDR Mode on LG TV (WebOS) #1346
Johnson145
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've written a small shell script that automates syncing the hdr setting for LG tvs. It's meant to be running on the same machine as HyperHDR (not the TV itself, but e.g. a Raspberry Pi), fetches HDR information from the TV and updates HyperHDR accordingly. I.e. this does not require your TV to get rooted.
I think I haven't seen something similar on this repo yet, so maybe helpful for others:
Script
Tutorial
Details
Here is a complete, step-by-step guide to create a shell script that runs on your Raspberry Pi. This script will:Poll your LG TV for its current picture mode.
Check if the mode indicates HDR or SDR.
Send the correct command to your local HyperHDR server only when the state changes.
Run persistently as a background service.
Part 1: Prerequisites & Setup on Your Raspberry Pi
First, you need to install the necessary tools on your Pi. Open an SSH terminal to your Raspberry Pi (the one running HyperHDR) and execute the following commands.
curl,jq(a JSON parser), and Python's package manager:(prefer to use virtual env instead)
When you run this, your LG TV will display a pairing request. You must accept it on the TV. After you accept, the command will run successfully and show you the current picture mode. You only need to do this once.
Part 2: The Automation Shell Script
Now, let's create the script itself.
Paste the script content as given before into the editor. You must edit the
TV_IPvariable.Make the script executable:
You can test it by running
./hyperhdr_auto.sh. You should see it poll and set the initial state. You can stop it withCtrl+C.Part 3: Running the Script as a Permanent Service
The final step is to make this script run automatically in the background and restart on boot. We'll use
systemdfor this.Note: If your Raspberry Pi username is not
pi, change theUser=andExecStart=lines to match your user and home directory.Save and Exit (
Ctrl+O,Enter,Ctrl+X).Enable and Start the Service:
Now, tell systemd to recognize and run your new service.
Check the Status:
Your script is now running in the background. You can check its status or see its log output with these commands:
LUT Calibration Conflict
When running the LUT calibration, you should temporarily disable this service. Otherwise it may cause incorrect calibration values.
Beta Was this translation helpful? Give feedback.
All reactions