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.
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:
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.
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.
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.
Cheers.