Das ist eigentlich ein Englisches Forum und du wirst sicherlich mehr erfolg haben wenn du das ganze in englisch "beschreibst" 
also der Befehl um das ganze in Kodi selber zu machen via shell/bash ist
kodi-send --action='SetVolume(50,showVolumeBar)' (statt 50 -> 1-100)
für das Python script (ohne das irgendwie getestet zu haben)
def rotaryChange(direction):
volume_step = 5
volume = readVolume()
if direction == 1:
os.system("sudo amixer set PCM -- "+str(min(100,max(0,volume + volume_step)))+"%")
else:
os.system("sudo amixer set PCM -- "+str(min(100,max(0,volume - volume_step)))+"%")
zu
def rotaryChange(direction):
volume_step = 5
volume = readVolume()
if direction == 1:
os.system("kodi-send --action='SetVolume(%,showVolumeBar)'")
else:
os.system("kodi-send --action='SetVolume(%,showVolumeBar)'")
ich bezweifel stark das das direkt geht durch ' und "
Minimum wäre
os.system("kodi-send --action="SetVolume(%)"")