Detecting a peak/rampup of a measurement

Hi,

My question
I want to be able to detect a peak (actually: the sudden increase of a value very quickly) in a measured value (eg humidity sensor, because there is someone showering) to start a flow (eg turn on the fan).

How to do that and the ‘problem’
Now you can (possibly started by an If… card : ‘humidity has changed’) compare a measured value every few minutes with a measured value from 3 minutes ago and if the difference is large enough let a flow trigger. That means, for an ever-changing value of itself such as humidity, that this measurement ‘loop’ often starts running. If I have more flows like that, there are often a lot of those ‘loops’, with only a real trigger every now and then because someone is showering - resulting in a ?unnecessary? CPU load for the HomeyPro23.

**Smarter? **
I checked the features of math.js | an extensive math library for JavaScript and Node.js, but I can’t find something helpful. Does anyone know a smart way to detect the rapid increase in a reading, preferably in a simple and compact way and with a low CPU load for the HomeyPro23?

Do you want to share your approach to detecting a peak/fast increasing reading?

Greetings,

Philip

Check out Insight Trends Reloaded App for Homey | Homey

1 Like

Dank @robertklep . Ziet er veelbelovend uit. Had ik niet gevonden zonder jouw tip. Dank!
Philip

This is another way to achieve it, using the Device capabilities app.
The flow part below detects very well if the shower started to run;

When the humidity changed, it checks if the value is 6% higher than the value was a minute ago:
While you don’t want false positives, you have to measure the min/max difference of the humidity values in one minute. 6% works good in my case.

1 Like