Count time?

I want a function that counts the time when the temperature is above a defined threshold level.
Believed that should be very simple, but I got stuck immediately…

I thought it should be possible to have a time tick (every minute), check if the temperature is above the treshold and if so just increase the value of a variable.

But how do I generate a time tick? Do I need an app for that? If so, are there any available for Homey Bridge?
And how do I increment a variable?

1 Like

Best is to use the Chronograph app.

When T > threshold, then “start or resume stopwatch” (not “start or replace”)
When T < threshold then “Stop or pause stopwatch”, “Get elapsed duration of stopwatch”, etc

Elapsed duration:
image

PS If you want to take into account that T can go above and below the threshold a couple of times, use pause instead of stop stopwatch so you can resume it again. In that case add eg:
When time is 00.00, then stop stopwatch.

PS I do not know about Homey Bridge

Thanks, but the Chronograph app is only available on Homey Pro, not Bridge.

Not many apps available for Bridge yet :frowning:

Tools-type apps will not become available for Homey Cloud.

You can make a flow that runs every minute. If the condition applies, add +1 to a variable “counter”. The counter value tells you how many minutes the condition has been true.

1 Like

If the condition is true at 00:01:00 when it gets sampled, then goes false at 00:01:30, then goes true at 00:02:00 when it gets sampled again, you could mistakenly assume that it was true all the time between 00:01 and 00:02.

How do I set up the flow to run every minute?
Is there any native support or do I need an app?

You start the flow normally with a when-card. Use the native Date & Time.

I do not know the nature of your sampled parameter i.e. how often it is typically changing. To save system load, don’t use 1 minute interval if it’s not needed. This was just an example.

My native Date & Time only contains three options, "Time is _ ", “Sun goes up in _” and “Sun goes down in _”

Is this a limitation that comes with the Homey Bridge Version?

Yes, but under AND you have more options.

Yes there are more options under AND…, but I still need the one minute trigger in the WHEN… part

It seems more limited in the Bridge. Perhaps they are protecting either the processing capacity of the device or the upselling appeal of the Pro. Or both :man_shrugging:

If you want to go wild, you can always start a flow with another flow. At least with Pro you can. Say you have two flows A and B:

A: when started, check condition and update counter accordingly with 1 min delay. Then run Flow B.

B: similar to A but in the end run Flow A.

The Bridge is just an interface for some protocols, ‘Homey’ is running in the cloud.

1 Like