Comments (5)
Yo man, if you use the info command, you'll get a response where among the stuff returned, you'll find "on_time" which shows how many seconds the device has been running since it was turned on.
If there's a command missing, you can find the commands by using a network monitoring app on your phone to check what commands Kasa is sending, then you can use the python script to send the same commands that you found through the network monitoring app.
from tplink-smartplug.
@PatrickBB29 - I don't have access to mine at the moment, but IIRC, current is in amperes. It should be a float. (This should let you do P = I x E, but maybe only for a straight resistive load. I did some testing with a space heater.)
IIRC the device is uploading samples to Kasa's cloud service. So if you wanted to do it locally, you'd need to periodically poll and accumulate the values into the desired buckets.
Have you seen the Reverse Engineering blog post? There is a lot of info in there. While the focus is security, there is quite a bit about how the device functions. There might have been a way to change the URL the device posts to, though ssl certificate might be a problem.
from tplink-smartplug.
Hi,
thanks for replies.
I monitored network packets between Kasa app and cloud service (see attached file).
It can be found energy data and also time data.
I'll try to use these captures to complete to complete my work in jeedom (home automation software).
sniff_Kasa.txt
from tplink-smartplug.
Hi,
In my experience, data from get_realtime current and voltage are not congruent with the wattage.
For starter, voltage is given well above the 220-230V here.
Then One can assign any pair vgain igain, provided vgain/igain ratio is kept constant so that the wattage stay identical to the load.
Finally, with a load multiplied by almost 6, current only increase by almost 3.
P <> U x I /1.414 (accounting for efficient voltage of a sinusoidal power supply 2^0.5=1.414)
Neglecting cosine effects on the power
with 4 power data points 20 to 180 W roughly, the linear relation is
I reel (in Amps) = 1.414 x (312/220 x I -32/220)
where I is the current value from get_realtime
ok it does not work near zero, i noticed
I might be all wrong, so have a look as well
from tplink-smartplug.
Hi @PatrickBB29 ,
I saw your thread and I had similar question. How do I get the total runtime of the machine that is connected to the smart plug? For example I have a TV connected to it and I want to know how many hours have the TV switched on for a day, a week perhaps a month? Not the switch on time of the smart plug. Any solutions?
Regards,
Din
from tplink-smartplug.
Related Issues (20)
- bad argument #2 to 'Proto' HOT 3
- Failed to connect to host ...
- Convert to Powershell?
- Ability to read the power usage? HOT 1
- Correlation between script results and Kasa app
- Set mac address HOT 1
- HS100 Hardware V4.1 Firmware 1.1.0 - No Longer Working - No Port 9999 HOT 30
- KP400 dual port control HOT 3
- Extraneous 'f' in tplink_smartplug.py causing Python error HOT 1
- Problem Controll TP Link HS110
- Works with KP115 HOT 3
- Support for multi device KP200
- How might I assign a static IP via the devices themselves?
- google home seamless setup
- Dissector for the UDP discovery HOT 2
- KS220M(US) Dump - WIP HOT 2
- Faster version
- INFO REQUEST: HS110 Calibration
- temp enable on hs110 HOT 1
- JSON commands don't seem to work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tplink-smartplug.