Homey Community Forum

[APP] Insight Trends

Found the problem. My 2 humidity calculations stopped working because (at least for the 2nd time) somehow the same sensor is put in the 3 calculated trends. I know I have rechecked and re-set the correct sensors a few before (I know because selecting a sensor from the long and unsorted list of device-values is quite tedious and I did this last weekend when trying to fix the problem), and now all three were again set to “woonkamer”. So “badkamer” and “slaapkamer” did not trigger…

Also, the vars in which I put the calculated values in came to a halt in the middle of the night so I know I did not change a thing
See here https://aws1.discourse-cdn.com/business4/uploads/athom/original/3X/8/3/83c4dfdbb7a2981fd5b0756753b0d4b64f7ccaab.png

Might it be caused by the fact that before all three were calculated at the same time (no pauses) and the app somehow confuses three sensorvalues?

@MadMonkey I see no GitHub section anywhere, would it be please possible to fix filter when using / selecting trends ?

2 Likes

And a sorted list (seems to be sorted to “device added” date)

@zakraket @Sharkys here you can do a request / submit an issue: GitHub - MadMonkey87/Homey.InsightTrends

1 Like

Last update now gives sorted devices list, great improvementt!

1 Like

I created a ventilation function which uses Insight Trends.
It switches while using the speed of the rising/falling values, not with the values themselves.

Also in Dutch:

is it possible to calculate betterlogic numbers that are also stored in insights?

Yes

1 Like

Selecting a Better Logic Insights var as action card:

Awesome app! I’m using this to switch the extraction fan as @Peter_Kawa. Just trying to find the right trend to prevent it frome turning off whilst cooking.

But I also like to switch my mechanical ventilation based on co2. Sure WHEN higher than x THEN set fan off/low/high works, but it takes a while to lower co2 when it’s raisen.

So with trends I could switch it to high when it rises quick (visitors over) to start ventilating soner.

I feed the calculation every minute with co2 ppm. Every 15 minutes the calculion should be completed. But the trend values are through the roof. 4.0-22.0. Shouldn’t it always be between 1and - 1?

[10-05 22:08] .: https://homey.app/f/y9mVnBq
[10-05 22:09] .: https://homey.app/f/mxrVnB

1 Like

Hi Fabian,
The first flow link shouldn’t have the last ‘q’ :upside_down_face: But I was able to view it.
To calculate the c02 ppm every minute is ok, but you can change it to every 10secs or something. The developer tested the calculations, it generates very little load on Homey. The more measure points, the more accurate it works.

About the “every 15 mins the calculation should be completed”, it works a little different.
The 15 minutes setting means, it calculates the trend of the c02 ppm values of the last 15 minutes. But maybe you meant that.
The calculation itself is done in a sec or so.

About your returned trend numbers,
the app description indeed says:

  • Trend: a value between -1 and 1 indicating if the sensors measurement is going up or down (and how fast/slow). for example a value of 0.75 means the trend is going up rapidly while -0.1 means a slight downwards trend

So the trend should be between -1 and 1, but it isn’t.
If a trend is 22, it just means the measured value has raised very very fast in time.
I don’t think anything is wrong with the trend numbers you receive.

So I ran a test, and I can confirm a trend of -7.99 which shutted down my cooker hood:
InsightTrendsCookerHood

To ‘sanitize’ your trend values, you can do this inside your notification card: Trend={{round([trendtag],2)}} to display the trend with 2 digits.

1 Like

Didn’t find an answer above…

Is it possible to apply any other trend than a linear one?

And another question, or rather feature suggestion: How about adding the possibility to add a summarizer over a period of time? Kind of like the app “Power by the hour”, but for any insghts value. Many values will not mean anything relevant but others most certainly will.

That would for instance make sense for solar radiation weather station data. How much energy has been radiated between time x & y?

This is what’s possible until now:


Afaik you should search for “insights” in the app store. There’s a few databases and tools, so you can run your own query’s on the stored data.
The native Insights data gets summarized (by average calculations) more when the timeframe gets larger.
F.i. the last hour there were 90 measured energy levels recorded.
If you look for the graph about the last week, there’s (I don’t know the exact) let’s say an average measure point for every hour.
Meaning, (by example):
90 mp’s per hour = 2160 mp’s per day = 15120 mp’s a week.
That’s brought back to 24*7=168 averaged mp’s.
All this to save storagespace.

To be clear, idk the calculations and the formula, but for exact numbers and calculations I think you should export your f.i. hourly Insights to a database.

Also interesting I think

This is the app I was looking for :slight_smile: but,… :frowning:
PROBLEM IS SOLVED: look at the bottum of this post.

I want to use the average of a light sensor (lux) for my sunscreen to go up or down. Now I use just two single measurements to define if it has to go up. But with the nice Dutch clouds it happened that these measurements are both on a moment that there is a small cloud before the sun. So an average measurement is a lot better.

So I made a flow to test it first. My normal value to act is 1600 lux. But making a flow didn’t work out. After testing I found out that the average value is a factor 10 smaller than in real.

I tested it with these two simple flows:
Calculate values for Light Sensor (lux) for last 5 minutes
When calculation is finished, sent Telegram message with AVG value

In the app configuration it shows the right values. @MadMonkey, is this an error in the app?

SOLVED: Found out that I used a different light sensors. I made the flow on my computer, when you choose a light sensor from the list (Licht Sensor), it takes the first one from the list instead (Aqara Motion Sensor). I found the problem when I looked at the flow on my phone.
See the short video/screen capture I made: Select Light Sensor in Insight Trends

Not a solution for your Q, but an alternative:
You could consider using the < group > app.
One sensor group device holds the value of the mean average of all included sensors.

You can create a sensor group, of the type ‘Luminance’ (‘helderheid’ in Dutch).
The available luminance sensors are presented and you can select your sensors of choice.
Then you’ll have a new ‘sensor’, showing the mean avarage lux value.
No flows needed. You can use this group sensor to trigger your flows, or use it as a condition.

1 Like

I tested with similar flows


Results of Average, Median and current lux, looking OK here:

Hi, thanks for a great app!
I have some trouble with trend calculation with a humidity sensor. It’s different values when I do the same calculation within the settings in the app, and when I do do it via flow. Same sensor, same scope: 15 min. Any idea?


I see that i can x100 the trend value, and it will be the same, but should it be like this?

Hi all,

I wanted to check if there’s a possible bug or may I’m not understanding it.


The maximum is 38.32 but the last value is 45.76… How’s that possible?

Background information:
Calculations of last 7 days.

I’m really curious about your opinions/explanations :smiley: