plasticrake / tplink-smarthome-api

TP-Link Smarthome WiFi API
MIT License
1.02k stars 141 forks source link

Stats from outside LAN? #38

Open daniel-liuzzi opened 6 years ago

daniel-liuzzi commented 6 years ago

From Kasa I can get usage and runtime stats from both inside and outside my LAN. Since I haven't setup any port forwarding in my home router, I'm assuming this information must be coming from TP-Link's own servers. I was wondering whether tplink-smarthome-api allows this? Thanks a lot for this project!

plasticrake commented 6 years ago

Yeah that uses the TP-Link cloud. You could write your own server that uses this API on your network, and have it relay outside your network, your own cloud. I know there is a cloud API to interact with the TP-Link cloud, not sure if there is a node version though. I have considered adding it to this project but didn't know if there was much interest.

daniel-liuzzi commented 6 years ago

Hey thanks for your response. I checked and, indeed, there's tplink-cloud-api NPM module for retrieving data from TP-Link cloud. I've been playing with it and it seems to work fine. Unfortunately though, it only supports real-time power consumption (see https://github.com/adumont/tplink-cloud-api/pull/3); no days/month stats API yet, but it's a start!

DerekLeeHH commented 6 years ago

Tplink-cloud-api for lightblub doesnt have any light states. Really need that so much..