Yet another Mailbox check piston


#1

1) Give a description of the problem
I have a working mailbox piston that utilizes a motion sensor to trigger each statement. However, my issue is that after someone checks the mail. If another person opens the mailbox afterwards, it will announce and re-run the piston from the beginning like the mailman came and dropped off mail again. At the end of the night if I don’t trigger (check the mail) the activity for the 4th time, it will run & announce that no one got the mail statement and then reset for the night.

2) What is the expected behaviour?
I’d like to have it stop re-triggering the the piston once the mail was checked. First time the mailman drops it off, 2nd time someone opens it and gets the mail. It ends for the day. If my wife or one of the kids checks after me, or vise versa it won’t reset the piston. If nobody checked the mail, then run the end if-statement.

3) What is happening/not happening?
Re-triggers, after someone retrieves the mail. When checking the mail for the 2nd time by another person. Then announces mail wasn’t checked unless someone checks the mail for the 3rd time that day.

**4) Post a Green Snapshot of the piston![image|45x37]


#2

I found a few pistons that tackled my issue with integers, just not sure if I implemented it correctly. If anyone can take a gander at it to see if it makes sense to accomplish my goal of ending the loop.


#3

This should work in theory, an alternative would be a second boolean, call it checked

I would also separate the reset block, maybe every night at midnight

If motion sensor changes to active
and 
Mail is false
and
Checked is false
     Do stuff
     Set mail to true
If motion sensor changes to active
and 
Mail is true
and
Checked is false
     Do stuff
     Set checked to true
If time happens daily at 9:03
  and
  mail is true
  and checked is false
 then send alert

Every night at midnight
set mail to false
set checked to false