I have the IMAP integration setup in HA, and essentially I am trying to parse order information from emails so I can get the latest item ordered and use this to trigger an automation.
I have it set to a folder in the config, and I can see that there are 4 new messages.
however, even though text is checked on the config, I don’t see the data anywhere? If I go to Developer tools > states. I only see the state of “4”
I have this template sensor in my config.yaml
- sensor:
# Ordered Item
- name: "Etsy Item Ordered"
unique_id: etsy_item_ordered
state: >-
{% set body = states('imap_-------_messages') %}
{{ body | regex_search("Item\s*(ordered)?:\s+(.+?)(\n|$)", ignorecase=True) | default("No Item Found") }}
attributes:
items: >-
{% set body = states('imap_-------_messages') %}
{{ body | regex_findall("Item\s*(ordered)?:\s+(.+?)(\n|$)", ignorecase=True) | map(attribute=2) | list }}
The sensor shows up in dev tools > states but with state false. I must be missing something here, and any help is greatly appreciated. thanks!