Deactivate Power Off button on Remote

Hi guys,

I have a problem. I connected my PI with my Loewe TV and Kodi works with the remote of my TV via HDMI CEC very well.

But everytime when I press the power off button, the Pi will shutdown and not the TV. Then I have the struggle to turn on the PI manually and that’s what I don’t want.

If I press the power button I want to have the TV will shutdown and not the Pi or just deactivate the power off button for HDMI-CEC.

I found some solutions via Keymap Editor but I don’t know how to do it correctly.

I would be happy if anybody of you can help me.

Yours sincerely

Check out the CEC settings:

Settings > System > Input > Peripherals > CEC Adapter

The ‘When TV is switched off’ setting is what you are looking for.

I have not heard of a TV remote forwarding a power button via CEC but to get a better understanding of exactly what is going on please reboot the RPi, then when it boots back up go to settings>system>logging> and enable the “enable debug logging” option. Now press the power button and if it shuts down the RPi and not the TV like your saying pull the power cord and then plug it back in. Once it boots back up open the My OSMC add-on and upload logs. After a delay it should return a url that you will need to post in this thread.

It’s even ok, if I can deactivate the power off button. So it’s not necessary when I press the power off button the TV should be off.

In order to help you change the behavior your seeing we need to know exactly what is being received from the TV and what Kodi is doing with that input. If you can provide logs using the method I outlined above then this should not be too hard of an issue to solve.

I have log on this link:
I hope you can open it. It’s a video log and I uploaded on a trusted video upload hoster.

This is not useful. Please follow the simple instructions provided


I’m extremly sorry for sending the video. This was the quickest way. Anyways, I tried to catch the same error with PuTTY but I couldn’t. This is the log before I turned off:

osmc@UBR:~$ tail -f .kodi/temp/kodi.log
    2020-09-04 18:33:38.000 T:1915430448   ERROR: COMXTexture::Decode m_omx_egl_render.WaitForOutputDone result(0x80001011)
    2020-09-04 18:33:38.000 T:1915430448  NOTICE: DecodeJpegToTexture: unable to decode to texture special://skin/extras/backgrounds/primary.jpg 1280x720
    2020-09-04 18:33:38.098 T:1732846304  NOTICE: Register - new cec device registered on cec->RPI: CEC Adapter (2708:1001)
    2020-09-04 18:33:40.026 T:1915430448   ERROR: COMXCoreComponent::WaitForCommand OMX.broadcom.egl_render wait timeout event.eEvent 0x00000000 event.command 0x00000000 event.nData2 2
    2020-09-04 18:33:40.027 T:1915430448   ERROR: COMXCoreComponent::WaitForCommand - OMX.broadcom.egl_render failed with omx_err(0x80001011)
    2020-09-04 18:33:56.003 T:1500504800  NOTICE: Skin Helper Service --> WebService - start helper webservice on port 52307
    2020-09-04 18:33:56.066 T:1682227936  NOTICE: Skin Helper Service --> Skin Helper Service version 1.1.3 started
    2020-09-04 18:34:39.417 T:1915430448 WARNING: Skin has invalid include: contentpanelslide
    2020-09-04 18:34:39.421 T:1915430448   ERROR: Control 101 in window 13001 has been asked to focus, but it can't
    2020-09-04 18:34:56.064 T:1766892256   ERROR: DoWork - Direct texture file loading failed for resource://resource.images.weathericons.default/
    2020-09-04 18:35:59.696 T:1915430448 WARNING: Skin has invalid include: contentpanelslide
    2020-09-04 18:35:59.700 T:1915430448   ERROR: Control 101 in window 13001 has been asked to focus, but it can't

Now I get this when I turn off the Pi with my TV remote but the video had some content with CEC and this has nothing about it. I can write out you the error text from the video.

2020-09-04 18:36:13.056 T:1915430448  NOTICE: Stopping player
2020-09-04 18:36:13.057 T:1915430448  NOTICE: Stopping all
2020-09-04 18:36:13.058 T:1915430448  NOTICE: ES: Stopping event server
2020-09-04 18:36:13.217 T:1647297248  NOTICE: ES: UDP Event server stopped
2020-09-04 18:36:14.020 T:1915430448  NOTICE: stopping zeroconf publishing
2020-09-04 18:36:14.030 T:1915430448  NOTICE: CWebServer[80]: Stopped
2020-09-04 18:36:14.030 T:1915430448  NOTICE: stop dvd detect media
2020-09-04 18:36:14.579 T:1707668192 WARNING: CPythonInvoker(0, /usr/share/kodi/addons/script.module.osmcsetting.updates/ the python script "/usr/share/kodi/addons/script.module.osmcsetting.updates/" has left several classes in memory that we couldn't clean up. The classes include: N14PythonBindings31XBMCAddon_xbmc_Monitor_DirectorE,N9XBMCAddon7xbmcgui12ControlImageE,N9XBMCAddon7xbmcgui6WindowE
2020-09-04 18:36:14.580 T:1682227936  NOTICE: Skin Helper Service --> Shutdown requested !
2020-09-04 18:36:14.593 T:1682227936  NOTICE: Skin Helper Service --> Skin Helper Service version 1.1.3 stopped
2020-09-04 18:36:14.915 T:1915430448  NOTICE: Application stopped
2020-09-04 18:36:15.116 T:1915430448  NOTICE: XBApplicationEx: destroying...
2020-09-04 18:36:17.389 T:1915430448  NOTICE: unload skin
2020-09-04 18:36:17.500 T:1915430448  NOTICE: unload sections

Why can’t you just type grab-logs -A and provide the resulting link?

DEBUG: PushCecKeypress - received key a7 duration 0 (rep:0 size:0)
DEBUG: PushCecKeypress - added key a7
DEBUG: HandleKey: 167 (0xa7, obc88) pressed, action is Down
DEBUG: PushCecKeypress - received key a7 duration 434 (rep:0 size:0)
DEBUG: PushCecKeypress - ignored key a7
DEBUG: Thread JobWorker 1766982368 terminating (autodelete)
DEBUG: PushCecKeypress - received key c4 duration 0 (rep:0 size:0)
DEBUG: PushCecKeypress - added key c4
DEBUG: HandleKey: rewind (oxc4) pressed, action is ShutDown()
DEBUG: LogindVPowerSyscall - inhibit lock taken, fd 40
DEBUG: ----- Windows Init (DialogBusy.xml) -----

This was the output from the video

This is the link:

But in it there isn’t a CEC output.

Thank you guys for your help. Right now I found a conversation and the solution helped me from this struggle.

That is because debug logging was not on. I was quite specific on my instructions on how to generate useful logs for this issue.

Exactly what keymap worked for your setup?

FYI if you open the keymap editor add-on it will destroy the custom keymap you made. It is probably best to remove it so you don’t accidentally mess up your patch.

thank you for the information. Yesterday I felt your information because I installed the Keymap Editor again to have a button for changing the video stream (Full Screen Video → Settings → Video Settings → Set Video Stream ‘the first option’) (it’s for the YT addon to change the resolution). I had the button for the resolution change but when I pressed the power off button the PI turned off and the remote.xml was useless.

My question is:
How can I set the button for changing Video Stream in the remote.xml? I have a Loewe TV and my remote is in the attachment. I used the PIP button for the changing resolution. It’s ok, when I have to choose another button.

Thank you for your help before and sorry if I confuse some people with my individual wishes.

Greetings from Germany


The keymap editor addon would have made the file ~/.kodi/userdata/keymaps/gen.xml and you can either just add the previous noop action to that file or else just rename your other keymap back so it will load again. I think you will find your other keymap renamed to remote.xml.old or something to that effect.

I would be very interested in what that contents of those two keymaps are if you wouldn’t mind posting them in this thread. Just remember to highlight them and use the </> so they show up correctly.

Thank you @darwindesign. It worked. Finally this is the code which worked out for me.



How odd the CEC power command would be seen as a remote input while the PIP button a keyboard. I would probably limit the video action to just video playback so you can use that button for other purposes…

			<key id="44">videonextstream</key>

So I am testing right now the buttons and I prefer the FullScreenVideo mode because it worked better than the global option.
Thank you again @darwindesign :pray:t5:

1 Like