How to do timer/counting? Specific case

Hey

So i have a Homey Pro ( and yes im new ) - ive set it up a smart plug on a 3d printer. I want to create a flow that somehow says something like the following;

If printer has come above 100 watts, and comes UNDER 100 watts again, then wait 10 minutes and shut off the plug.

Reason is: The printer is idling at 63+ watts - once it goes over, its printing. When it goes under again its most likely done. In some cases, its changing filaments, or print could be paused etc - hence the 10 min wait.

However, i cannot seem to add anything anywhere in the flows, on how to make it “count” 10 minutes.

Anyone have an idea?

1 Like

Hi Mddk,
You can use CountDown app (By Ralf van Dooren)

1 Like

In normal flows you can delay the execution of the THEN card, in advanced flows there is the delay card.

I think this should do the job:

It sets a boolean variable to Yes, to ‘remember’ the power being over 100W.
When the power becomes less than 100W, but becomes greater than 100W again within the 10 minutes, the timer gets paused to prevent the plug from turning off at a wrong moment.
When the timer is allowed to finish after 10m, it turns off the plug, and sets the boolean variable to No again, ready for the next ‘run’.

1 Like

You can use the Countdown app to do that.

CountDown app

@Rmb If you use the “normal” standard delay card from Homey in flows they always wil be executed.
If the powers goes down the 100W and you setup up a delay of 10 minutes and after 6 minutes the power goes up to 200W the flow with the delay wil stil be executed.
So if that was “turn of the plug” it wil turn of the plug.

edit: This is for the THEN cards, you said WHEN.

You are right, the THEN card in normal flows has a delay. And you are also right that after the waiting time, one has to check again the power is low. But that was not part of the use case of the topic starter :innocent:.

Thank you so much for all the inputs. Ill have a look later today and try out some things based on this!

1 Like