Query sensor history
homey_insights_queryRetrieve Homey insights series statistics and compare windows. Returns min, max, mean, median, delta, energy consumption by log type, and data coverage to avoid misreading gaps.
Instructions
Fetches up to five Insights series at one resolution and returns statistics computed over them: min, max, mean, median, first, last and delta, plus the true window and step the hub answered with and the share of it that actually carries samples. Gaps are skipped rather than filled in, so always read the coverage next to an average. Use compareWith to fetch a second window and get the differences, which is what questions like "warmer than last week" need. Energy logs are summarised correctly for their kind: meter_power is a cumulative counter, so consumption is the difference between its endpoints, while measure_power is instantaneous watts, so energy is the area under it. Find log ids with homey_insights_search first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logs | Yes | Up to 5 log ids from homey_insights_search, for example "homey:device:<device-id>:measure_temperature". A device-and-log name is accepted too, and comes back as a candidate list when it fits more than one log. | |
| groupBy | No | Also return per-period statistics, cut in the Homey's timezone rather than UTC. | |
| maxValues | No | Point budget per series when includeValues is set. Defaults to 100; longer series are thinned evenly and the statistics still cover every point. | |
| resolution | No | Window to fetch. Defaults to last24Hours. Calendar windows are cut in the Homey's own timezone. | |
| compareWith | No | A second window to fetch and compare against, for example thisWeek against lastWeek. | |
| includeValues | No | Include the individual readings as well as the statistics. Off by default: a day of data is around 290 points per log. |