CEC Remote not working after calling cec-client CLI command


I’m trying to automate some processes with my Raspberry Pi.
For that I would really like to be able to turn on my receiver and/or TV via CEC.
My issue is that if I try to execute a cec-client command via CLI to fire up the TV (echo “standby 0” | cec-client -d 1 -s) Kodi seems to lose the connection to the CEC-client which results in me no longer being able to control Kodi with my remote control.

I’ve found a few people with the same issue (Here and here) but none of the threads have any answers on how to solve this problem.

From what I understand there can only be one connection to the com port that the CEC adapter is running on. So when I manually call the cec-client via commandline then Kodi loses the connection.

Does anyone have any suggestions on how to solve this problem?
The only idea I’ve had so far has been to somehow add some custom commands for “xbmc-send” which in turn would allow me to tell Kodi which CEC command to execute instead of calling the cec-client directly. However I have no idea if that is even possible.

Thanks in advance!

Device: (Rasp Pi 2
Peripherals: Onkyo TX-NR609, Samsung D7000
OSMC version: 2015.07-1"
XBMC version: 15.1-RC1
Audio/Video Output: HDMI

I think Pi’s CEC driver supports shared mode access. So this should not cause an issue.


The issue as far as I can see, is that cec-client presents itself as a different CEC “device” to the TV causing the TV to think that a different device (not Kodi) is now connected to that HDMI port. Notice that the name is “recorder” and not “Kodi”.

With some TV’s this can cause the TV to get confused about what devices are connected and to “disconnect” the CEC device. After that you would need to go into CEC settings on your TV and scan for CEC devices again - on my Samsung TV I can do this, on my LG TV I cannot.

If you only want to put the TV to sleep a better way to do it is call the Kodi builtin function CECStandby using xbmc-send:



xbmc-send -a 'CECStandby'

Because it is now Kodi sending the CEC standby command instead of cec-client, there is no conflict to confuse the TV.

That makes sense!
Do you know if it would solve the problem if I changed Kodi to identify as “recorder” aswell? If that is even possible?

For my project I need to be able to wake every device independently so I can’t use the built in functions in Kodi.
As mentioned in my first post it might be a solution if I can add custom functions to Kodi - I have however been unable to find any documentation on the matter.

I tried the xbmc-send -a ‘CECStandby’ function but my Samsung tv doesn’t respons to that. OSMC only returns

Sending action: CECStandby

That’s it, nothing further happens.

But aside that, Kodi has not a startup function built in, and that is also a function I would like to use.

Running OSMC July 2015 version (based on Kodi 15 and therefore libcec 3.0 ) raspberry 2B
TV is a samsung year 2014 model. UE50HU6900

Only way for me to get it working is to issue the following (restart OSMC) after each cec-client command;

sudo systemctl restart mediacenter

But indeed, this is a bit harsh, but at least it is reliable. But still hoping for a solution to use the cec-client while keeping the link with OSMC.

For CEC Standby to work on your TV you have to enable something along the lines of “Automatic standby” in the Anynet settings on the TV.
Be wary of that function tough - For me it is completely useless since it also makes the TV turn on when I turn on my surround receiver.

CEC commands in Kodi are broken in Jarvis, fixed in Krypton

Hi mrDach, did you manage to find a solution to this issue? I am trying to monitor cec status of my receiver however when I echo the command I lose remote control.


Sadly not.
I kinda gave up on the whole project since it seems like CEC isn’t quite where I would like it to be with the ideas I had in mind.