Maassoft / ColorControl

Easily change NVIDIA display settings and/or control LG TV's
GNU General Public License v3.0
984 stars 42 forks source link

Screen off functionality #203

Open L0czki opened 1 year ago

L0czki commented 1 year ago

Hey,

was wondering if it's possilble to add screen off functionality. Power off is nice, but I guess screen off is a bit faster response.

Cheers,

GTMoraes commented 1 year ago

Just screen off, without turning the display off?

You can use the Screen Off feature on Windows's Power Settings

L0czki commented 1 year ago

Hey, yeah, I wrongly assumed that what I'm asking for is a generic thing. What I meant is the screen-off functionality that has been implemented in LG TVs. Currently, if I choose to turn off the screen in Windows, it will of course turn off the output, but then my TV behaves as if there is no input.

I should have been more specific and mentioned that this is regarding the LG controller specifically.

GTMoraes commented 1 year ago

You mean to shut down the TV? This feature is available by default in ColorControl.

Just go to the LG Controller, and tick the "Use Windows Power settings to power on" and the "Use WIndows Power Settings to power off". This way, when Windows turns the display off, ColorControl will send the turn-off signal.

Other way you can do it is to, instead of using the Windows Power Settings option, you use the "Power off when screensaver activates" and "Power on when screensaver deactivates". You can, then, set any screensaver you like (even the blank one). And when the "Power off when screensaver activates" is highlighted on ColorControl, the "S" button on the right side now becomes selectable. In there, you can define how long (in seconds) you want for the screensaver to play, before ColorControl sends the shutdown signal. (btw: Remember to untick the Windows power setting options on ColorControl, and to set Windows to turn display off to "Never")

One thing to bear in mind: It seems that this new feature of turning the display off after X seconds of the screensaver playing is a little bugged, at least on my side. ColorControl crashes on the background and doesn't turn the display off, for the time being.
YMMV, though. It could be an issue on my end only. It hasn't been confirmed by the dev yet.

L0czki commented 1 year ago

Yeah I power it off when screensaver kicks in- that's easy. That's not what I mean. This is LG functionality (but I know it's also in Sony TV), that you turn display off, but the TV is still on. Something like black screen saver - but from hardware perspective I suppose.

https://youtu.be/X8De-T4aTgM?t=35 you can see it here in this vid.

GTMoraes commented 1 year ago

Ah, I understood it, now.

Yeah, that's to be evaluated by the dev if it's a triggerable option.

In any case, technically, running a black screen essentially turns the OLED panel off, as "black" for OLEDs means OFF.
You can use the "Blank" screensaver for that purpose.

If I were to guess, I think that built-in feature is exactly that: just displaying a black image over the display, to "turn it off"

Maassoft commented 1 year ago

Currently it is not easy to to trigger a preset whenever the screensaver starts, but I think it can be done using the "Process switch" trigger, filling in "scrnsave.scr" at the "Included processes" and setting up steps like this: energySaving(screen_off) But then you'll have to make another "default" preset which gets activated in all other cases and disables the energy saving. So that's probably a bit of a hassle, maybe I'll add more trigger options in a new version.

By the way, there was a user requesting something like this before, but found out that running the simple "blank screensaver" from Windows has about the same effect as the the "Energy Saving - Screen Off" setting on the TV. The power usage is virtually the same, so there would be no gain.

ravensergio commented 1 year ago

I was about to suggest the screen off feature, and it could be implemented maybe in Your already S button ( where the delay for the ScreenSaver is. Something like:

Btw, I tried the Process Switch for screen Off, but here Screen Off doesn't work even if I manually set the " Energy Saving-screen_off" - LG C2. It does nothing for me. Everything else seems to work, so is not the connection I'm positive.

running the simple "blank screensaver" from Windows has about the same effect as the the "Energy Saving - Screen Off"

That is true somehow, but I have read that is not exactly the same, since the leds still run power through them, and if you have raised the black level by a bit (not perfect black in blank screensaver) the leds are NOT turning off for sure, so screen Off would be the guaranteed way to go.

Also, Screen Off is preferable over Power OFF since screensaver activates for me in 3-4 minutes ( cause OLED reasons), and Win 10/11 is wierd sometimes and detects no monitor and messes up my resolution, and when I turn the TV back on, icons and windows location/sizes gets messed up. Not always, but it happens here.

For now I resolved this screen off thing via Ahk and HomeAssistant api ( for executing screen off/on) by checking for example the "Mystify.scr" process, and reverting if the process is no more.

vlatko27 commented 1 year ago

Is there a way I can trigger the TV's "Screen Off" function via keyboard shortcut? I'd like to press a shortcut on my keyboard and start the TV's screen off feature, so I don't have to use the remote( using the remote it's; Settings cog, up, up, up, OK). I have an LG C2.

Help appreciated.

ravensergio commented 1 year ago

Is there a way I can trigger the TV's "Screen Off" function via keyboard shortcut? I'd like to press a shortcut on my keyboard and start the TV's screen off feature, so I don't have to use the remote( using the remote it's; Settings cog, up, up, up, OK). I have an LG C2.

You could in theory. For me the command is not working ( unless screen_off is not the one we need): Make a new profile thing in LG Controller tab like this:

image

You may need to make a separate profile/shortcut for Screen On though.

vlatko27 commented 1 year ago

Is there a way I can trigger the TV's "Screen Off" function via keyboard shortcut? I'd like to press a shortcut on my keyboard and start the TV's screen off feature, so I don't have to use the remote( using the remote it's; Settings cog, up, up, up, OK). I have an LG C2.

You could in theory. For me the command is not working ( unless screen_off is not the one we need): Make a new profile thing in LG Controller tab like this:

image

You may need to make a separate profile/shortcut for Screen On though.

Hmm..that does not seem to do anything?

ravensergio commented 1 year ago

It doesn't seem to work for me either, as I said, idk if is not this one or needs its implementation re-checked by @Maassoft . I thought it is just me that has this issue. I could not find another command that should trigger Screen off besides - energySaving -> ScreenOff. If it is the case and this is not working as it should now, then we have to wait for an update or some help from the author maybe.

Maassoft commented 1 year ago

There are 2 more hidden commands that might work on your TV's: 'turnScreenOff' and 'turnScreenOn'. Can you try to use these in the steps? I'll have a look why they are not exposed to the Expert/Actions list.

ravensergio commented 1 year ago

Yep, those commands do work indeed - LG C2. I tested as a shortcut. I should have tried it since in home assistant the command is kinda the same lol: curl .....etcetc... "media_player.lg_webos_smart_tv","http://xxx.xxx.xxx.xxx/api/services/webostv/command","com.webos.service.tvpower/power/turnOffScreen"

Maybe in the future we could have these instead of PowerOff for screensaver then. Thanks.

@vlatko27 -Maybe try this for Your Shortcut option instead of what I said before, use these, should work. Add this as a step (Copy paste to steps , delete other text You have there) - turnScreenOff And same for Screen On - turnScreenOn , as @Maassoft said. Here is working like that.

vlatko27 commented 1 year ago

@ravensergio @Maassoft the commands indeed do work, if I click Apply or select them as a preset they work - however, somehow, they do not activate with a shortcut. I set a shortcut WIN + ALT + X for the command but it does nothing when I press the keys. Can you check on your end?

Snimka zaslona 2023-04-25 211145

ravensergio commented 1 year ago

When testing switch the tab from 'LG controller' go to game launcher or options tab first then try the shortcuts. Here is working properly, I've set up the same shortcut as You, screen turned off.

vlatko27 commented 1 year ago

When testing switch the tab from 'LG controller' go to game launcher or options tab first then try the shortcuts. Here is working properly, I've set up the same shortcut as You, screen turned off.

Heureka, it works! Thanks guys!

Maassoft commented 1 year ago

v9.2.0.0 now has the options accessible via the 'S'-button to turn the screen off instead of powering off the TV.

L0czki commented 1 year ago

Wooot?! thats amazing!

GTMoraes commented 1 year ago

hmmm....

I'd like to bring up a question: Wouldn't, by doing so, prevent the quick screen refresh feature to work? It should come up after around 4h of accumulated usage. Not running that could be damaging to the OLED screen, wouldn't it?

I bring that up because for me, using the TV as a desktop monitor, ColorControl is virtually the only thing that is turning the screen off from time to time. As I don't turn the PC off, like ever, ColorControl is even responsible for turning the TV off when I walk away and sleep through the night.
It also gives time for the TV to run the screen refresh through the day when I go out to run errands, eat something or stuff.

Just bringing a question to the table.

Maassoft commented 1 year ago

Yes, I get what you mean. I was already pondering about an new setting: an extra timeout that gets activated after the screen is turned off and will power off the TV after X minutes. After the TV's screen has been turned off, you have the option to power off the TV after a configurable time. That's should get most cases covered.

ravensergio commented 1 year ago

If ScreenOff instead of power OFF triggers on the screensaver only, then other power off functions could be kept in place. For example, I would have screen off after 3-4 minutes, but if I am not coming back in 1 hr I've set my pc to sleep so the power off on standby or shutdown etc should trigger. But in other cases, if someone doesn't put the pc to sleep etc, they can choose to 'Power OFF' on screensaver like before. Ofc the screenOff is not for prolonged time, I like it because my pc is set to shutdown if idle after 1 hr anyways, so ScreenOff is beneficial to me, faster to wake up after screensaver OFF, my windows don't get messed up (because tv shuts down hdmi when turned off and Windows goes crazy with the resolutions/win positions etc). Recently I learned that if I keep my TV in Always ready mode, the HDMI signal wont get interrupted even on tv power off , but I did not tested. The ScreenOFF works better in my case. Thank You for the update, this is awesome!