Nested ifs problem


#1

1) Give a description of the problem
I want to know if my kids open any of the doors when I am out running

2) What is the expected behavior?
Door open, send notification to me and announce in house

3) What is happening/not happening?
Door is locking, no announcements or push notification when any of the 3 doors opens

**4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)


#2

I would use a variable to solve this. Something like this:

I am unable to test this, but I think it is a good starting point.
I added a bunch of comments (in green) so you can verify the right devices are in the right sections.

The one caveat is: If any of your kids executes a routine or your ST location mode changes (to anything) while you are running, it will reset the variable. (meaning, your piston will think you have returned home)

Perhaps it would be better to delete the ELSE section, and have the variable reset itself using another method, such as: after X minutes. (typical length of your run)


#3

Thanks. I wasn’t sure how to use variables here. I’ll try this