How to LG TV power off via KODI power off



  • This script will turn off LG TV (> 2011) when you turn off the TV box (via KODI power menu, remote controller or button on the box).
  • LG smart TVs are very known for their very bad implementation of HDMI CEC protocol, at least old TV models <2015 (does not support power off via CEC command)


  • LG TV >2011
  • TV connected to the same network as TV BOX
  • Mecool KIII PRO (S912), CoreELEC 8.90
  • Putty or similar SSH software

Integration process: (1.4 KB)

  1. Copy service file shutdown_with_net.service to folder /storage/.config/system.d/
  2. Put your shutdown script to folder /storage/.config/
  3. Put your python script to folder /storage/.config/
  4. Edit python script and set TV ip address and paring key
  5. Pairing key could be found also by running script sh with TV IP address and pairing random key, once executed in the shell, TV displays pairing your key
  6. Set permissions for the service and scripts chmod 755 and chmod 755 and chmod 755 shutdown_with_net.service
  7. Start the service, systemctl enable shutdown_with_net.service
  8. Restart the box

Reference readings which lead to functional script:


Does this mean I can press the power off button on the remote control, while in kodi, and it will also power off my LG TV? If so, will it also power on my LG TV when I press the power key on my remote control to power on my CE box?


Did you read the first line in the How To?


Yes and I saw that line clearly says it will turn OFF the LG TV. However, where will I find the information if it will turn ON the TV.


It will not (or it would say power on and off )
Once the box is off, how can this shutdown script (hint) do anything else? :thinking:


@Habibie, as Poida said, script is just for powering OFF LG TV. It has no influence to power on sequence.

For power ON LG TV via TV BOX, this does not work now for me in CoreELEC but it does work with Android stock 7.1.1 firmware KIII PRO. So I am expecting either wrong config of CEC driver for LibreELEC / CoreELEC or wrong system setup on my side (I was not able to power on the TV even by using cec client commands). I am planning to make a test to go back to Android image again and re-run clean CoreELEC and LibreELEC from SD card in order to verify if it works or not.

I did mention the issue in the forum but no feedback so far.


OK and that is understood.