Wyze plug and Python


I am a happy Wyzecam user and am potentially interested in the Wyze plug. Today, I use TP-Link Kasa plugs. One of my favorite things about the TP-Link plugs is that I can trigger them locally using Python, and I have written a number of different apps to perform different behaviors. While the TP-Link plugs were not originally designed to be controlled with Python someone reverse engineered the communication to make it work.

This brings me to my question. Has anyone tried exploring the output of the plugs? Is there a way to control them locally? (I know that you can use IFTTT, but I am looking for complete local control.)

Thank you!

1 Like

Someone just tried operating one of the Wyze Plugs without Internet 2 days ago, and found once the Plug loses Internet connectivity, the control ends. So no “local” control out-of-the-box. Maybe one of those enterprising Python users will find a way.

The Plug will automatically reconnect when the Internet is again available, but ATM the commands to turn on & off the plug come from the Wyze servers.

Thank you. I think that the TP-Link stuff is architected similarly, but someone figured out how to reverse engineer the communication protocol to send on/off messages locally. We will see if someone can similarly reverse engineer this stuff or if Wyze will release an API. I supposed that IFTTT could be an option too.

I did a cursory glance at the Wyze cam messages to the servers. It’s continually sending “Keep-Alive” messages. I suspect if Python (or any client) can simulate responses to those messages, the cameras will think they’re still connected.

I have no idea how to do this. Probably will need to look at the lower-level network stuff.

What’s the model number of the TP-Link plugs? Can you PM me the link to the discussion about the reversed-engineered API?

1 Like

I am embarrassed to say that I cannot figure out how to PM you. Maybe it is related to my newness? Regardless, I have multiple TP-Link devices, and they are a combination of the following:


I use this library to operate them and it works perfectly. Here is a long write-up about the reverse engineering process.

Thanks. I’m actually more comfortable with C#, but I did play around with python a bit. I’ll check out that library. I’ll probably get one TP-Link plug. I like playing around with hardware that I can control with my own apps.

BTW, last time I checked, there’s a deep schism between python versions 3 and 2.7.

2.7 is going EOL soon and so you should go with 3.x. I always used 2.7 and have recently switched to 3.x and have no issues. Yes, there are minor changes, but it is nothing that is massively problematic. At this point, there is no reason to go with 2.7.

The library works great! One of my favorite home built apps combines an Amazon Dash button with multiple plugs/switches to turn all of them on with one press and then off with another. I use this specifically with Christmas lights so we can easily turn everything on and off. I can also easily automate this all via a schedule as well.