¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

File /Modules/TPLink_Switch.zip uploaded #file-notice


[email protected] Notification
 

The following files have been uploaded to the Files area of the [email protected] group.

By: Georges K

Description:
Simple module to interact with a TP-Link Kasa outlet. Tested with a HS105. Includes feedback (polling). Also D3 compatible.


 

Do you happen to know the commands for controlling specific outlet on a KP400?? The commands from the module turns both outlets on/off.


 

I never really looked into it as for my needs, this is enough (all on/off).

I'll see if I can find some time to add individual control, assuming it's easy enough.


 

I uploaded an updated version of my module. It's pretty much a complete rewrite that now includes individual outlet control/feedback.

Works fine with my modules at home, let me know if there's any issue on your end.


 

I cant find the updated module


 

Weird. I'll re-upload the latest one I have later this week (don't have access right now).


On Sat, Aug 12, 2023, 23:50 Eric Luckart <eluckart@...> wrote:
I cant find the updated module






 

Uploaded the latest version I have (currently using it in D3 with no issues).


 

Thanks Georges


 

Georges,
Look at line 84 in the s+. I think that line is left behind from testing or something.


 

Anyone have TP Link dimmer control(Like a HT210)? Looking for On, Off and set level. not even worried about feedback.

Thank you?

Jon


 

Oops yes, that should not be there, good catch! Thankfully it's harmless :)?


 

I don't have any dimmers to test unfortunately.

But it shouldn't be too complicated to add it to my module using this:?https://github.com/python-kasa/python-kasa/blob/master/kasa/smartdimmer.py


 

Jon,
I just removed a couple from a clients house. I will be looking at controlling them at some point, I just don't know when.


 

Georges,
The outlet 1-6 feedback doesn't work. I am testing with a HS300 and MC4. All control works. Outlet_Num always reports as 1.


 

Jon,
It looks like the ones I got were HS210's. They are switches not dimmers. These ones do work with Georges module.


 

I don't have a?HS300 to test with unfortunately. I havetesting with KP200, KP400 and KP303. The protocol might be slightly different for the HS series.


 

Georges,
I found why it wasn't working for my HS300. Your DecodeBuf isn't large enough. The incoming string from the HS300 is over 1200 in length. I changed it to 2048 and it worked.

Other things I changed to fix weird issues I was having at times, I really didn't spend any time trouble shooting this. I just know in the past when I used the delay() method, it gave me issues like I was seeing. After switching to the gather I haven't had those issues.
Line 48, I removed the Delay(10); as it wasn't working all the time.
Line 43, I added Encoded$[2048]
Line 67, I added Encoded$ = GatherByLength(Length, RX); - This is the fix for the delay(10) issue.
Line 72, Changes from DecodeCurrentChar = getc(RX); to DecodeCurrentChar = getc(Encoded$);


 

Awesome, great work and thank you for debugging this.

I'll make the changes soon. Maybe I should just upload this on my github, it'll make it easier to collaborate :)