Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

[MOVED] TP-Link Smart Plug

If you have a question or need help, this is the place to be.
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Smart Plug

Post by kgschlosser »

Updated the Device information
Added toggle actions
If you like the work I have been doing then feel free to Image
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

kgschlosser wrote:hey quick question... what devices are you able to test this with. and what features do they have

Only can test plug state. I don't have a bulb and i dont have a fancy TP link adapter. Definitely would love to get them some day, but its hard to justify spending money on a light switch when its 20+. If i see a good deal and get one i'll buy and test it. I use a google home as well as my phone to toggle the light switches. I also use the sunset tracker to turn on my light when I come home. Still coming up with more ideas for the switches!

-Flyingsubs
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Smart Plug

Post by kgschlosser »

LOL @ 20 dollar light switch... mine were about 75 each. I would have loved to have spent 20 a piece on mine. I did get mine a bunch of years back before the prices dropped. I think mine are now something like 50 but still.. and I replaced all of the major switches. not the closets and such yet.
If you like the work I have been doing then feel free to Image
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

kgschlosser wrote:Updated the Device information
Added toggle actions

Was going to test your other request of downloading the TP link app and see if it would trigger it. On downloading the new pluggin i'm getting this error now. Is there anyway to upgrade to a later plugin without having to do a fresh install by deleting the file in the program data folder? Thanks!! How many smart switches do you own? What company? I have a wemo switch and i have a python script i run to toggle, I was thinking potentially could modify your plugin to make a WEMO one as well. Not as many features tho based on the script.

21:56:45 Traceback (most recent call last) (0.5.0-rc2):
21:56:45 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
21:56:45 self.Configure(*args, **kwargs)
21:56:45 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
21:56:45 treeItem.Configure(*args)
21:56:45 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
21:56:45 return self.executable.Configure(*args)
21:56:45 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 806, in Configure
21:56:45 self._check_device
21:56:45 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 659, in __init__
21:56:45 SetData()
21:56:45 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 624, in SetData
21:56:45 d, seconds = on_time.days, on_time.seconds
21:56:45 AttributeError: 'datetime.datetime' object has no attribute 'days'
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Smart Plug

Post by kgschlosser »

give this a try and see if it works now.
If you like the work I have been doing then feel free to Image
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

kgschlosser wrote:give this a try and see if it works now.

I get his error on start up, not sure if its related.

23:06:52 Error compiling script.
23:06:52 Traceback (most recent call last):
23:06:52 SyntaxError: invalid syntax (21, line 6)
23:06:52 Traceback (most recent call last) (0.5.0-rc2):
23:06:52 File "wx\_core.pyc", line 16766, in <lambda>
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Core.py", line 218, in Notify
23:06:52 listener(value)
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 801, in OnNodeSelected
23:06:52 path = node.GetPath()
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Classes\TreeItem.py", line 284, in GetPath
23:06:52 path.append(parent.childs.index(item))
23:06:52 ValueError: tuple.index(x): x not in tuple
23:06:52 Error compiling script.
23:06:52 Traceback (most recent call last):
23:06:52 SyntaxError: invalid syntax (23, line 9)


hmmm, I get this error when i use the pluggin

23:07:41 Traceback (most recent call last) (0.5.0-rc2):
23:07:41 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
23:07:41 self.Configure(*args, **kwargs)
23:07:41 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
23:07:41 treeItem.Configure(*args)
23:07:41 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
23:07:41 return self.executable.Configure(*args)
23:07:41 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 823, in Configure
23:07:41 self._check_device
23:07:41 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 676, in __init__
23:07:41 SetData()
23:07:41 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 646, in SetData
23:07:41 datetime.now().total_seconds() - on_time.total_seconds()
23:07:41 AttributeError: 'datetime.datetime' object has no attribute 'total_seconds'
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Smart Plug

Post by kgschlosser »

give this one a try. this date thing is kickin my *#@
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Smart Plug

Post by kgschlosser »

Flyingsubs wrote: 23:06:52 Error compiling script.
23:06:52 Traceback (most recent call last):
23:06:52 SyntaxError: invalid syntax (21, line 6)
23:06:52 Traceback (most recent call last) (0.5.0-rc2):
23:06:52 File "wx\_core.pyc", line 16766, in <lambda>
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Core.py", line 218, in Notify
23:06:52 listener(value)
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 801, in OnNodeSelected
23:06:52 path = node.GetPath()
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Classes\TreeItem.py", line 284, in GetPath
23:06:52 path.append(parent.childs.index(item))
23:06:52 ValueError: tuple.index(x): x not in tuple
23:06:52 Error compiling script.
23:06:52 Traceback (most recent call last):
23:06:52 SyntaxError: invalid syntax (23, line 9)

this looks like 2 separate PythonScript Errors. Does it do this if the plugin is not loaded??

if it is a Python script error since you are running EG 0.5 then the script that has the error would be getting selected in your config tree every time you start EG.

so the first one is telling you line 6 of script number 21. but there is an error when it goes to select that one. possibly because it's in the process of selecting the next one.

which the error is going to be on line 9 it's usually from a punctuation issue. So the Python script that is selected in your tree is the one with the error and the error is on line 9. and i bet when you fix that one then the first will be automatically selected
If you like the work I have been doing then feel free to Image
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

kgschlosser wrote:
Flyingsubs wrote: 23:06:52 Error compiling script.
23:06:52 Traceback (most recent call last):
23:06:52 SyntaxError: invalid syntax (21, line 6)
23:06:52 Traceback (most recent call last) (0.5.0-rc2):
23:06:52 File "wx\_core.pyc", line 16766, in <lambda>
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Core.py", line 218, in Notify
23:06:52 listener(value)
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 801, in OnNodeSelected
23:06:52 path = node.GetPath()
23:06:52 File "C:\Program Files (x86)\EventGhost\eg\Classes\TreeItem.py", line 284, in GetPath
23:06:52 path.append(parent.childs.index(item))
23:06:52 ValueError: tuple.index(x): x not in tuple
23:06:52 Error compiling script.
23:06:52 Traceback (most recent call last):
23:06:52 SyntaxError: invalid syntax (23, line 9)

this looks like 2 separate PythonScript Errors. Does it do this if the plugin is not loaded??

if it is a Python script error since you are running EG 0.5 then the script that has the error would be getting selected in your config tree every time you start EG.

so the first one is telling you line 6 of script number 21. but there is an error when it goes to select that one. possibly because it's in the process of selecting the next one.

which the error is going to be on line 9 it's usually from a punctuation issue. So the Python script that is selected in your tree is the one with the error and the error is on line 9. and i bet when you fix that one then the first will be automatically selected


Yeah I still get the error, but its different if i delete all the plugin files. Anythoughts? Not sure if i had this error before.


08:01:52 Error compiling script.
08:01:52 Traceback (most recent call last):
08:01:52 SyntaxError: invalid syntax (21, line 6)
08:01:52 Error compiling script.
08:01:52 Traceback (most recent call last):
08:01:52 SyntaxError: invalid syntax (23, line 9)
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Smart Plug

Post by kgschlosser »

I would need a copy of your tree to see. you can PM it to me if ya like
If you like the work I have been doing then feel free to Image
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

kgschlosser wrote:I would need a copy of your tree to see. you can PM it to me if ya like
how do i find the tree?
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Smart Plug

Post by kgschlosser »

your EG save file. if running RC2 or one of the Betas it will have the extension .egtree otherwise it will have the extension .xml
If you like the work I have been doing then feel free to Image
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

kgschlosser wrote:your EG save file. if running RC2 or one of the Betas it will have the extension .egtree otherwise it will have the extension .xml

PMed you my XML. THanks!!
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Smart Plug

Post by kgschlosser »

ok you are all set buddy. i got rid of the errors. new tree is in a PM
If you like the work I have been doing then feel free to Image
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

Flyingsubs wrote:
kgschlosser wrote:your EG save file. if running RC2 or one of the Betas it will have the extension .egtree otherwise it will have the extension .xml

PMed you my XML. THanks!!
Thanks! Fixed the script, i guess i had an orphened macro. So this is the error now that we get trying out your pluggin. I see the event of the ip address of the devices found. Thanks again for the help. I feel like we are close. I guess the toggle part introduced some more compilations. THis is fun testing


21:45:14 Traceback (most recent call last) (0.5.0-rc2):
21:45:14 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
21:45:14 self.Configure(*args, **kwargs)
21:45:14 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
21:45:14 treeItem.Configure(*args)
21:45:14 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
21:45:14 return self.executable.Configure(*args)
21:45:14 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 823, in Configure
21:45:14 self._check_device
21:45:14 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 676, in __init__
21:45:14 SetData()
21:45:14 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 646, in SetData
21:45:14 datetime.now().total_seconds() - on_time.total_seconds()
21:45:14 AttributeError: 'datetime.datetime' object has no attribute 'total_seconds'
Post Reply