Python script for controlling your Smart Lg TV

Python and python framework

Moderator: leecollings

Post Reply
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Python script for controlling your Smart Lg TV

Post 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
Panda
Posts: 11
Joined: Wednesday 26 August 2015 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Python script for controlling your Smart Lg TV

Post 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.
alfred_j_kwak
Posts: 110
Joined: Friday 20 September 2013 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Finland
Contact:

Re: Python script for controlling your Smart Lg TV

Post 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
RayAmsterdam
Posts: 115
Joined: Sunday 11 January 2015 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python script for controlling your Smart Lg TV

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest