New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get historical emeter data from P110M #746
Comments
What command are you using and which version of python-kasa? AFAIK the TAPO devices don’t support the monthly stats. |
I'm doing this through the Python API - using 0.6.2.1 (downloaded this morning) I can share the full script (it's only a handful of lines) in a bit if you'd like. The reason I was hoping this would be available is because it's accessible through the Tapo app, so there must be some way of getting it |
The TAPO app just has last month not historical months right? We will support that soon once we get a few structural things in. |
It gives the following data (which can also be requested to be emailed as Excel files). Some of the data in the email goes back further than the app shows
|
For my purposes, I'm probably just going to grab the data once a week by hand through the app, but at some point I'd like to automate this. Thanks, and appreciate all of your work on this :) |
The error is coming as it's trying to execute a command that's used by the kasa ("iot") devices so that's a bug (#718 is aimed to "fix" that, but looks like it doesn't currently raise exceptions when trying to access those methods..). Adding support for energy meter stats is something that comes later at some point, but before that you may find some success deciphering the data using a raw command like this with different start&end timestamps and interval values:
That 5 = 0,05kWh and 31 = 0,031kWh in the monthly view of the app. Let us know about what you find. There is also another command, There is also yet another for get some quick stats, see https://github.com/python-kasa/python-kasa/blob/master/kasa/tests/fixtures/smart/P110(UK)_1.0_1.3.0.json#L331 |
Ahh - that makes sense that the existing functions would be for Kasa rather than Tapo devices. Based on your suggestion, I've changed my python code to this, which works perfectly
Thanks for this - this will certainly get me what I'm after - I can get both energy and power data that way, even if it's not through a cleaner API |
I'm not certain exactly where this issue is coming from, but I've got the Tapo P110M plugs.
This module seems to work pretty much as expected most of the time, but the one thing that fails is calling:
This fails with:
I traced through the code, and it eventually calls
Usage.get_raw_monthstat()
like this:I was wondering if the P110M has a very slightly different API for some of this to the P110, but I don't have a P110 to test that with.
I've tried figuring out what the actual method should be, but haven't managed to so far. I attempted to do this by running a proxy server on my PC, getting my phone to route through this proxy, and then running WireShark, but it appears to all be encrypted.
If anyone is able to give me some pointers as to how to decrypt this, if that is even possible, then I can dig further into this.
Thanks
The text was updated successfully, but these errors were encountered: