Insights Homey cloud api

I would like to retrieve Insights data from my Homey 2023 using cloud api.
Using the following url, I get the today’s power data:

https://[myHomeycloudid].homey.athom-prod-euwest1-001.homeypro.net/api/manager/insights/log/homey:device:1991e290-989e-45d6-abc3-c16886af9cbe/homey:device:1991e290-989e-45d6-abc3-c16886af9cbe:measure_watt_avg/entry

How to get this power data of the last 31 days via the Homey cloud api ? Changing the filter on the Homey Insights webpage doesn’t change the url.

It does for me:

https://XXX.homey.homeylocal.com/api/manager/insights/log/homey:manager:system/homey:manager:system:clock/entry?resolution=last31Days

This is the relevant documentation: ManagerInsights - Homey Web API

2 Likes

I’m using cloud api v3 getting Insights data. Without the “resolution” parameter I get data starting at [dateyesterday]:22:00:000Z time which is 0:00 CET (=my time zone). Using the “resolution=last31Days” parameter each day starts at 00:00:00Z which is 2:00 CET. This seems not to be consistent.
Can I setup anywhere the starting time of compressed data? My timezone is GMT + 2.

I think this is a fundamental issue with the way Homey fills the RRD database that is used for this information.

The time data written to the database is in UTC, so when it writes a datapoint for 02:00CET it gets stored as 00:00Z. Say that it does this hourly.

Then the data gets consolidated by the database (which happens for older data), and say that it will consolidate to a 6-hour average. That means that for a single day, you have data points at 00:00Z, 06:00Z, 12:00Z, 18:00Z.

So 00:00Z is the first available data point for a day, and 18:00Z is the last one. Converted to your local timezone that’s 02:00CET and 20:00CET. There is no data point available anymore for 00:00CET.

For shorter-range resolutions it will use the data points that are stored per hour.

Not that I can see, it only supports fixed resolutions.

You can try creating an issue on Github (I think this issue is SDK-related and not Web API-related, so here), but I don’t think this is something that’ll ever get fixed.

1 Like