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 »

OK fixed last error. I also separated the Switches from the plugs.. I went with a different means of checking what the device is... so I added a new Action. Switch State
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:this has only taken me 2-3 hours so it's not a biggie.. I just posted about this plugin and EventGhost in the forums for TPLink. maybe get more people using eventghost.
I am going to be on here for a while. so if you hang out we can get this bugger almost complete very quickly.

Awesome, I need to go to sleep and work tomorrow, but i'll do my best to keep testing as fast as possible! NIght!

-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 »

OK so here goes.

I fixed the issue with the devices not populating.
I also added some extra goodies to the action dialogs. you will see when you open it.. if everything works properly

I also added another action. this will allow you to get the current electric meter data from a device if the device supports it. You are able to select the day month and year.
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:OK so here goes.

I fixed the issue with the devices not populating.
I also added some extra goodies to the action dialogs. you will see when you open it.. if everything works properly

I also added another action. this will allow you to get the current electric meter data from a device if the device supports it. You are able to select the day month and year.
OMG!!! IT works!! I will test more later but you did add some awesome cool features!! The signal strength meter is really awesome. I will test more when I get home today, but i can confirm my lights are going on and off.
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 »

Glad to hear.

New version

Added Action to change the LED on Switches
Added Action to change LED on plugs
Added Action to change the alias (user supplied name) on any device
Added Action to change the MAC address on any device
Added Action to clear meter data
Added thanks to GadgetReactor for their library
Code cleanup as well
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:Glad to hear.

New version

Added Action to change the LED on Switches
Added Action to change LED on plugs
Added Action to change the alias (user supplied name) on any device
Added Action to change the MAC address on any device
Added Action to clear meter data
Added thanks to GadgetReactor for their library
Code cleanup as well

Works great!!! I tested it out. Do you think we should add a toggle command? I know i can create one with macros in eventghost, but maybe users would want that. Also get meter data didn't have my light displayed, could be because my device doesn't support that. Excellent work, this pluggin is so great an I know many users will use this in the future. I am happy to be apart of it.

On a side note. How did you learn python like this? What you are doing is something I really want to learn and know how to do on my own. Any recommendations?

Thanks,
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 »

I started programming about 2 years ago... never did a lick of it before that. I am 41 years old. so you can learn even if you are rolling down the proverbial hill.

I am 100% self taught. Not even a single book. google is your friend. And the loss of hair is not your friend but come with the trying things over and over and over and over ..... about 100 more overs again. until you get it right and usually once you get it right you will understand why at that point. because you have tried every other way and it failed. I am not even a good programmer. I can mash things together to make them function and it's not always the best looking code or the most efficient. But hey.. it works.

I started by picking a plugin that had some issues with it and I wanted to fix and I also wanted to add some more functionality to. So what i sis was wind things that i really didn't understand and pick a key word in it and used google. Just remember if it starts with eg then it's EventGhost specific and you are better off asking or searching the forum or go and look at the core code, the core code is pretty well split into files. so finding things is not always that hard. and a lot of times reading the code for that eg bit you don't know about will help to give you a better understanding of what it does. It's ok to PM me if you want. I know how it is about not wanting to sound like an idiot if you ask a very basic question in a forum. I am not one of those god complex programmers. I was where you are a very short time ago So i can really appreciate it. and I think I do even more so because of how hard I had to work at it.

and yes I can very easily add some toggle actions i will add that for the next release.

Do me a favor tho. post some screen shots of what the actions look like populated with information.

I will tell you this. that library needed some help. it was written for Python3 But also had some issues.
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:Also get meter data didn't have my light displayed, could be because my device doesn't support that.
That is correct. Your device has to support the meter bits. there are quite a few actions that will not populate with a device if the device does not support that function. like color changing the lights. or dimming them. if the bulb doesn't support it then why even list it in the devices selection? right?. So it doesn't
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:Also get meter data didn't have my light displayed, could be because my device doesn't support that.
That is correct. Your device has to support the meter bits. there are quite a few actions that will not populate with a device if the device does not support that function. like color changing the lights. or dimming them. if the bulb doesn't support it then why even list it in the devices selection? right?. So it doesn't

Works great! Makes total sense to me. Well if i buy another sensor we can see how that one works in the future.

I'm also getting this error on start up, is this related? Thank you so much again for this wonderful plugin
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 »

what error?
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:what error?

Oops sorry forgot to post''20:47:44 Error compiling script.
20:47:44 Traceback (most recent call last):
20:47:44 SyntaxError: invalid syntax (21, line 6)
20:47:44 Traceback (most recent call last) (0.5.0-rc2):
20:47:44 File "wx\_core.pyc", line 16766, in <lambda>
20:47:44 File "C:\Program Files (x86)\EventGhost\eg\Core.py", line 218, in Notify
20:47:44 listener(value)
20:47:44 File "C:\Program Files (x86)\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 801, in OnNodeSelected
20:47:44 path = node.GetPath()
20:47:44 File "C:\Program Files (x86)\EventGhost\eg\Classes\TreeItem.py", line 284, in GetPath
20:47:44 path.append(parent.childs.index(item))
20:47:44 ValueError: tuple.index(x): x not in tuple
20:47:44 Error compiling script.
20:47:44 Traceback (most recent call last):
20:47:44 SyntaxError: invalid syntax (23, line 9)
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

kgschlosser wrote:I started programming about 2 years ago... never did a lick of it before that. I am 41 years old. so you can learn even if you are rolling down the proverbial hill.

I am 100% self taught. Not even a single book. google is your friend. And the loss of hair is not your friend but come with the trying things over and over and over and over ..... about 100 more overs again. until you get it right and usually once you get it right you will understand why at that point. because you have tried every other way and it failed. I am not even a good programmer. I can mash things together to make them function and it's not always the best looking code or the most efficient. But hey.. it works.

I started by picking a plugin that had some issues with it and I wanted to fix and I also wanted to add some more functionality to. So what i sis was wind things that i really didn't understand and pick a key word in it and used google. Just remember if it starts with eg then it's EventGhost specific and you are better off asking or searching the forum or go and look at the core code, the core code is pretty well split into files. so finding things is not always that hard. and a lot of times reading the code for that eg bit you don't know about will help to give you a better understanding of what it does. It's ok to PM me if you want. I know how it is about not wanting to sound like an idiot if you ask a very basic question in a forum. I am not one of those god complex programmers. I was where you are a very short time ago So i can really appreciate it. and I think I do even more so because of how hard I had to work at it.



and yes I can very easily add some toggle actions i will add that for the next release.

Do me a favor tho. post some screen shots of what the actions look like populated with information.

I will tell you this. that library needed some help. it was written for Python3 But also had some issues.

Ah i didn't see your post! This is very exciting. I have a decent understanding of how programing works, I just don't know where to start. I like your idea of modifying a plugin. That would seem like a good place to start. Thanks!! I'll post some pictures of it!
Flyingsubs
Experienced User
Posts: 127
Joined: Sat Dec 29, 2012 11:26 pm

Re: TP-Link Smart Plug

Post by Flyingsubs »

Tplink PLugginpng.png
[attachment=1]Tplink PLugginpng.png[/attachment

Pictures of the plugin!
Attachments
Tplink PLugginpng2.png
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 »

hey quick question... what devices are you able to test this with. and what features do they have
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 »

and Oh one other thing. if you turn on the plug with the app on your phone. does it trigger an event in EG?
If you like the work I have been doing then feel free to Image
Post Reply