This object is in archive! 

How to repeat a rule until the condition is effective

Raphael shared this question 4 years ago
Need Answer

Hello,


Maybe somebody can help me.

I'd like to make a rule that would repeat each xx times until the condition is effective.

Example : send me a push notification each 10 minutes when my garage door is open or a push notification when there's a power shutdown (I've a battery on my security module).

Thanks for your help

Raphael

Comments (4)

photo
2

Raphael,


See attached rule for your garage door, replace TestSwitch2 On for your GarageDoor Open. For the second rule, I don't know if your security module is the same as the backup module (for that matter) if it is you should have a meter device and you can use it as the second rule attached, if you don't please show me which endpoints this module create and I may be able to help you.

photo
1

Hello Alberto,


First of all, thank you very much for your answer.

Today, I tried a solution quite closer of your proposal; see attached the function repeat linked to the condition.

It seems that although the limit of number of repetition, the rule is executed each time the condition is verified within the 300 seconds. This afternoon I received 50 push messages i/o the 5 requested with this own rule without refreshing any status...

So I implemented also the time of shut down in the push message I receive each 600 seconds.

Thank you again for your precious help

photo
1

Raphael,

I find your results interesting. STOP puzzle should make the processor exit the repeat loop every time, maybe that is why the rule starts again whenever "Discharging". I can see the purpose of your rules, let me share how I do it.

I use two rules, first one is very symple, whenever the battery changes from NORMAL to DISCHARGING I get a message (rule 24).

Second one, I rather use the level of the battery itself than a repeat+timer, for this I have created a virtual meter "Zipabox_BatLvl" I set this meter to the value of the battery itself only if the difference between them is bigger or equal 10%.

Within a third rule I set this "Zipabox_BatLvl" meter to 100% whenever the battery changes from DISCHARGING to NORMAL, this so I can further detect changes next time the battery is DISCHARGING. No problem glad I could help.

photo
1

You are right concerning the "stop" block. Without it I'm flouded under the push messages (the wait instruction doesn't work). I've read somewhere that if there's no instruction after a wait, the block is not taken into account.


I've got the security module and not the backup module. I pluged an external battery to it but the meter is not working. Impossible to know the power or the level, if the battery is low as proposed in the rule creator. I just know if it's charging or discharging. There's a lack of monitoring for this module concerning the potential battery pluged to it.

Meanwhile, I think we found a good solution concerning the repeat functionality.

Bye