#######################################
### Intelcom Deliveries Template ###
#######################################
- trigger:
- trigger: event
event_type: "imap_content"
id: "Intelcom Amazon Delivery Content"
event_data:
- sender: "[email protected]"
- sender: "[email protected]"
sensor:
- name: Intelcom Amazon Delivery
# #{% if 'Your package has been received!' in trigger.event.data["subject"] %}
state: >-
{% if 'Your delivery is scheduled for today' in trigger.event.data["subject"] %}
coming_today
{% elif 'Fw: Your delivery is scheduled for today' in trigger.event.data["subject"] %}
coming_today
{% elif 'We have your package!' in trigger.event.data["subject"] %}
received
{% elif 'Fw: We have your package!' in trigger.event.data["subject"] %}
received
{% elif 'Your package will be there in the next hour!' in trigger.event.data["subject"] %}
next_hour
{% elif 'Fw: Your package will be there in the next hour!' in trigger.event.data["subject"] %}
next_hour
{% elif 'Fw: Your package is on its way' in trigger.event.data["subject"] %}
on_the_way
{% elif 'Your package is on its way' in trigger.event.data["subject"] %}
on_the_way
{% elif 'Hooray! Your package was delivered!' in trigger.event.data["subject"] %}
delivered
{% elif 'Fw: Hooray! Your package was delivered!' in trigger.event.data["subject"] %}
delivered
{% endif %}
Does it work with one sender: data line?
If it does, just put 2 trigger sections each with it’s own sender: key.
It is possibly looking for an instance where the sender is 2 different things, and that doesn’t happen. If each of the 2 triggers look for 1 key, one or the other should trigger.
@Sir_Goodenough not sure what you mean by It is possibly looking for an instance where the sender is 2 different things
but ya it works for a single email but since i need to forward hotmail emails to gmail to use Imap and it has to go into the same template
so this is what i did so far there is no compile errors but havent tested it
#######################################
### Intelcom Deliveries Template ###
#######################################
- trigger:
- trigger: event
event_type: "imap_content"
id: "Intelcom Amazon Delivery Content"
event_data:
sender: "[email protected]"
- trigger: event
event_type: "imap_content"
id: "Intelcom Amazon Delivery Content"
event_data:
sender: "[email protected]"
sensor:
- name: Intelcom Amazon Delivery
# #{% if 'Your package has been received!' in trigger.event.data["subject"] %}
state: >-
{% if 'Your delivery is scheduled for today' in trigger.event.data["subject"] %}
coming_today
{% elif 'Fw: Your delivery is scheduled for today' in trigger.event.data["subject"] %}
coming_today
{% elif 'We have your package!' in trigger.event.data["subject"] %}
received
{% elif 'Fw: We have your package!' in trigger.event.data["subject"] %}
received
{% elif 'Your package will be there in the next hour!' in trigger.event.data["subject"] %}
next_hour
{% elif 'Fw: Your package will be there in the next hour!' in trigger.event.data["subject"] %}
next_hour
{% elif 'Fw: Your package is on its way' in trigger.event.data["subject"] %}
on_the_way
{% elif 'Your package is on its way' in trigger.event.data["subject"] %}
on_the_way
{% elif 'Hooray! Your package was delivered!' in trigger.event.data["subject"] %}
delivered
{% elif 'Fw: Hooray! Your package was delivered!' in trigger.event.data["subject"] %}
delivered
{% endif %}
@Didgeridrew whats a more general trigger? i wouldnt know how to make a template condition ill have to look that up google searchs as ive had this working for several years but since hotmail cant redirect to gmail anymore correctly i had to switch to forward so just trying to incorporate it into the same
Leave the event data specification out of the trigger definition:
- trigger:
- trigger: event
event_type: "imap_content"
id: "Intelcom Amazon Delivery Content"
condition:
- "{{ trigger.event.data.sender in ['[email protected]', '[email protected]'] }}"
sensor:
- name: Intelcom Amazon Delivery
state: >-
{% set subject = trigger.event.data.subject %}
{% if 'Your delivery is scheduled for today' in subject %}
coming_today
{% elif 'We have your package!' in subject %}
received
{% elif 'Your package will be there in the next hour!' in subject %}
next_hour
{% elif 'Your package is on its way' in subject %}
on_the_way
{% elif 'Hooray! Your package was delivered!' in subject %}
delivered
{% endif %}
All of those ones with Fw: should be picked up by the non-forward search, so there’s no need to duplicate them.
Another option would be to set up a specific IMAP service for those senders, then you could use the entry ID to specify which imap_content events to react to.
i not sure what " Another option would be to set up a specific IMAP service for those senders, then you could use the entry ID to specify which imap_content events to react to."
that would look like or how to do it
but as long as one of these work i happy… so i set it up way you made it.. and ill see if it works today..
It would look exact like your current IMAP integration but with one more service added to the list that only reports on emails from those two senders.
You would go to the Integrations page, find IMAP, click “Add Service” at the top, click it, then put in all the account details, in the “IMAP search” field you would put…