Good morning, I need help with a rule

Good morning :sun_with_face: Sorry if itā€™s obvious, but I get confused. Iā€™m looking to do

Is switch (a) is turned on and left on consecutively for (x) amount of time then send me a notification.

Using homebridge I have my garage attached to a virtual switch, open when opened, closed when closed...so the switch left open would mean we forgot to close the garage and Iā€™d like a notification.
Thank you for reading, any help will be appreciated

Trigger on Switch changes. Then add this to actions. It should work as you want. Just set the delay to whatever time period you need. You could also just have it close the garage door for you as well. :wink:

IF (Garage Door Switch(on) is off(F) [FALSE]) THEN
	Cancel Delayed Actions
ELSE
	Notify Pushover Notifications: 'Garage door has been left open!' --> delayed: 0:15:00 (cancel)
END-IF

Thank you and sorry, I just noticed I posted in the wrong forum

1 Like

Eh, no worries! It happens. As long as you get the rule right, that's all that matters. :smiley:

One thing Iā€™m having trouble with is what if - is false vs true means. Is there a thread explaining this that I can read?
I can only get true, and I donā€™t even know what that means lol

Thank you

Hmmm, I don't know of any such thread. However, in simple terms it is a just a true/false value of the condition. So, if a switch is off, the condition Garage Door Switch is off evaluates to true (as in, yes, the switch is off). If the switch is on, the condition is false (as in no, the switch is not off). The ELSE condition is the true side of the condition.

So, if switch is off, do this, else do that. Plus, you can flip those. I always prefer to put my false conditions first and then true conditions second. For me, it's easier to read, but that's not true of everyone.

[EDIT]: Ahhh, I see what you mean. When you are designing the rule, it shows conditions as they are in that point in time. You need to save the rule to see the conditions properly. When you click on Done with Conditional Action, then you will see the statement populate properly.

Here is how the rule displays once you complete it (I don't have a Garage switch, so I used another switch lol):

This. I find it distracting/confusing as well. I've learned to just ignore the TRUE/FALSE while rule building. Wish it wasn't shown at all while building.

Even when done building, the repeated (F)[FALSE] is confusing to most. I would bet 99% of people don't know what the first (F) means versus the second [FALSE].

1 Like

Same. This is something in RM4 that bugs me. I understand why Bruce did it this way, but for people that aren't coders or know what's going on behind the scenes, it gets really confusing; Especially when designing more complex conditionals. I have one rule that I worked on for about 2.5 hours the other day and kept confusing myself because it had 7 conditionals in one of the IFs. I finally threw my hands up and wrote an app to handle the logic.

Thank you

1 Like

No worries!

Looks like you got this sorted out above with Rule Machine, but is there any particular reason you want to use a rule? The built-in Notifications app can handle this with ease--and a lot less clicking. Just something to consider in the future! (Obviously Rule Machine gives you more power, but it's a lot more work to set up; built-in "regular" apps can do quite a bit on their own.)

1 Like

I forgot all about the Notifications app. sigh So many built-in apps, so much overlap at times.

100% right though about less clicks!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.