The volume up/down keys on my wifi keyboard affect the PC's volume not the TV's. Is there a way over CEC to control the TV's volume?
Volume keys
-
LybsterKodi -
September 4, 2026 at 3:39 PM -
Thread is Unresolved
-
-
Technically speaking, controlling the TV's volume via CEC is possible. Sometimes, this also depends on the specific TV being used. But I'm not aware of the current KODI state regarding this: CEC volume control of TV and AVR
However, the most important requirement is: Does your PC have a functioning CEC adapter?
-
Does your PC have a functioning CEC adapter?
Yes, I had to buy the gadget and then a special hdmi cable but it works well. I'll have a read of the link.
-
It seems that KODI is still hard coded to the AVR (audio system). So it requires the hacky way.
Create the python script "/storage/.kodi/userdata/keymaps/cec-volume.py".
Python: /storage/.kodi/userdata/keymaps/cec-volume.py
Display More#!/bin/env python3 import sys import os if __name__ == "__main__": key = sys.argv[1] if key == "up": cmd = "cec-ctl -s --to 0 --user-control-pressed ui-cmd=0x41" elif key == "down": cmd = "cec-ctl -s --to 0 --user-control-pressed ui-cmd=0x42" elif key == "mute": cmd = "cec-ctl -s --to 0 --user-control-pressed ui-cmd=0x43" os.system(cmd)And additional the "/storage/.kodi/userdata/keymaps/keyboard.xml" to override the current action mapping of the volume keys of your keyboard.
Code: keyboard.xml<keymap> <global> <keyboard> <volume_down>RunScript(/storage/.kodi/userdata/keymaps/cec-volume.py, "down")</volume_down> <volume_up>RunScript(/storage/.kodi/userdata/keymaps/cec-volume.py, "up")</volume_up> <volume_mute>RunScript(/storage/.kodi/userdata/keymaps/cec-volume.py, "mute")</volume_mute> </keyboard> </global> </keymap>Works with a recent LE 13 nightly. That should work for you, too. But please keep in mind, that's only a workaround.
The correct implementation would be:
- That KODI dynamically switch between TV or AVR depending on the current state of CEC "System Audio Status".
- Only if CEC is disabled (or remote control routing explicit deactivated), the internal volume control of KODI should be used.
-
Thanks for that - I'll have a try later on in the week - currently focused on fence repair