I setup a rule to secure the house if someone is home and is using the shower. I also set it up to announce it via follow me (awesome app).
Just wondering if this is an efficient way to build this app and does it looks right? i was going to make a sep rule for each user been home alone... easier to manage. This is the first user.
essentially if that user is the only one home
and they are in ensuite for 5 mins
the rule should run and either lock back door/ front door and announce accordingly.
Both doors closed - lock both and announce both locked
one door open - lock door and announce one is open
both doors open - announce both are open
If ensuite goes inactive within 5 mins the rule should not fire.
It seems both methods will work but the rule will keep firing through even if the first if (both doors closed) is found to be true - hence been inefficient. is that right?
You can only have one ELSE in a Rule. Your rule still has an ELSE followed by another IF. You need to understand how ELSE and ELSE IF work to better understand how to write a rule. An ELSE happens whenever the IF part of the rule is not true. So, whenever the IF is false the ELSE will happen. This means that you can only ever have one ELSE statement in a rule. You cannot have 2 or more. The ELSE IF happens if the previous IFs are False and the conditions listed are true. You can have as many ELSE IFs as you want but only 1 will ever run per rule execution.The rule you have above still has one that is incorrect. Plus, you are missing an END-IF at the end of your rule.
so this rule works but the only issue is it is not cancelling if motion is inactive.
so it will run 5 or more versions of the rule. Today it triggered correctly where both doors were closed.
But then announced it 5 times so it ran 5 times.
should I add a sep if statement outside of the first if to cancel delayed if inactive?
I think j might need to set a variable so this can only run once a day. Not sure how to do that but will read up. I need to alternatively add a check of the status of the door lock as well. As it's not checking that. I removed it originally as I thought it wasn't triggering but it was due to presence sensor check (one was new and had no state)