"all" statement doesn't work icw device capabilities and logica


I am a new user and I try to establish the following:
At given time (now scheduled every 5 seconds to force a trigger, but when it works it will be every day at 20:00) I would like to validate or the powerplug is below 1.
But as the powerplug could be different and sometimes below 1 I would like to validate as well or the powerplug is below 1 for at least 10 seconds.
So, in summary, I would like to check 1 time per day or the power is below 1 for at least 10 seconds. I tried to combine this in a ‘all’ statement, but it doesn’t work. ‘All’ statement is never triggered. Could you please have a look what I do wrong?

So “ANY” instead of “ALL”?

A flow with two trigger card combined with an ALL will never be started.
Please have a look at this FAQ topic:

Btw, to start a flow every 5 sec. is not a good practice. In addition, you are already using the correct trigger card from the Device Capabilitie app. This card alone is sufficient.
The only thing what is missing, is a part which ensures, that the flow is just started once a day if I understand you correct.
This can be done e.g. with a Yes/No variable. This state of variable, if it’s Yes or No, has to be checked as condition card after the trigger card. And if the condition (< 1 W for at least 10 sec) has occurred for the first time during the day, the variable must be changed and reset it again at midnight.

Hi Fantross,

Thanks for the provided link. Very useful! Based on your remarks. I build below flow. Is this what you had in mind as well? Unit testing worked out as expected, except for the delay of the triggering. The requirement for 120 seconds is earlier met than 120 seconds. I guess due to the fact that the Device Dapabilites card is already ‘running’ before the logic ‘stromer’ is equal to ‘ja’. I guess the Capability ‘Huidig vermogen’ must start with zero before it starts. Not sure how to do this.


I think you first should change “voortdurend terwijl het waar is” (continuously while true), to “Eén keer terwijl het waar is” (Once while true).
Because otherwise, the card keeps triggering every 120s as long as the value is below 1.
Using "“Once while true” triggers one time after 120s as long as the value is below 1.
It triggers again, when the value first gets higher than 1, and then, drops below 1 again during 120s.

It should work better when you change the card like I just explained.
But you can’t force it to run only at some time.
I guess you have to use something like this:

When “Stromer” value is below 1 during 120s…
And time is between 20:00 and 20:05
Then add “[huidig vermogen] gelukt” to Simple Log

But you still could miss a trigger this way.

Maybe the DC app dev @Arie_J_Godschalk has an idea on how to let this card

only start measuring after, say, 20:00hrs, or only enable the card between 2 certain times, like, between 20:00hrs and 20:05hrs

Well, the card is activated when created or when the flow is enabled.
So you could disable the flow and enable it at 20u.

However, when this flowcard is enabled, it will check if the value is meeting the condition. If so, it will use the lastchanged value to start the timer.
So if at 19u59 the value changes and it meets the condition, and you enable the flow at 20u, it will countdown 120seconds from 19u59.

1 Like

I get it, Arie. Thanks for looking into it.

1 Like

Hi, @robertklep, @DirkG, @Arie_J_Godschalk, @Peter_Kawa ,

Thank you all for analyzing my question and for your helpful response.