Fibaro button for funny alarm

I got myself a Fibaro zwave Button and was hoping to get this into this Automation. I still haven't made this live yet so don't know if it works but do you think this is ok? I would like to push the Button 5 times to make the automation stop the Automation aswel as presence

Here are my thoughts:

  1. I don’t understand why the rule gets paused. This will prevent from running again… ever… until unpaused. I would recommend removing those. :slight_smile:
  2. Instead of having a 2nd if condition, you could do an else condition and have it repeat while a hub variable’s value is less than 5
  3. The Exit Rule actions should be removed (both of them). They will prevent your rule from running as all the rule actions are after them.
  4. You could do a separate rule that ups the same hub variable as above each time it is pressed, using variable math in Rule Machine (RM). In that same rule, you could set a wait for 1 or 2 minutes, and reset it back to zero at that point.

thank you, I tried it out today and it didn't work when the neighbours checked on the house, can't wait to get it working to hear there reactions lol
I was looking for a else button but I couldn't find how to add it, please help this would be great, I will take any advice I can please

1 Like

I started again is this any better?

Getting there!

  1. You should move the End-if that is before “Push button 5…” to the end of the rule. The commands to execute need to be either after the if condition or after the else condition, but before the end-if.
  2. Why the “Push button 5 on magic button” command?
  3. There is nothing in there to stop the repetition of the notification. Instead of “Repeat every …”, you should add a “Repeat every 00:01:00 while variable “Magic Button Pressed” is lower than 5”. Be sure that you have a separate rule that increments the “Magic Button Pressed” variable.

I think I busted my hub with my efforts again, I don't seem to be able to add a variable, I manage to add one for weather before so I thought I knew how to do it, maybe I am doing something wrong. I hadn't given it a thought before, I was hoping the push the button 5 was going to tell the hub the button needed to be pushed 5 times but nothing is as simple as I think lol. I am still very new and trying to learn from you guys still but hopefully I am getting a Little better

got it working there was something in there from my weather variable that needed cancelling for some reason

1 Like

is this the variable I need for the button sorry for stupid questions

can I have a clue on how to get the button to know when its pressed 5 times please

Yes, that variable looks right.

You will need another rule to update the button variable.

Trigger: Press of a button (do you have a button you can use for this?)

Action:
Variable math: add 1 to variable magic button pressed
wait elapsed time: 00:01:00 (1 minute)
Set Variable magic button pressed to 0

What this will do is:
Every time the button is pressed, the rule will be triggered and will add 1 to the variable, but if nothing happens for 1 minute, it will be reset to 0. That last part happens because a “Wait” condition (and all after it) will be cancelled by the rule if it is triggered again. So the 1 minute will reset with every button press.

1 Like

very cool I will give this a go thank you, I am using a fibaro button, its zwave plus should be good

1 Like

is this what I needed for the button, it looks close

It is very close!

You don’t need the variable called « math ». Instead, change the first line to set magic button pressed (1+ magic button pressed(5))

Change the 2nd line from:
Delay 0:01:00
To
Wait 0:01:00

Delay will not get cancelled with a new instance of the rule, only Wait will. So as it is currently, it will likely cause some unexpected behaviours.

Thank you for your time on this, I think I might almost have the button part this time does this look any good?

Yup, that looks right! Let me know once you tested it.

1 Like

had a mis fire, looks like I got the presence to stop the automation if I am not at home but could be more too

not sure what to do so I will wait for you to advise if ok,

Yea, there are changes required to the rule for it to work:

is this any better?

the push Button 5 on magic command is me trying to say push the button 5 times to end the automation but I can't work out how to do it right lol

Here is a visual of the remaining changes:

Note that there seems to be an issue with the If condition. There are apparently 3 conditions to check, but 4 “(F)”, this probably means that there is an “empty” condition and therefore the condition will always detect this as false.
The easiest to do here is likely to remove it and add another that says “if (Richard iPhone, Richard, Stella all absent) THEN”. If you do this, the “ELSE” can be removed.

Thank you again.
I made a few adjustments, and come up with this with your help. It seems to be running ok while indoors, I am just about to give it a trail run when not in to see what happens.

not sure if its stopping the Automation when I return or if its when the button is pushed 5 times

1 Like

Download the Hubitat app