Page 1 of 1

Python script for controlling your Smart Lg TV

Posted: Monday 23 November 2015 18:55
by BakSeeDaa
There is a Wiki article describing how to Controlling your Smart Lg TV using a python script.

The Wiki tells me to run the script with python3.

Code: Select all

python3 /home/pi/domoticz/scripts/lgtv2012.py 1
I don't have a python3 executable, I only have python. (I installed Domoticz using the Domoticz Raspberry Pi SD Card Image) If I run it using python I get the error ImportError: No module named http.client Does someone here know what needs to be downloaded? I feel very scared to just try to download python3 as I suspect it can interfere with my Domoticz installation. Thanks a lot :D

Re: Python script for controlling your Smart Lg TV

Posted: Sunday 27 December 2015 12:13
by Panda
I installed python3 using

Code: Select all

sudo apt-get install python3
and have no problems yet on a raspberry pi.

However it won't work for my 2014 LG smart tv model.

Re: Python script for controlling your Smart Lg TV

Posted: Sunday 27 December 2015 13:32
by alfred_j_kwak
Do this help. It says in the top part of the text, that library is only renamed for Python 3. You could try to use old lib. Just change import part of your Python code. "import http.client"

https://docs.python.org/2/library/httplib.html

Re: Python script for controlling your Smart Lg TV

Posted: Tuesday 29 December 2015 0:25
by RayAmsterdam
The script only runs on python3. You can install python3. It runs alongside python without any problem. It works for me, I wrote the wiki.

Verstuurd vanaf mijn ONE A2003 met Tapatalk