Code Monkey home page Code Monkey logo

lgtvcompanion's Introduction

LGTV Companion

Download and install instructions

The installer for the latest version can be downloaded from the Releases page.

Please note that Windows Defender SmartScreen may block the download. There is no way for developers to directly influence which apps will show up on SmartScreen. If the installer will not download you must therefore instruct your web browser to download it regardless and if the installer does not run you must unblock the installer. Unblocking is done by right clicking the downloaded installer, clicking on properties, under general and at the bottom security section check the "Unblock" checkbox. You can help prevent this in the future by reporting this application as safe to Microsoft when downloading the installer.

Alternatively you can use Winget via Windows Terminal/PowerShell: winget install LGTVCompanion

Overview

This application (UI and service) controls LG WebOS TVs and displays.

This application aim to be a set and forget application to provide:

  • automatic management for your WebOS device (TV), to shut off and turn on in reponse to the PC shutting down, rebooting, entering low power modes and when user is idle as well as in response to changes in the windows monitor topology, in a multi-monitor environment.
  • a powerful command line tool to control your WebOS device and change most of its settings.
  • an API, which external scripts and/or applications can use to facilitate automation.

Background

With the rise in popularity of using OLED TVs as PC monitors, it is apparent that standard functionality of PC-monitors is missing. Particularly turning the device on or off in response to power events in windows. With OLED monitors this is particularly important to prevent "burn-in", or more accurately pixel-wear.

What other people say

  • "That is a really janky solution. But... it WORKS!" - Linus Tech Tips at YouTube
  • "The best kind of programming is fueled by pure hate for an annoying situation." - reddituser at Reddit
  • *"Yeah, that's really nice..." - my wife

Installation and usage

  1. Important prerequisites:
    • Power ON all TVs and ensure they are connected to your local area network via Wi-Fi or cable.
    • Ensure that the TV can be woken via the network. For the CX line of displays this is accomplished by navigating to Settings (cog button on remote)->All Settings->Connection->Mobile Connection Management->TV On with Mobile, and then enable 'Turn On via Wi-Fi'. For C1, C2 and C3 it's All Settings->General->Devices->External Devices->TV On With Mobile->Turn on via Wi-Fi. NOTE! This step is needed regardless of using WiFi or a cable.
    • Open the administrative interface of your router, and set a static DHCP lease for your WebOS devices, i.e. to ensure that your devices always have the same IP-addresses on your LAN.

HOT TIP! While in the settings of the TV, ensure that the device automatic power off is set long enough to not interfere with your sessions with the PC, f e 8 hours. Note that for the C2 displays this setting can be found here: All settings->General->OLED Care->Device Self-Care->Energy Saving->Auto Power off. The LGTV Companion app will manage the power state of the display and the less interference the better.

  1. Download the latest version of the setup package from the releases page ( Click here ) and install it. This will install and start the service (LGTVsvc.exe), install the user interface (LGTV Companion.exe) as well as the desktop user mode daemon (LGTVdaemon.exe).
  2. Open the user interface from the Windows start menu, it is called "LGTV Companion".

l_main

  1. Click the 'Scan' button to let the application try and automatically find network attached WebOs devices (TVs) (This button is called 'Configure' in the screenshot above). If the 'Scan' feature does not work properly you will be able to add your devices manually.
  2. Optionally, click the drop down button to manually add, remove, configure devices and the parameters of the respective device, this includes the network IP-address, the physical address, i.e. the MAC(s). This information can easily be found in the network settings of the TV. Also, the default wake-on-lan network options should work for most configurations, but if your TV has difficulties powering on then try the other options.

HOT TIP! Clicking the 'What's this?' links will show you more information about all options throughout the UI.

l_dev

  1. In the main application window, ensure the 'Manage this device' checkbox is checked so the application will automatically respond to power events (shutdown, restart, suspend, resume, idle) for the respective devices.
  2. Optionally, tweak the global options, by clicking on the hamburger icon button (options).

HOT TIP! The "User Idle Mode" works seprately from all other windows power options and can be really useful to provide maximum protection against screen burn-in and also some additional power savings.

l_opt

if your OS is not localised in english, you must in the 'additional options' dialog click the correct checkboxes to indicate what words refer to the system restarting/rebooting (as opposed to shutting down). This is needed because there is no better (at least known to me) way for a service to know if the system is being restarted or shut down than looking at a certain event in the event log. But the event log is localised, and this approach saves me from having to build a language table for all languages in the world. Note that if you don't do this on a non-english OS the application will not be able to determine if the system is being restarted or shut down. The difference is of course that the displays should not power off when the system is restarted.

  1. Click Apply, to save the configuration file and automatically restart the service.

  2. At this point your respective WebOS TV will display a pairing dialog which you need to accept.

All systems are now GO! 👍

  1. Please go ahead and use the drop down menu again and select 'Test', to ensure that the devices properly react to power on/off commands.

  2. You can now close the main UI. The service will continue running in the background.

Limitations

  • Some LG OLED displays can sometimes not be turned on via network when an automatic pixel refresh is being performed. You can on some models hear an internal relay click after the pixel refresh, when the display is actually powered down, at which point it can be turned on again at any time by this application.
  • The WebOS device can only be turned on/off when the PC and the device are both connected to a network.
  • The TV cannnot be on a different subnet/VLAN from your PC. This is because the TV is powerd on by means of broadcasting a magic packet, aka Wake-on-lan, which is restricted to layer 2, i.e. same subnet only. There are ways to bypass this limitation but it is outside the scope of this application, even though you can probably make it work. Let me know if you need help to make it work for you.

Troubleshooting

If your display has trouble powering on, these are the things to check first:

  • "Turn on via WiFi" must be enabled in the TV configuration, regardless of using WiFI or Ethernet. Read more under "1. Important prerequisites" above.
  • When connecting the TV via Wi-Fi it seems some users must enable "Quickstart+" (up to 2021 models) or "Always ready" (2022 and forward models) and disable "HDD Eco mode" to avoid the NIC becoming inactive. (physical network cable does not seem to need this)
  • Confirm that the device is properly configured (i e IP and MAC) and try to use one of the other wake-on-lan network options, primarily use option two, send to IP-address.
  • Ensure the network is not dropping WOL-broadcasts.
  • If the connection between the TV and the Router and/or access point is lost for any reason (e.g. router reboot, power outage, firmware update, etc.) while the TV is off, the TV might not automatically reconnect and therefore won't react to attempts to turn it on via Wi-Fi or Ethernet. You may therefore need to turn the TV on manually at least once so that it can reconnect to your network.
  • In case of issues with devices not turning on in response to changes in the windows monitor topology configuration ensure that "Always ready" (2022 and forward models) is enabled.
  • Also note that a manual power off via remote and/or automatic display power off (Settings->General->OLED Care->Device Self-Care->Energy Saving->Auto Power off) can sometimes cause a situation where you also need to power on the display with the remote.

HOT TIP! Aim to configure the app to cover your use case and let the remote be, and also set a long enough timeout for the device built-in automatic power-off to never interfere with the length of your typical session with the PC.

If your display has trouble powering off it is most likely because:

  • The IP configuration might be erroneous. Verify the configuration and make sure the TV has a static DHCP lease in your routers admin pages.
  • The application has not yet received a pairing key. Try removing the device in the UI, click apply and then re-add the device to force re-pairing.

If User Idle Mode is not working as expected with some controllers/joysticks it might be because of a long-standing microsoft issue that has now been resolved with KB5022845

HOT tip! Enable the built in logger and check the output, it can be very useful for understanding where problems are.

System requirements

  • The application must be run in a modern windows environment, and any potato running Windows 10 or 11 is fine.
  • A Local Area Network (LAN)

Commandline arguments

'LGTV companion.exe" can accept hundreds of command line arguments for controlling the application and managed devices. Please see the documentation for all command line arguments here: Command line documentation

License

Copyright © 2021-2024 Jörgen Persson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Discussions

Discord: https://discord.gg/7KkTPrP3fq

Please use the Github issue tracker for potential bug reports and/or feature requests

Thanks to

Donations

This is free software, but your support is appreciated and there is a donation page set up over at PayPal. PayPal allows you to use a credit- or debit card or your PayPal balance to make a donation.

paypal

Copyright

Copyright © 2021-2024 Jörgen Persson

lgtvcompanion's People

Contributors

bubba925 avatar chaython avatar dechamps avatar jpersson77 avatar ricardom17 avatar speedyr10 avatar tunctaylan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lgtvcompanion's Issues

Playstation input issue (Enhancement)

Example: PS5 on HDMI 1, PC on HDMI 2

Scenario 1: LG companion using the option to turn to PC (HDMI 2) when TV is off at HDMI 1 (PS5) last time - Result when turn on PC: PS5 (HDMI 1) shows up for a second or two and force PS5 to turn on (If using CEC option in PS5)

Scenario 2: Using Hotel mode to force HDMI 2 as default input source - Result when turn on PC: Ps5 (HDMI 1) input source doesn't show up which will then not trigger turning on the PS5

Is there a way to configure this new feature in LG companion to be exactly like in Hotel mode since Hotel mode disable Wake on Lan and some other TV features like Airplay, Lite pixel refresher

Thanks!

LG NANO90 wont turn on

I have the LG 55" Nano90 and have installed the Lgtvcompanion as per the instructions. However, the function to turn on the TV is not working. I can turn it off without issues, but went bringing the PC back from sleep or turning it on does not turn on the TV.

I tried the following troubleshooting steps:

  • Checked that "Turn on with Mobile" is enabled in the device connection settings
  • Turned off HDD Eco Mode
  • Check that Quickstart+ is enabled
  • Set a Reserved IP in the DHCP ip pool for the TV
  • Verified that the MAC address is correct in the app

The mobile app "thinq" from LG can turn on the TV without issues, which indicates an issue with the Lgtvcompanion app itself.

Log info FYI:

Thu 14:33:04 > IPC command received: -poweron Device1
Thu 14:33:04 > Device1, spawning DisplayPowerOnThread().
Thu 14:33:04 > Device1, repeating WOL broadcast started to MAC: <ADDRESS>
Thu 14:33:25 > Device1, WARNING! DisplayPowerOnThread(): connect: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Thu 14:33:46 > Device1, WARNING! DisplayPowerOnThread(): connect: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Thu 14:33:46 > Device1, repeating WOL broadcast ended

No resume power on after switching to Windows 11

LG C1
Worked perfectly in Windows 10.
Just did a clean install of Windows 11 and now it appears after the machine sleeps - I have to use the remote to power the TV back on.

I don't know if it's a setting in Windows or what I'm missing. Any suggestions?

Any way to turn off tv when the screen goes to sleep in windows power management?

I have my Turn Off Display set for 3 mins, and then after 3 mins the screen goes to sleep, but the problem is that the LG Screensaver kicks in, what I want is that when the screen goes to sleep, it just shut down and when the mouse is moved that time the screen turns back on.

image

I can use screensaver mode? Yes, but i am using the screensaver mode at 1min interval after which i want the screen to go into sleep (after 15min) and tv to turn off.

Power Off works great but LG CX does not power back on (VLAN issue)

Hello,

I get the following errors on my logs when my TV is trying to power back on:
WARNING! DisplayPowerOnThread: connect: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

The TV is in the same network just on a different VLAN than the PC. The PC VLAN is able to communicate to the VLAN that my TV is on. It isn't able to find it by scanning it but it is able to communicate with it when I added the networking information manually. The application is able to turn off the TV correctly but it does not turn it on.

I tested this with Quick Start tv setting OFF and ON. I have it OFF because the TV pixel shift still activates regardless if the settings is off in the menu.

TV does not turn off on shutdown

Hi,

I have configured the app to successfully turn on and off, however when I try to shut down my PC nothing happens. The app turns off the TV only when the display is timed out or when the PC goes on standby. I also try fiddeling with the "restart, shutdown, power off" option in the app but the issue remains.

Kindly note that I have fast-startup disable due to bootup issues

Log details:

Fri 12:04:07 > Event subscription callback: system shut down detected.
Fri 12:04:13 > ** System is shutting down.
Fri 12:04:13 > Device1, spawning DisplayPowerOffThread().
Fri 12:05:00 > LGTV Companion Service started (v 1.2.0) ---------------------------
Fri 12:05:00 > Configuration file successfully read

The line "Device1, established contact: Display is powered OFF. " is present only when going on standby or display is timed out, but missing from the shutdown event

LG C2 with french words don't shutdown/resart

Hello

Brand new owner of a an LG C2 here.

Thanks for your software !

My OS is in french and the words are detected but they are not working.

And when i enable it, my restart or shutdown, take very long, not like usual.

I have look at the log and i see each time i do a shutdown, the soft thinks it's a restart and same for restart but not working.

MacBook version

Hi, I've been using this software for the past year or so with my PC and it has been amazing. I sometimes have my MacBook connected and would really appreciate an apple compatible version of this software. I realize Apple's restrictions are a possible challenge to overcome, but is it possible to make an apple version of this software?

Opening tv after a long time workaround not working

The workaround implemented in the latest patch worked well for a while, my LG CX actually woke up after a longer time when I booted my pc, but now it has stopped working? I made sure that the WOL magic packet is being sent to the Device IP-address and even tried to reinstall the program, but to no avail.

Feature - control volume level and mute

I don't know whether LG TVs expose volume in the protocol this app is using, but it would be nice to have a command line argument to change volume level or mute the sound. I assume that it would also allow to control volume level of sound devices connected through eARC. I don't really see a point to putting it in GUI though.

Power off works power on does not. Multiple network adapters?

The power off side works perfectly but I am not able to get it to power back on. I tried the HDD power save settings and the quick power on is enabled. The TV and the PC are on the same network. The only think I can think of is if the magic packet is being set out the correct network adapter. I have VM Ware Workstation installed and that creates multiple VMWare Network adapters. I am wondering if the magic packet is being sent out from one of these interfaces rather than the correct interface.

Change HDMI input to PC when PC has already turned on instead of wake from sleep/hibernate or off (Feature)

Example from PS5:

  • Ps5 is ON/Hdmi 2, PC is on Hdmi 1, when TV is at Hdmi 1, press the PS button on ps5 controller, TV will switch to Hdmi 2 (Ps5)

Is this possible to do this for PC by let's say making a shortcut or exe for whenever triggering it, it will do the exact same behavior like on the Ps5 controller (Can just set such shortcut/exe to a button on the pc controller)

Thanks for your hard work!

LG C1 won't turn on when PC resumes from sleep

Seems to work in other situations but not this one:

Mon 22:07:23 > ** System is suspending to a low power state.
Mon 22:13:47 > ** System resumed from low power state (Automatic).
Mon 22:13:47 > ** System resumed from low power state.
Mon 22:13:48 > ** System requests displays ON.
Mon 22:13:48 > Device1, spawning DisplayPowerOnThread().
Mon 22:13:48 > Device1, repeating WOL broadcast started to MAC: 24:E8:53:76:BE:C0 using network broadcast: 255.255.255.255
Mon 22:13:48 > Device1, WARNING! DisplayPowerOnThread(): connect: A socket operation was attempted to an unreachable host
Mon 22:14:15 > Device1, WARNING! DisplayPowerOnThread(): connect: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Mon 22:14:30 > Device1, repeating WOL broadcast ended

TV Turn off while video playback.

While playing local video files, the Automatic Blank feature still turns off the TV. I wish that this can be fixed.

Semi-related question, isn't it possible to hook into windows screensaver feature and if screensaver gets turned on then the LG Companion app would turn off (automatic blank) the TV? I'm asking because windows screensaver was what used before using the LGTV Companion and in that one regard its better and I'd honestly keep using it if the TV didn't turn off completely hours later and i'd have to use the remote.

Sometimes TV is not powered off when Windows turns off the output

(LGTVCompanion 1.4.2 Windows 11 21H2 22000.376, NVidia 496.76)

I have a hard-to-reproduce issue where sometimes (not always), for no apparent reason, LGTVCompanion does not turn off the TV when Windows decides to turn off the display. I'm referring purely to the Windows display timeout here, not PC standby/shutdown.

I hacked together a build with additional verbose logging code around PBT_POWERSETTINGCHANGE events, and then waited until the issue occurred again. I noticed that when things behave correctly, Windows delivers a GUID_CONSOLE_DISPLAY_STATE event to LGTVCompanion with data 0x2 (dimmed), followed 15 seconds later by another GUID_CONSOLE_DISPLAY_STATE event with data 0x0 (off). So far so good.

When the issue occurs, LGTVCompanion does receive the first event (0x2 dimmed), but the second one (0x0 off) is nowhere to be found. I have no idea why.

LGTVCompanion currently treats 0x2 (dimmed) the same as 0x1 (on) and therefore does not turn off the display in this case.

(I checked if GUID_MONITOR_POWER_ON had a similar problem. Sadly, the answer is yes.)

This probably deserves some more investigation, but if this doesn't go anywhere, a potential workaround is to treat 0x2 (dimmed) as "off". I don't think this would have any visible side effects, given that there is no actual dimming going on (at least not on my system). It would make the TV turn off 15 seconds too soon but that's arguably benign, and in fact it's a bit cleaner because this way the TV doesn't have time to briefly display its "No Signal" message.

Feature request - Don't blank screen while watching video

Screen blank
Unfortunately, this nice little feature blanks the screen while I'm watching a vidoe.
Could be solved by detecting full screen:

QUERY_USER_NOTIFICATION_STATE pquns;
SHQueryUserNotificationState(&pquns);
QUNS_RUNNING_D3D_FULL_SCREEN – fullscreen (Direct3D application is running in exclusive mode, i.e. fullscreen)

How to keep the display from turning on when I remote into PC.

Hey there. I typically enjoy using the setting where it blanks the monitor after a couple minutes with no input.
However, it causes a conflict with any remote PC software for gaming such as Steam Link or Moonlight. Problems pretty obvious, I connect to PC, it triggers the LG companion to turn on my tv. Even if I'm hundreds of miles away playing over my phone. Only fix I've found is to go into the settings every morning before I go to work. Disable the feature that blanks the tv. Then remember to turn it back on when I get home.

A "restart" would randomly turn off the TV

I am currently using the latest version 1.6.1 on Windows 11 and even though I tried multiple "restart words" in the additional options page, the TV would intermittently turn off when a reboot is initiated. This used to happen also in earlier versions.

TV turns off but not back on again with latest firmware

Hello,

The companion app was working fine on my LG OLED55CX5LB until recent firmware upgrades. I am now on 03.23.06. Here is the relevant log extract:

Wed 15:22:42 > ** System resumed from low power state.
Wed 15:22:46 > Device1, WARNING! DisplayPowerOnThread(): connect: A socket operation was attempted to an unreachable host
Wed 15:22:52 > Device1, WARNING! DisplayPowerOnThread(): connect: A socket operation was attempted to an unreachable host
Wed 15:23:13 > Device1, response received: {"type":"registered","id":"register_0","payload":{"client-key":"e1bf163e389129cf459b96b761e4cd48"}}
Wed 15:23:13 > Device1, established contact: Display is powered ON.
Wed 15:23:14 > Device1, repeating WOL broadcast ended

Please note that I powered on the monitor manually.

Running LGTV Companion 1.2.0 under Windows 10 21H1.

TV is connected via wired LAN.

Can you help, please?

LG not start when pc run.

Hi,
I try my best, but porgram not start when I turn on PC.
turn off seems work well, but only that.

(Support) Any way not to shutdown TV when input source is not PC?

I've been using my TV for PC monitor and PS5 (and sometimes netflix) as well

When I switch input source to PS5, the TV still turn off if I leave the PC idle long enough to off the screen

Is there any workaround so when I am playing PS5 the TV won't turn off automatically? Thanks

LGTVCompanion stopped automatically turning TV off/on

Hello,

I have had LGTVCompanion working on my PC for several weeks, but within the past week, I noticed my TV is no longer automatically turning on/off as it had been. This is a little odd to me because I don't think I changed anything.

While attempting to diagnose the issue, I discovered that if I manually restart the LGTVCompanion service, the TV will turn on every time. Similarly, if I open the LGTVCompanion application and manually click the "Turn On" button, the TV will also turn on every time. For some reason, it just won't automatically turn off/on like it had been doing for several weeks.

I am running Windows 10 19044.1806 and using an LGOLED48C1PUB.

Has this behavior been seen before by others?

LGTVlog.txt

1.5.0 new idle feature not tiggering

I haven't been able to get the idle feature to trigger with 1.5.0 under Windows 11.

I was testing using a 1 min timer at just the Windows desktop.

Ethernet Cable Connected LG C1 TV Not Powering on using program's manual and automatic command

I can turn off the tv fine manually and automatically, and , surprisingly, the tv turns on(from off-state) when I issue a manual turn off command.

I have tried all three options in the configure menu.
The logs show that the program is able to communicate with the display:

*My setup : I have shifted DHCP giving capability from my home router to a raspberry-pi running PiHole *

The mac-addresses match in the program, PiHole, and on the tv
*The LG C1 is on latest firmware update - 03.20.80 *
I removed the mac address and client key

Wed 12:25:18 > LGTV Companion Service started (v 1.4.2) ---------------------------
Wed 12:25:18 > Configuration file successfully read
Wed 12:25:18 > Data path: C:\ProgramData\LGTV Companion
Wed 12:25:18 > Device1, [LG] webOS TV OLED48C1PUB, with IP 192.168.1.51 initiated (Enabled:yes, WOL:1, Pairing key:, MAC: )
Wed 12:25:18 > Host IPs detected: 172.23.112.1, 172.31.80.1, 172.27.128.1, 192.168.1.74
Wed 12:25:18 > Setting shutdown parameter level 0x1E1
Wed 12:25:18 > ** System requests displays ON.
Wed 12:25:18 > Device1, spawning DisplayPowerOnThread().
Wed 12:25:18 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:18 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:18 > Device1, response received: {"type":"registered","id":"register_0","payload":{"client-key":""}}
Wed 12:25:18 > Device1, established contact: Display is powered ON.
Wed 12:25:20 > IPC command received: -poweroff Device1
Wed 12:25:20 > Device1, spawning DisplayPowerOffThread().
Wed 12:25:20 > Device1, established contact: Display is powered OFF.
Wed 12:25:20 > Device1, repeating WOL broadcast ended
Wed 12:25:24 > IPC command received: -poweron Device1
Wed 12:25:24 > Device1, spawning DisplayPowerOnThread().
Wed 12:25:24 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:24 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:24 > Device1, response received: {"type":"registered","id":"register_0","payload":{"client-key":""}}
Wed 12:25:24 > Device1, established contact: Display is powered ON.
Wed 12:25:26 > IPC command received: -poweron Device1
Wed 12:25:26 > Device1, spawning DisplayPowerOnThread().
Wed 12:25:26 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:26 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:26 > Device1, response received: {"type":"registered","id":"register_0","payload":{"client-key":""}}
Wed 12:25:26 > Device1, established contact: Display is powered ON.
Wed 12:25:26 > Device1, repeating WOL broadcast ended
Wed 12:25:27 > IPC command received: -poweron Device1
Wed 12:25:27 > Device1, spawning DisplayPowerOnThread().
Wed 12:25:27 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:27 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:27 > Device1, response received: {"type":"registered","id":"register_0","payload":{"client-key":""}}
Wed 12:25:27 > Device1, established contact: Display is powered ON.
Wed 12:25:28 > Device1, repeating WOL broadcast ended
Wed 12:25:28 > IPC command received: -poweron Device1
Wed 12:25:28 > Device1, spawning DisplayPowerOnThread().
Wed 12:25:28 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:28 > Device1, repeating WOL broadcast started to MAC: using network broadcast: 255.255.255.255
Wed 12:25:28 > Device1, response received: {"type":"registered","id":"register_0","payload":{"client-key":""}}
Wed 12:25:28 > Device1, established contact: Display is powered ON.
Wed 12:25:29 > Device1, repeating WOL broadcast ended
Wed 12:25:29 > IPC command received: -poweroff Device1
Wed 12:25:29 > Device1, spawning DisplayPowerOffThread().
Wed 12:25:30 > Device1, established contact: Display is powered OFF.
Wed 12:25:30 > Device1, repeating WOL broadcast ended

What is the point of the new user idle "turnOffScreen" feature?

I see the latest version has a new feature to send the TV a turnOffScreen command if the user has been idle for some period of time.

I don't understand the point of the feature. Can't the exact same result be achieved simply by using a blank Windows screensaver?

image

The release notes mention "enhanced burn-in protection and power savings".

For burn-in, my understanding is that displaying a black screen (as the Windows screensaver does) is enough to prevent burn-in (is there evidence to the contrary?).

For "power savings", I just checked with a power meter: my G1 uses the exact same amount of power (56 W) when using turnOffScreen, compared with Windows sending a black screensaver to the TV. The only way to make the TV use less power is to turn it off completely (3.5 W).

So in light of the above, I'm genuinely curious what use case one could possibly have for this new feature? From where I'm standing, all it does compared to the screensaver is add latency to the screen wakeup.

Feature requests here

Apologies for posting this as an issue rather than on the forum mentioned in the documentation; I don't speak Swedish at all, so didn't feel it was appropriate to join that community.

Would is be possible to add a feature to detect valid inputs on other HDMI port(s), and if lacking them, switch the input back to a specified HDMI port. (The example user story here would be switching back to a PC input after a game console is turned off.)

Stupid question, I'm sure, but how do I install this?

I'm trying to compile it with Visual Studio 2022 after downloading Wix toolset and Wix extension. The build fails due to missing boost/beast.hpp called by Service.h and missing LGTVsvc.exe. Any idea what I'm doing wrong here?

Only Process Events If Active

Great program! But is it possible to only have it process events if the PC that it is running on actually has an active HDMI connection? Not sure if that's possible to detect. Specifically, my use case is that I use a KVM switch and PC1 runs the LGTVCompanion and will send the shut off command after a few minutes of inactivity. But if I switch to PC2 and am currently using it, the TV is then shut off since PC1 send the shut off command. If the LGTVCompanion could detect that PC1 doesn't currently have an active HDMI connection, there's no need for it to process any events or send commands.

LG companion turning tv on when streaming desktop.

Hey there. I typically enjoy using the setting where it blanks the monitor after a couple minutes with no input.
However, it causes a conflict with any remote PC software for gaming such as Steam Link or Moonlight. Problems pretty obvious, I connect to PC, it triggers the LG companion to turn on my tv. Even if I'm hundreds of miles away playing over my phone. Only fix I've found is to go into the settings every morning before I go to work. Disable the feature that blanks the tv. Then remember to turn it back on when I get home. Not sure if Windows Remote Desktop causes the issue I currently have it disabled but I can test it when I get home if you like.

This app was featured in Linus Tech Tips

Hey :) not an issue, but more of a heads up.

In the latest LTT video they briefly talk about this app: https://youtu.be/4mgePWWCAmA?t=20m48s

If you like you could add this as a reference in the readme, e.g. the following quotes could be fun:

That is a really janky solution. But... it works! LTT at https://youtu.be/4mgePWWCAmA?t=21m14s

That was really fast! LTT at https://youtu.be/4mgePWWCAmA?t=21m29s

How cool is Jpersson77! LTT at https://youtu.be/4mgePWWCAmA?t=21m58s

Really great and useful application!

I've been trying this out for a few weeks now, and I just have to say it works exactly as advertised. I really appreciate you and your excellent work.

TV sometimes does not turn on (WiFi broadcast issue?)

I've noticed that, when using LGTVCompanion (any version, including latest master) with my LG G1 over WiFi, the TV would sometimes (not always!) fail to react when asked to turn on (automatically or manually from the LGTVCompanion UI).

This happens once every 2-3 days or so. I am not able to reproduce it on demand. It seems to only happen after the TV has been off for a long time (e.g. a few hours or more). I don't think this is related to "pixel cleaning" since it often happens after the TV has been off for 12+ hours, long after any pixel cleaning routine should have completed.

Every time this happens I try to gather more information by examining network traffic and doing a few Wake-On-LAN experiments. I'm still not 100% convinced I have the full picture but here's what I got so far:

Usually the TV wakes up in response to a broadcast-directed (i.e. destination MAC FF:FF:FF:FF:FF:FF) WoL packet, but when the problem occurs it does not. However it does wake up if I send it a unicast WoL packet. This can be confirmed independently using tools other than LGTVCompanion. For example I managed to demonstrate this using etherwake from a nearby Linux machine - if the broadcast flag (-b) is used the TV will not wake up, but if the flag is omitted it will. To be honest I find it a bit baffling that broadcasts sometimes work and sometimes don't. It's also not clear to me if the TV is truly ignoring WoL packets or if it's my WiFi AP (Ubiquiti Unifi UAP-AC-Pro firmware 6.0.14) that's not transmitting them. I wouldn't be surprised if there was some kind of 802.11 power saving feature that stops broadcasts from being delivered under certain conditions, but honestly I have no idea.

Unicast WoL packets do work, from what I can tell… but the Unicast mode of LGTVCompanion seems to have a different problem that results in similar symptoms, further confusing the issue. I noticed that etherwake in unicast mode always seems to work every single time, but LGTVCompanion in Unicast mode doesn't always work. I strongly suspect this is because the Unicast mode of LGTVCompanion is attempting to send the Unicast packet the "normal way", using the standard UDP/IP mechanism (i.e. socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP), sendto()). The problem is, that mechanism assumes that the target device is in the ARP cache (unlikely if the TV has been off for some time), or that it will respond to ARP requests. There again it looks like sometimes the TV will respond to ARP requests while off, and sometimes it won't, similar to how it sometimes ignores broadcast WoL packets. (In fact it might be the exact same root cause, since ARP requests are broadcast packets!) If ARP doesn't work, then attempting to send a UDP packet to the TV the normal way will simply not work. This can be verified using a sniffer like Wireshark, which won't show any WoL packets going out, showing unanswered ARP requests instead. This is precisely what one would expect. etherwake is immune to this problem because it uses raw sockets and puts the WoL payload directly inside an Ethernet frame - it doesn't use IP at all, and is therefore not reliant on ARP.

Assuming that my hypothesis is correct and that the issue truly lies with broadcast packets (either ARP packets or the WoL packets themselves) not being delivered to the TV over WiFi, then it looks like there are two possible fixes:

  • Use LGTVCompanion in Unicast mode but have the user add a permanent static entry to the Windows ARP table so that the packet will go out even if the device is not responding to ARP requests.
    • I tried using netsh to do this but was unsuccessful. However I just discovered the existence of New-NetNeighbor and it looks like I was able to add a proper ARP override using that command. Now that I have the ARP static entry I've switched LGTVCompanion to Unicast mode and will report back after a few days…
  • Improve LGTVCompanion so that it can send Unicast WoL packets without depending on ARP. Most likely that would mean changing the code to use raw sockets and craft the Ethernet payload directly like etherwake does, perhaps as a fourth "mode" of operation. This seems like a better long-term solution since it doesn't require the user to do anything, beyond selecting this new mode in the LGTVCompanion options.

Duplicate restart words in Additional Options section?

I didn't notice this in 1.6.1, but in 1.6.2 - there appears to be duplicates of shutdown and power off in the "Additional options" section. Is this a typo or there by design? If by design, what are the differences?

image

Only turn off the TV and shortcuts

Hello,
I wanted to know if it is possible to just synchronize the turning off of the TV
I also wanted to know if I can only use the shortcuts, if I uncheck "restart" in the settings the shortcuts don't work
Thank you very much

(Support) Interaction with enabling/disabling TV input (TV wakes up despite not being enabled)

Following use case:

  • Display profile management software with hotkeys (Monitor Profile Switcher)
  • "Desktop" profile which enables my 3 desktop monitors and disables the LG TV
  • "TV" profile which disables the desktop monitors and enables the LG TV

When I'm in my "Desktop" profile and wake the PC from screensaver/screen off, LGTV Companion seems to send a wakeup signal to the TV.

This then leads to my monitors freaking out for a while, trying to manage display modes. I assume this has to do with HiDPI settings and HDR. It takes like 20 seconds for my monitors to stop turning on/off.

Then, the TV is on, but not showing anything (as the Windows display is disabled). I didn't want it to be on, since I turned it off in Windows display settings!

image

In this image, the TV is input 3, and this depicts my "Desktop" profile.

Questions:

  • Can the wakeup signal only be sent if the display is enabled?
  • Can I also disable any other interaction (auto enable monitor on startup, etc.) if the display is disabled?

Essentially, I'd like to use the LGTV Companion features when I'm in the "TV" profile, but not when I'm in the "Desktop" profile.

Use case involving a KVM, could use your advice

Hey, this piece of software is absolutely amazing - I used to mess around with some early scripts back in the day that would hit the TV's APIs unreliably, but this makes it all 100x better.

My use case is the following, I use the TV as a monitor that's hooked up into an HDMI (KVM) switch. I have my Windows desktop as one source, and my Mac laptop as another source. I have LGTV Companion installed on Windows, but as soon as I switch to the Mac it turns off the TV which is not desired in my use case, but functions as intended.

I was wondering if you can think of any alternative of how we could make this work whenever one of the computers is controlling the TV (to disable functionality from the other client).

Cheers and thanks again for this awesome software!

Screen State Toggle

The command line arguments are excellent. I wrote a dumb system tray icon UI to execute the commands, so instead of seven awkward remote control button presses, I can turn the screen on with my mouse.
I still have to pick the command to run from a menu depending on what the current state is though, so I'm hopeful that you might be able to add a screentoggle to the commands so that regardless of whether the screen is on or off, one call to this command would invert it. Same for the TV's power state.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.