Guest User

You've got mail notification

a guest
Aug 25th, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. alias: "You've Got Mail! "
  2. description: >-
  3. This automation notifies you when new mail has been delivered. It also
  4. prevents multiple notifications for the same delivery day, allowing you to
  5. retrieve the mail without receiving repeated alerts, such as someone retrieving the mail. A separate automation
  6. resets the mail notification input boolean at 07:00am every night. This
  7. process ensures you are alerted to new mail promptly without being disturbed
  8. by multiple alerts for the same delivery.
  9. trigger:
  10. - platform: state
  11. entity_id:
  12. - binary_sensor.mailbox_sensor_door
  13. from: "off"
  14. to: "on"
  15. condition:
  16. - condition: state
  17. entity_id: input_boolean.input_boolean_mailbox_notified
  18. state: "off"
  19. action:
  20. - service: media_player.play_media
  21. target:
  22. entity_id: media_player.ha_group
  23. data:
  24. media_content_id: media-source://media_source/local/success-fanfare-trumpets-6185.mp3
  25. media_content_type: audio/mpeg
  26. metadata:
  27. title: success-fanfare-trumpets-6185.mp3
  28. thumbnail: null
  29. media_class: music
  30. children_media_class: null
  31. navigateIds:
  32. - {}
  33. - media_content_type: app
  34. media_content_id: media-source://media_source
  35. - service: input_datetime.set_datetime
  36. target:
  37. entity_id: input_datetime.last_mail_notification
  38. data:
  39. datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
  40. - delay:
  41. seconds: 3
  42. - service: media_player.play_media
  43. target:
  44. entity_id: media_player.ha_group
  45. data:
  46. media_content_id: >-
  47. media-source://tts/cloud?message=You%27ve+got+mail&language=en-US&voice=AriaNeural
  48. media_content_type: provider
  49. metadata:
  50. title: You've got mail
  51. thumbnail: https://brands.home-assistant.io/_/cloud/logo.png
  52. media_class: app
  53. children_media_class: null
  54. navigateIds:
  55. - {}
  56. - media_content_type: app
  57. media_content_id: media-source://tts
  58. - media_content_type: provider
  59. media_content_id: >-
  60. media-source://tts/cloud?message=You%27ve+got+mail&language=en-US&voice=AriaNeural
  61. - service: notify.mobile_app_pixel_7
  62. data:
  63. message: Mail was delivered at {{ now().strftime('%I:%M %p on %b %-d') }}
  64. title: Mailbox Notification
  65. - service: input_boolean.turn_on
  66. data: {}
  67. target:
  68. entity_id: input_boolean.input_boolean_mailbox_notified
  69. mode: single
  70.  
Add Comment
Please, Sign In to add comment