Yes, according to the documentation it should work.
Quoting http://kodi.wiki/view/keymap#Commands:
6 Commands
[…]
In addition to the following actions, you can also use Built-in scripting in Kodi.
Further down on that page under 6.2 Functions the builtins CECActivateSource, CECStandby, CECToggleState
are listed explicitly.
Here is a report confirming the behavior.
In addition, using kodi-send --action=CECToggleState
produces the same error:
09:42:37 57279.937500 T:1956897712 ERROR: Keymapping error: no such action 'cectogglestate' defined
Looking more closely into mainline git, it seems that the fix to correctly register the CEC builtins did not make it into Jarvis (16.1).
What I’m trying to accomplish here is to correct a nasty CEC interaction between a Samsung TV (UE40F6470) and an Onkyo AV receiver (HT-R558). When the TV is put to standby by its IR remote, it (correctly) switches the AVR to standby via CEC, but almost precisely two hours later, the AVR turns on without user interaction. The only reliable way I’ve found to avoid this is switching the AVR to standby before switching the TV to standby.
Since Kodi builtins did not work, I’ve tried to resolve this using cec-client
, but this takes CEC control away from Kodi, which, when turning TV and AVR back on, makes the AVR switch to the TV source instead of Kodi. To regain CEC control in Kodi, I’ve tried to restart Kodi immediately after running cec-client
, but this makes TV and AV receiver turn on immediately.
This is the script I’ve used:
#!/bin/bash
# Set to standby: first (5) audio, then (0) TV
echo -e "standby 5\nstandby 0\nquit" | cec-client > "${TMPDIR:-/var/tmp}/standby.log"
# Kodi has now lost CEC control
# Restart Kodi to regain CEC control
# DOES NOT WORK: Makes TV and Audio switch on immediately.
sudo systemctl restart mediacenter