Python Script on Windows

Python and python framework

Moderator: leecollings

Post Reply
ilpier
Posts: 31
Joined: Friday 24 February 2017 12:01
Target OS: Windows
Domoticz version:
Contact:

Python Script on Windows

Post by ilpier »

Hello to everyone, i have domoticz installed on a Windows 10 PC and i would use the script to control an LG 2012 TV.
Can I use this Python script on a pc windows?
https://www.domoticz.com/wiki/LG_2012_smart_tv
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Script on Windows

Post by zak45 »

Hi,
python work well on my W10 PC.
ilpier
Posts: 31
Joined: Friday 24 February 2017 12:01
Target OS: Windows
Domoticz version:
Contact:

Re: Python Script on Windows

Post by ilpier »

But i don't find an "how-to" for use this script in domoticz!Can you help me?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Script on Windows

Post by zak45 »

sorry, do not have LG TV, but this look like command line script; Just follow wiki. After configured, you should be able to send the command via this way:
python your_script.py xxx
where xxx is the code you want to send.
Of course, all of that could be put on cmd file and executed on Domoticz via LUA script or put on the on/off action of a device etc ...

Hope this help a little!
ilpier
Posts: 31
Joined: Friday 24 February 2017 12:01
Target OS: Windows
Domoticz version:
Contact:

Re: Python Script on Windows

Post by ilpier »

thx Zak45 but i have more question!
i've put .py witch copy/past of code in (https://www.domoticz.com/wiki/LG_2012_smart_tv) in c:\domoticz\scripts\lgtvcommand.py
now i have to create a dummy switch for On command with the final "xxx" code for on?
CommandLG.JPG
CommandLG.JPG (42.27 KiB) Viewed 2471 times
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Script on Windows

Post by zak45 »

I would do it in this way:

create c:/domoticz/scripts/lgtvcommand.cmd with this on it:
cmd /c python c:/domoticz/scripts/lgtvcommand.py %1

on the On action:
script://c:/domoticz/scripts/lgtvcommand.cmd xxx
ilpier
Posts: 31
Joined: Friday 24 February 2017 12:01
Target OS: Windows
Domoticz version:
Contact:

Re: Python Script on Windows

Post by ilpier »

Thx Zak!
cmd don't work but with .bat all work fine!
Unfortunately I found that the power off TV does not turn on! while all the other commands, once tv turned on, work. Can I put more than one command in the same switch? For example, to set a different source I should send "input" + 3 times " Right arrow "+" send "
It's possible?



Inviato dal mio iPhone utilizzando Tapatalk
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Script on Windows

Post by zak45 »

yep... with script.. I would say ... limit is your imagination ;-)
you just need to learn a little bit on that!
Sheffield42
Posts: 3
Joined: Monday 23 October 2017 7:33
Target OS: Windows
Domoticz version:
Contact:

ioperamini

Post by Sheffield42 »

Download smarter With Opera Mini, you could download numerous Opera Mini APK provided rather a lot of rewards for the surfing globe.
Kelliher846
Posts: 1
Joined: Friday 29 December 2017 12:41
Target OS: Windows
Domoticz version:
Contact:

Re: Python Script on Windows

Post by Kelliher846 »

Designers have in fact brought this unbelievable application service for you. musicallyloginonline.com go into the Musically community.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest