I’m in the process of converting a second system that I maintain over to Home Assistant. I have some events in the old system that may have a better way of doing the same in HA. Wondering how “you” would do this.
This event (actually takes 3 events) is a Mail notification.
I have a contact closure on the mailbox door and another on the mailbox flag.
Automation 1:
++++++++++++++++++++++++++++++++++++++++++
WHEN
Mailbox Door Contact changes and becomes Open
THEN
IF
Timer Mail Notify’s value is less than 1s
THEN
Wait 5 Minutes, 0 Seconds
If the Event Conditions are True, Run Event Mail 2 - Mail Delivered
End This Event
THEN
IF
Timer Mail Notify’s value is more than 1s
THEN
Stop Timer Mail Notify
Set Timer Mail Notify to time 0 Seconds
End This Event
++++++++++++++++++++++++++++++++++++++++++
Automation 2:
++++++++++++++++++++++++++++++++++++++++++
WHEN
This event is MANUALLY triggered
AND IF
Main Exterior Mailbox Flag Contact has a value equal to Closed
THEN
Play Audio File: Media/youGotmail.wav
To: CHROMECAST:LIVING ROOM SPEAKER
…and wait for playing to finish.
Start Timer Mail Notify
Send a NotificationTo: iPhoneMessage: You got Mail!Sound: HSBuddy Send With High PriorityActions: Default: Open the App
++++++++++++++++++++++++++++++++++++++++++
Automation 3:
++++++++++++++++++++++++++++++++++++++++++
WHEN
Timer Mail Notify’s value becomes 30m, 0s
THEN
If the Event Conditions are True, Run Event Mail 2 - Mail Delivered
++++++++++++++++++++++++++++++++++++++++++
How it works:
When the MB door is opened, if a timer I have for this is at 0 (meaning not running), it waits 5 minutes to give the mailman time to place mail in the box.
After the 5 minutes expires, and if the flag is still down, it will play an announcement so the homeowner knows the mail has been delivered, and it will start the afore mentioned timer… This systems timers count up but HA timers can do the same.
When the timer hits 30 minutes, it re-runs the 2nd automation which annpounces again and restarts the timer. This will repeat every 30 minutes until the mail is retrieved. This is all automation 3 does.
Automation 2 also stipulates that the flag is down. The homeowners use the mailbox to leave mail for the mailman to take. When they do this, I made sure they realize they have to put the flag in the up position (which they’re supposed to do anyway) but that flag up opens the flag contact closure which stops the announcement from running. No need to announce the mail is here if it was just them inserting mail. This completes what the 2nd automation does.
The other condition in automation 1 is what stops the 30 minute loop.
When the door is opened and if the timer is running, it means it’s them retrieving the mail, so it stops the notifications and stops the timer.
What would the HA equivalent be?