IMAP Folder Alerting on non-Received Email

I’m trying to create an automation which will monitor an IMAP folder and alert if a matching email is not received for 10 days. The thought was to check using an automation and update a sensors timestamp. Then a second automation would check the age of the sensor timestamp and alert.

The alert works fine apart from generating a new message each time I run the automation, I’m not sure how to stop that such that it only alerts on a new email.

description: >-
Trigger if an email is received with subject line ‘Your Weekly WP Mail SMTP Summary for urbanpersonaltraining.com.au’
triggers:

  • event_type: imap_content
    event_data:
    subject: Your Weekly WP Mail SMTP Summary for urbanpersonaltraining.com.au
    initial: true
    trigger: event
    conditions: [ ]
    actions:
  • data:
    message: Email Received
    action: notify.mobile_app_pauls_iphone
    alias: Wordpress Email Alert

Please follow Questions Guideline #11, by properly formatting the configuration you have posted.

Running the automation manually whether through the “Run” option in the breadcrumbs menu or by using the automation.trigger action skips the trigger and conditions… so the event data requirements that you have set up, like initial: true, are not checked at all.

You should be using a trigger-based Template sensor, not an automation for the first step.