Turn TV off with Screensaver (CEC)

I’ve read a few threads about using the Screensaver starting to trigger turning the TV off using the CEC connection, but I’m a little stumped. It worked as soon as I enabled it, worked great… but no longer works and I’m at a loss to explain why.

It was all good, and my testing of the Vero was positive, so I decided to unplug my old media center. While doing that I thought I would take the opportunity to clean and dust the TV and stand, reroute some cables and general tidy up. When I reconnected everything the CEC function did not work at all, no response from the Vero using the TV remote. So I read a thread here which instructed to unplug TV and Vero power, wait 5 minutes and then power the TV up, set to the correct input and power on the Vero. Worked like a charm, everything remote related is back to normal. But the screensaver starting no longer turns the TV off. I’ve tried toggling just about every setting, restarting after each change, different screensaver etc. No way can I seem to get it to work again…

TV is a Panasonic 42" Plasma - model TC-P42UT50

Any ideas?

Cheers,
Robert

Well as usual debug enabled logs might help. Also you should explain what script you have configured to sent the TV Off command and if the command if triggered manual works.

Script? There’s nothing customized here, just go into Settings, System, Input, Peripherals, CEC Adapters and insure CEC is enabled then checkmark the setting to “Put devices in standby mode when activating the Screensaver”. Job done. And it worked perfectly and consistently until I unplugged and rerouted my cables and restarted.

Cheers,
Robert

Then, debug enabled logs. A mechanic cannot diagnose an issue with a car unless he’s allowed to look under the hood.

1 Like

Sure. Enabled debug and libCEC specific logging, waited until screensaver kicked in.

Logs

Cheers,
Robert

There is no “Standby” being initiated in your debug logs. So it might be that the screensaver not triggering it.
to check if the CEC part is working try
echo "standby 0" | cec-client -s
and if that is working try Kodi
kodi-send --action="CECStandby"

That takes me from the screen saver back to the home screen. Looks like a Kodi bug to me.

I’ll try those commands in the morning. To be clear, I issue these via a ssh remote session directly from the command prompt?

What’s really odd is this did work fine through a number of Vero reboots and TV power cycles. It only stopped working after everything was unplugged while I organized cables and then plugged back in and powered up. No config changes were made at all…

Cheers,
Robert

Yes

Also no updates been done in between?

Thanks.

Nope. At least, I didn’t manually force any. All updates were done yesterday and it was after that when I had the Screensaver triggering the TV off.

Robert

Just a thought. When tidying up your cabling did you by any chance change HDMI cables, or choose a different HDMI port on the TV?

This turned the TV off as expected. When I turned the TV back on, CEC remote buttons no longer controlled KODI. I had to reboot the Vero and then I regained the ability to control it via the TV remote.

This did nothing with KODI unless KODI was actively in screensaver mode in which case it stopped the screensaver.

@bluefuzz
Good thought. Yes I did change the HDMI cable to a shorter, higher quality one but it’s plugged into the same TV input as before. But I already tried swapping back to the other one with no difference. As I say, the CEC remote commands are passing through with no problem as I can navigate KODI perfectly with my TV remote.

Cheers,
Robert

Do you get “putting CEC device on standby…” in the debug logs when you execute this?
I am still puzzled how this should have worked before if no software change happen.

When (which date) was the last time this worked for you?

@fzinken

I just now turned on debugging and ran the KODI command again. Found this in the log
" 04:27:00.476 T:4107702272 DEBUG: ToggleDeviceState - putting CEC device on standby…"

This worked fine yesterday and the day before when I enabled CEC in KODI and the TV.

Thanks,
Robert

Ok, I am out of thoughts. For me this either is a Kodi issue (but then it should not have worked before) or it is a cable issue (but then using the same cable and poweroff all devices for a couple of minutes should make it work.

Did you change anything in terms of refresh rate settings or audio always on settings?

I changed nothing in terms of refresh rate, audio or any core hardware settings. But I do recall going through the CEC settings in KODI and disabling “Wake devices when deactivating the screensaver” because I didn’t want any key on the remote to turn the TV back on, just the Power key. I may have “cleaned up” a couple of other CEC settings since I only have a TV and the Vero, no other components, therefore I never switch inputs or have to designate a different source etc. But, I’ve since tried a number of different settings in the CEC device in case there was something required I didn’t realize. I continued this work this morning and…

It’s now working again.

I’ve narrowed it down to one of two settings which I toggled on before it stated working again:

  1. Switch source to this device on startup
    or
  2. Send “Inactive source” command on shutdown.

I don’t know which of these did the trick because I toggled them both on at the same time and when the screensaver kicked in the TV turned off. I’ve since tried toggling them off one at a time, then both together and the TV continues to turn off when the screensaver kicks in regardless of their setting. I hate ambiguous solutions…

I’m happy to continue to test if you’re curious and have any theories, but otherwise job done (fingers crossed).

Thanks for all your help, much appreciated!
Cheers,
Robert

Maybe you can check this.

Is kodi-send --action="CECStandby" also working now?
Also if screensaver now triggers the standby do you get the respective entry in debug log?

I also tried this as it would be great for my setup (with a Plasma), if the screensaver could turn off the TV and turn it back on…

This didn’t help here:

So,

echo "standby 0" | cec-client -s

works as expected and turns the TV off. However,

kodi-send --action="CECStandby"

didn’t work here either and neither did any Kodi command to wake up the TV again.

Is there a version of the echo “standby 0” | cec-client -s command to wake the TV up from standby?

EDIT: Doing, what @Phydeaux tried seems to have worked after I rebooted the Vero 4k. Now the TV is properly turned off when screensaver kicks in and turned back on when I press a button on the remote again. :+1:t2:

Yes, that command now turns the TV off. I turned debugging on just now and sent that command, here is the result from the log:

05:41:12.577 T:4112281600   DEBUG: ToggleDeviceState - putting CEC device on standby...
05:41:12.580 T:3983643632   DEBUG: CecLogMessage - << putting 'TV' (0) in standby mode
05:41:12.580 T:3983643632   DEBUG: CecLogMessage - << 40:36

Cheers,
Robert