# \[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:** 4

<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 16, 2022, 10:53am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/61 "2022-11-16T10:53:06Z")

</div>

> [@Anders\_Gregow](#):
>
> I used the Trend-When card but it never fired.

Did you selected the right insight in the flow card?

> [@Anders\_Gregow](#):
>
> If diagnostics is needed I can re-install it later and capture.

Feel free, but I can’t currently developer since I’m waiting for my homey replacement. That will take 3-5 weeks.

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 16, 2022, 10:57am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/62 "2022-11-16T10:57:27Z")

</div>

> [@spkesDE](#):
>
> Did you selected the right insight in the flow card?

I guess 🙂  
I selected the same insight as used in the Then-card.

> [@spkesDE](#):
>
> Feel free, but I can’t currently developer since I’m waiting for my homey replacement. That will take 3-5 weeks.

Ok, then I wait until you are up and running. 🙂

> [@Anders\_Gregow](#):
>
> number of datapoints

Should it be possible to use this to see if the motion sensor has reported or not, i.e. will it be zero if the sensor has not reported within the time frame?  
Or should timestamp for last sample be used (seconds or milliseconds)?

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 16, 2022, 11:06am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/63 "2022-11-16T11:06:01Z")

</div>

I retried and I get this error from the calculate trend card: "Cannot read properties of undefined (reading ‘y’)

---

<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 16, 2022, 11:07am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/64 "2022-11-16T11:07:07Z")

</div>

> [@Anders\_Gregow](#):
>
> Should it be possible to use this to see if the motion sensor has reported or not, i.e. will it be zero if the sensor has not reported within the time frame?  
> Or should timestamp for last sample be used (seconds or milliseconds)?

Boolean Insights support from Athom is different then number insights. I don’t know the technical standpoint behind it.

What could have happen to you, that the API reported 0 data points back and my app couldn’t handle it.  
I can test that once I have my homey back.

> [@Anders\_Gregow](#):
>
> I retried and I get this error from the calculate trend card: "Cannot read properties of undefined (reading ‘y’)

Yeah, 0 data Points give back from the API. I’ll include a fix for that once I’m up and running.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 16, 2022, 6:05pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/65 "2022-11-16T18:05:38Z")

</div>

> [@JeeHaa](#):
>
> For example “significant figures= 3”: 1.234567 → 1.23, or 0.0056789 → 0.00568.

You can create functions for that in the Better Logic Library app.  
Specificly build for this kind of default needed methods/functions.

> [@\[APP\]\[Pro\] Better Logic Library - For Users](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/2):
>
> App Settings Here is a description about the new App Settings in the Better Logic Library App. Variables Here you can add, edit and delete variables. To add a new variable, click on Add variable to open the new variable card. [image] Coding Here you can see how to use coding and try examples. Click on the Example (eye) to show the usages down below, which is also shown in Locale/TimeZone by default. Locale/TimeZone Here you can configure the locale or lang…

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [November 17, 2022, 2:03am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/66 "2022-11-17T02:03:26Z")

</div>

> [@Anders\_Gregow](#):
>
> I would like to verify that my motion sensor has been triggered last 24 hours

Maybe this flow + script is of any use (in the meantime) 😉

> [@The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/13):
>
> Sensor (or any device) Connection Check. Sometimes, you’ll discover a sensor or other device doesn’t report it’s status or value anymore, but it does NOT notify you of being offline… Well, this flow checks the, most recent update time of your sensors. You can run the flow every day, twice a day, just add or remove a time triggercard. The ‘inactive time’ can be edited as well (24hrs as default) and you can choose to not send notifications when all sensors did report inside the ‘inactive time…

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 17, 2022, 6:21am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/67 "2022-11-17T06:21:13Z")

</div>

> [@Anders\_Gregow](#):
>
> I would like to verify that my motion sensor has been triggered last 24 hours by retrieving number of datapoints (should be \> 0) and last timestamp.

Hey @Anders_Gregow , was the Insights card still not working for you?  
Because it is for me and it works perfectly to test the state of sensor.

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/a/0a722cda209ef26e56366bddeef9e8d526e7e863.png)

Just retrieve the insights from now (o minutes ago), and the duration elapsed in ms shows how long it has been that the capability has been changed.

Let’s continue in PM or the correct topic if you still had an issue?

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 17, 2022, 6:35am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/68 "2022-11-17T06:35:24Z")

</div>

I will send you a PM as this is out of topic as you say. 🙂

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 17, 2022, 6:39am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/69 "2022-11-17T06:39:53Z")

</div>

> [@Peter\_Kawa](#):
>
> Maybe this flow + script is of any use (in the meantime)

Thanks.  
I am not running Homeyscript (yet).  
My old Homey(2016) is getting sluggish so I do not want to add to many apps right now.  
When I get the new and shiny Homey(2023) I might test it.

I have a solution with timers for each sensor (chronograph) but I think Insight Trend works already. Just needs to check if the retrieve card returns error, meaning the sensor has not reported. 🙂

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 20, 2022, 7:20am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/70 "2022-11-20T07:20:25Z")

</div>

> [@spkesDE](#):
>
> Yeah, 0 data Points give back from the API. I’ll include a fix for that once I’m up and running.

Would it be possible to make it easier to see what sensor is used in the “Calculate trend” card? Currently only the selected capability is shown, making it impossible (?) to see later what device is checked.  
Maybe one field for sensor name and one for the capability?

---

<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 20, 2022, 7:26am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/71 "2022-11-20T07:26:39Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> You can create functions for that in the Better Logic Library app.  
> Specificly build for this kind of default needed methods/functions.

Thanks, I think could also just use “math” on the tag to round it. But having it available as a setting in the app is much more convenient, and I even think @spkesDE intends on making it configurable later on. 🙂

---

<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 20, 2022, 11:15am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/72 "2022-11-20T11:15:52Z")

</div>

Inside the card i can only show the capability or the device name. I could add a token, but is there a use for it?

> [@JeeHaa](#):
>
> I even think @spkesDE intends on making it configurable later on.

Already done in my current version, but still waiting for the new homey ✌  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/0/5037483f776fcb8088edd47177882e3f00a4c30e.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 20, 2022, 11:19am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/73 "2022-11-20T11:19:11Z")

</div>

Cool! Not in the public 1.0.20 Test version yet, right?  
I only see the toggle. 🙂  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/c/4c547baf18497bea5ecc45b4f8ed12b26d55fc49.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 20, 2022, 11:23am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/74 "2022-11-20T11:23:33Z")

</div>

That’s right 🙂 It’s on my local version only for now.

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 20, 2022, 1:24pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/75 "2022-11-20T13:24:12Z")

</div>

> [@spkesDE](#):
>
> Inside the card i can only show the capability or the device name. I could add a token, but is there a use for it?

Easier to understand what the card is doing, but how I currently use it makes it not important.

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 22, 2022, 6:47am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/76 "2022-11-22T06:47:38Z")

</div>

> [@spkesDE](#):
>
> Yeah, 0 data Points give back from the API. I’ll include a fix for that once I’m up and running.

I have a temperature sensor that I removed the battery from over a day ago.  
When calculating the trend for it the “Number of data points” is not 0 as was expecting.  
Is this as expected, being the Homey reusing the last value in insights?  
So better use the trend as a check whether the sensor is alive?

---

<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 22, 2022, 8:53am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/77 "2022-11-22T08:53:40Z")

</div>

I have successfully used temperature trend=0 for 24 hours. It works very good even if the sensor battery dropped and is not responsive.

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 22, 2022, 9:08am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/78 "2022-11-22T09:08:57Z")

</div>

> [@Morgan](#):
>
> I have successfully used temperature trend=0 for 24 hours. It works very good even if the sensor battery dropped and is not responsive

Thanks, will do so.

---

<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 22, 2022, 10:42am UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/79 "2022-11-22T10:42:25Z")

</div>

Can’t really tell you that. I don’t know what data has Homey sent you in that case.  
It can be datapoints with a 0 as the value for batterie  
As @Morgan said, trend would be the best bet.

---

<div class="post-metadata">

**Author:** ![Fred\_de\_Goede](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fred_de_goede/32/13510_2.png) [@Fred\_de\_Goede](https://community.homey.app/u/Fred_de_Goede)\
**Post date:** [November 22, 2022, 6:32pm UTC](https://community.homey.app/t/app-pro-insight-trends-reloaded/71307/80 "2022-11-22T18:32:23Z")

</div>

How nice that you took the effort to republishe this great app. My Homey is nothing without Insight Trends. When I now backup and restore I won’t get the MadMonkey87 Insight Trends app restored. So love to see you working on a new version. 👏 👏 👌 👌 I’m gonna make a donation.

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

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