Package: kodi-remotecontrol
Python remote control for KodiThis is a Python remote control for Kodi with minimal but sufficient basic controls.
This remote control acts as aWebSocket Gatewayof the UDPEvent ServerAPI for more reactivity.Table of contentsInstallationStart remote controlAvailable buttonsWebsocket clientAboutInstallationPyPIpipinstallkodi_remotecontrolDocker Hubdockerpulldmachard/kodi-remotecontrol:latestStart remote controlAs prerequisite, go toSystem/Settings/Network/Servicesand activate the two following optionsAllow programs on other systems to control KodiAllow control of Kodi via HTTPAfter that, you can start the remote control and provides the address of your kodi server.kodi_remotecontrol --desthost=10.0.0.200Other available options:kodi_remotecontrol --help
usage: kodi_remotecontrol [-h] [--destport DESTPORT] [--desthost DESTHOST]
                        [--bindport BINDPORT] [--bindhost BINDHOST]

optional arguments:
  -h, --help           show this help message and exit
  --destport DESTPORT  destination kodi port default=9777
  --desthost DESTHOST  destination kodi host default=127.0.0.1
  --bindport BINDPORT  bind on port default=8081
  --bindhost BINDHOST  bind on host default=0.0.0.0Available buttonsTo interact with the remote control, you need to use a websocket client and
send the followingJSONcommands to the addressws://<remotecontrol_ip>:8081.UI Navigation{"button":"press_up"}// press on up button{"button":"press_down"}// press on down button{"button":"press_left"}// press on left button{"button":"press_right"}// press on right button{"button":"press_back"}// press on back button{"button":"press_enter"}// press on enter button{"button":"press_ctxmenu"}// display contextual menu{"button":"press_playlist"}// display playlist{"button":"press_logoff"}// press on logoff buttonPlayer interaction{"button":"press_play"}// press on play button{"button":"press_stop"}// press on stop button{"button":"press_pause"}// press on pause button{"button":"press_previous"}// press on previous button{"button":"press_next"}// press on next button{"button":"press_osd"}// display OSDSubtitle selection{"button":"press_subtitle"}// toggle subtitleAudio track selection{"button":"press_language"}// toggle languageWebsocket clientVueJS front endAweb interfacefor this project is available.Basic demoCopy/paste the following html content in a file and open-it in your web browser.
Configure the websocket address.<html><head><title>RemoteControl demo</title><styletype="text/css">.buttons{font-size:1em;display:flex;justify-content:center;}.button{padding:2rem;border:mediumsolid;min-height:1em;min-width:1em;cursor:pointer;user-select:none;}</style></head><body><divclass="buttons"><divclass="play button">Play</div><divclass="pause button">Pause</div></div><script>varwebsocket=newWebSocket("ws://localhost:8081/");varplay=document.querySelector('.play')varpause=document.querySelector('.pause')play.onclick=function(event){websocket.send(JSON.stringify({button:'press_play'}));}pause.onclick=function(event){websocket.send(JSON.stringify({button:'press_pause'}));}</script></body></html>AboutAuthorDenis Machardd.machard@gmail.comLicenseMITPyPIhttps://pypi.org/project/kodi-remotecontrol/