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.
Energy data (hourly): {'data': [12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 12, 12, 4, 0, 0, 0, 0, 0, 0], 'end_timestamp': 1716422399, 'interval': 60, 'local_time': '2024-05-22T17:20:07', 'start_timestamp': 1716336000}
start date_time: 2024-05-22 02:00:00 start_ts: 1716336000
end date_time: 2024-05-23 01:59:59 end_ts: 1716422399
Energy data (daily): {'data': [8254, 10030, 6695, 4636, 3577, 1448, 499, 632, 2044, 3888, 3002, 1391, 725, 284, 5862, 8314, 9891, 5180, 9461, 7752, 3727, 6723, 5831, 4619, 8553, 4575, 4301, 3228, 3523, 962, 289, 289, 716, 3948, 2240, 1047, 905, 3385, 2470, 711, 290, 290, 293, 292, 289, 287, 288, 288, 286, 286, 291, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'end_timestamp': 1711929600, 'interval': 1440, 'local_time': '2024-05-22T17:20:07', 'start_timestamp': 1711929600}
start date_time: 2024-04-01 02:00:00 start_ts: 1711929600
end date_time: 2024-04-01 02:00:00 end_ts: 1711929600
Energy data (monthly): {'data': [238328, 327085, 236519, 139607, 19388, 0, 0, 0, 0, 0, 0, 0], 'end_timestamp': 1704067200, 'interval': 43200, 'local_time': '2024-05-22T17:20:07', 'start_timestamp': 1704067200}
start date_time: 2024-01-01 01:00:00 start_ts: 1704067200
end date_time: 2024-01-01 01:00:00 end_ts: 1704067200