How to send command by KODI?

http://kodi.wiki/view/List_of_built-in_functions
Check System.Exec

But maybe that is not what you are looking for because it seems you used that before