Open goofy2k opened 1 month ago
This is a quirk of the tapo API.
When requesting the data, an end timestamp is always required. However, this end timestamp is not used for daily and monthly data. So rather than pointlessly asking the user for an end date that won't be respected or calculating the quarter end, I made it send an end timestamp equal to the start.
Unfortunately, the response contains both timestamps as provided in the request, and I agree that this is confusing.
I'm not sure how to address this. My current best guess is to remove the end_timestamp
from the response.
From your answer I conclude that the start_timestamp should be meaningful. Going to have a look on that...
Op do 23 mei 2024 10:26 schreef Mihai Dinculescu @.***>:
This is a quirk of the tapo API.
When requesting the data, an end timestamp is always required. However, this end timestamp is not used for daily and monthly data. So rather than pointlessly asking the user for an end date or calculating it, I made it send an end timestamp equal to the start one.
Unfortunately, the response contains both timestamps as provided in the request, and I agree that this needs to be clarified.
I'm not sure how to address this. My current best guess is to remove the end_timestamp from the response.
— Reply to this email directly, view it on GitHub https://github.com/mihai-dinculescu/tapo/issues/221#issuecomment-2126523364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGII3TQV5DGZUCBME4CAWO3ZDWR3JAVCNFSM6AAAAABID5G4COVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWGUZDGMZWGQ . You are receiving this because you authored the thread.Message ID: @.***>
I checked the timestamps and data against the graphs in the app. ALL start_timestamps are indeed meaningful and corresponding with the start of the data in a period. This is also true for the end_timestamp for the hourly data.
So, having start_timestamps is sufficient for connecting a datapoint to the specific time period. The reported local_time can be used recognize the last fully completed time period in a series.
I am currently testing the tapo module with my P110 smart plugs. I can get the data from the devices with all of your API calls in the TAPO_p110.py example, which is great !
I am now specifically looking into the device.get_energy_data calls for hourly, daily and monthly data and am trying to understand the various output parameters. The code delivers values for start_timestamp and end_timestamp. To understand their meaning I convert them to a Python datetime object and print them.
For the hourly data I get results that make sense, but for daily and monthly data the start and end values are equal. Is that something in the device output or in the post-treament in your module? I give example results below.