adumont / tplink-cloud-api

A node.js npm module to remotely control TP-Link smartplugs (HS100, HS110) and smartbulbs (LB100, LB110, LB120, LB130) using their cloud web service (no need to be on the same wifi/lan)
https://itnerd.space
GNU General Public License v3.0
127 stars 44 forks source link

Notifications #11

Open jwal opened 6 years ago

jwal commented 6 years ago

Thanks for this project. I have built a thermostat for my bedroom using an electric oil-filled radiator attached to the HS110 and a BBC microbit for reading the temperature.

I am guessing that you have found a way to reverse engineer the Kasa application protocol. I was wondering whether there is some kind of notification system where you can receive a webhook or websocket ping whenever the HS110 switches on. I notice that even if I use the button on the switch then the app updates immediately with a green light. It seems too quick to be the result of rapid polling.

Have you identified any server-initiated signals like this? It would be good to get an activation notification so that I can trigger an action from IFTTT.

I am happy to help out with a little reverse engineering and/or coding for this but I thought I'd ask the question to you first before I begin.

adumont commented 4 years ago

Hi James, that's a good question. I have not noticed such things, although I haven't been looking for it either.

I'm curious, in your setup, how is the Micro:bit interacting with the HS110? Is it via bluetooth, with another component in the middle, that gets some Microbit control signal and relays it over the internet?

jwal commented 4 years ago

Sorry for the delayed reply.  I actually had one Micro:bit logging using the internal radio transmitter to another which was connected to a Raspberry Pi via USB cable. It was via the Pi that smart plug was being triggered.

Unfortunately this setup has somewhat dropped out of maintenance so I cannot show you until I get a chance to resurrect it.