# \[APP\]\[Pro\] Insight Trends Reloaded

**URL:** <https://community.homey.app/t/app-pro-insight-trends-reloaded/71307>\
**Category:** Apps\
**Tags:** app, tools, insights, homey-pro\
**Created:** [October 28, 2022, 8:39am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307 "2022-10-28T08:39:36Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![JeeHaa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeehaa/32/29849_2.png) [@JeeHaa](https://community.homey.app/u/JeeHaa)\
**Post date:** [November 6, 2022, 2:37pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/21 "2022-11-06T14:37:15Z")

</div>

Just wondering about a simple lookup of historic values. Would it be possible to add a THEN card that gets a value from X min/h/d ago for a specific device from insights and stores it in a tag (and maybe a tag containing the actual time resolution because of Insights data aggregation)?

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 6, 2022, 2:50pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/22 "2022-11-06T14:50:58Z")

</div>

Could u explain your idea a little more? You want a single point of the past? Or a timespan in the past? Like 5 days ago till 10 days ago?

---

<div class="post-metadata">

**Author:** ![JeeHaa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeehaa/32/29849_2.png) [@JeeHaa](https://community.homey.app/u/JeeHaa)\
**Post date:** [November 6, 2022, 2:54pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/23 "2022-11-06T14:54:51Z")

</div>

No, just one (nearest) data point would be great. 🙂

The only reason I mentioned the “resolution” was because Insights aggregates data the further it goes back in time, so instead of 1 min data points you may end up with an average over 5m or 1h data intervals if it’s a long time ago.

Example: get value for Power consumption of a plug now and 24 ago and calculate the difference to get usage over last 24h.

---

<div class="post-metadata">

**Author:** ![JeeHaa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeehaa/32/29849_2.png) [@JeeHaa](https://community.homey.app/u/JeeHaa)\
**Post date:** [November 6, 2022, 3:10pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/24 "2022-11-06T15:10:49Z")

</div>

BTW: I think there is still an issue with 1.0.5:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/7/576d5a306f6d71ab1207d5b8988d6e7e8e669cba.png)

Regardless of the interval chosen I get the same cunsumtion for Max - Min?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/c/2c58823d6794edad874ac7b53581b7f537b85ac6.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/4/f433143dbe1db3976b3fe0714b04b81d7646d988.png)

These both give 9.2 kWh, but the range of 36h should have a lower min, so higher consumption than over the last 24h? Also the same for 48h.  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/1/91a981232cec261337e83a8078b64fafa7d7509f.png)

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/c/9c6e3406e0927b1b30ac152948d44738f25c7d53.png)

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 6, 2022, 3:30pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/25 "2022-11-06T15:30:54Z")

</div>

I‘ll take a look at once I‘m home.

I‘m thinking about adding a token to the current cards with first value, last value plus there timestamp

---

<div class="post-metadata">

**Author:** ![JeeHaa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeehaa/32/29849_2.png) [@JeeHaa](https://community.homey.app/u/JeeHaa)\
**Post date:** [November 6, 2022, 4:04pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/26 "2022-11-06T16:04:01Z")

</div>

Although just an additional THEN card might be a lot “lighter” on resources if a trend calculation is not needed…

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [November 6, 2022, 4:52pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/27 "2022-11-06T16:52:18Z")

</div>

> [@JeeHaa](#):
>
> Example: get value for Power consumption of a plug now and 24 ago and calculate the difference to get usage over last 24h.

Maybe you can find a solution here with the app " Flow Utilities".

> [@\[APP\]\[Pro\] Flow Utilities](https://community.homey.app/t/app-pro-flow-utilities/53027):
>
> Flow Utilities - Get more out of data for in flows Useful links [To-Do List](https://community.homey.app/t/app-pro-flow-utilities/53027/4)[Frequently Asked Questions](https://community.homey.app/t/app-pro-flow-utilities/53027/3)[Changelog](https://community.homey.app/t/app-pro-flow-utilities/53027/2) Always wanted to know how long your device is running or how much energy it used? With this app you can compare these (or basically any kind of number) data in Homey. Current features: Start/Stop duration (Calculate time in between) Start/Stop comparison with value - (Calculate difference of numbers) Convert number to currency Calculation with 2 numbers ([+] [-] [/] [\*]) C…

---

<div class="post-metadata">

**Author:** ![JeeHaa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeehaa/32/29849_2.png) [@JeeHaa](https://community.homey.app/u/JeeHaa)\
**Post date:** [November 6, 2022, 5:37pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/28 "2022-11-06T17:37:58Z")

</div>

I know there are other apps that could be used, and I could even just use variables for this specific scenario (at time X set StartValue). But I thought it would make sense for “Insight Trends” to have this option to get any data point from insights in its feature set.

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 6, 2022, 7:36pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/29 "2022-11-06T19:36:36Z")

</div>

> [@JeeHaa](#):
>
> Although just an additional THEN card might be a lot “lighter” on resources if a trend calculation is not needed…

I’ll add a card like this in some time in the future.  
For now I added them to the current card.  
Check out the latest [test version](https://homey.app/a/com.spkes.insightTrendsReloaded/test/)

> [@JeeHaa](#):
>
> I think there is still an issue with 1.0.5:

Also this is fixed 🙂

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 8, 2022, 12:31pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/30 "2022-11-08T12:31:33Z")

</div>

Settings page is in the works 🙂

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/6/86339a7ab675956b01f5e153d4399d925a3385d9.png)

---

<div class="post-metadata">

**Author:** ![JeeHaa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeehaa/32/29849_2.png) [@JeeHaa](https://community.homey.app/u/JeeHaa)\
**Post date:** [November 8, 2022, 1:14pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/31 "2022-11-08T13:14:45Z")

</div>

Nice! Does that also include a “Significant figures” setting by any chance? 😉

BTW: I’ve been using the min/max for a couple of days and it works well!

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 8, 2022, 3:02pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/32 "2022-11-08T15:02:01Z")

</div>

Maybe 😶

Without:

```auto
[InsightTrendsReloaded] Got 167 from getLogs. The tokens are: {
  min: 53.6,
  max: 68.30333333333333,
  mean: 59.146218396540284,
  median: 58.92527777777778,
  standardDeviation: 2.2823017239060737,
  trend: -0.000007057882446205948,
  firstvalue: 64.44902777777777,
  firstvalue_timestamp: 1667318400000,
  firstvalue_time: '01/11/2022, 17:00:00',
  lastvalue: 58.37375,
  lastvalue_timestamp: 1667916000000,
  lastvalue_time: '08/11/2022, 15:00:00',
  size: 167
}

```

With:

```auto
[InsightTrendsReloaded] Got 167 from getLogs. The tokens are: {
  min: 53.6,
  max: 68.3033,
  mean: 59.1462,
  median: 58.9253,
  standardDeviation: 2.2823,
  trend: -0,
  firstvalue: 64.449,
  firstvalue_timestamp: 1667318400000,
  firstvalue_time: '01/11/2022, 17:00:00',
  lastvalue: 58.3738,
  lastvalue_timestamp: 1667916000000,
  lastvalue_time: '08/11/2022, 15:00:00',
  size: 167
}

```

Test version will come out soon 🙂 But its not done yet.

Edit: Just released the first [test version](https://homey.app/a/com.spkes.insightTrendsReloaded/test/).  
It’s not the final settings page and is still work in progress.  
Stuff that will come.

- A way change the precision of the significant figures
- ~~Reload button for the graph/chart~~
- ~~More Info Fields for the graph~~
- ~~Percentile support~~
- Suggestions of the community?

~~feature~~ = Completed.

Best regards ✌

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [November 8, 2022, 5:13pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/33 "2022-11-08T17:13:40Z")

</div>

Nice settings panel! 😄  
Why can I not find all my insights?

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 8, 2022, 5:26pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/34 "2022-11-08T17:26:14Z")

</div>

Do you find not any or just some?

It should show all of your insights

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [November 8, 2022, 5:46pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/35 "2022-11-08T17:46:52Z")

</div>

For example if I search “power” there is just 5 hits. It schould at least 25 hits.

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [November 8, 2022, 5:53pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/36 "2022-11-08T17:53:55Z")

</div>

Same problem with search for “temperature”.

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 8, 2022, 6:36pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/37 "2022-11-08T18:36:06Z")

</div>

Oh, i bet the default limit is 5. I‘ll change that.

---

<div class="post-metadata">

**Author:** ![JeeHaa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeehaa/32/29849_2.png) [@JeeHaa](https://community.homey.app/u/JeeHaa)\
**Post date:** [November 8, 2022, 6:36pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/38 "2022-11-08T18:36:09Z")

</div>

I can confirm I also only see a small number of my total devices.  
Should the list also populate without entering anything, or only when you start typing?

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [November 8, 2022, 6:45pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/39 "2022-11-08T18:45:53Z")

</div>

It is not just a limit problem. Some insights can not be found even if it is fewer than 5 hits.

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 8, 2022, 6:52pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/40 "2022-11-08T18:52:23Z")

</div>

I changed some stuff on the search engine. Please check out the latest test version.  
It should show the same stuff as the flow auto complete since it has the same back-end code.

I’m currently at work so I can’t debug so good.

[Previous page](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307.md?page=1)

[Next page](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307.md?page=3)
