Mail state in Home-Assistant - Alarm system

Hi guys, i will like to make an alarm state from emails i got from my security company.

I receive “alarm on” and “alarm off” in emails each time its changed state.

Can i integrate that with Home-Assistant in some way?

I am using Hotmail, can i use this: https://www.home-assistant.io/components/imap_email_content/

Yep, you should be able to use value_template to set the sensor’s state based on whatever is in the body or subject of the emails you receive. For example, if the emails for a triggered alarm from your security company include “Burglar alarm triggered” you could use the below for value_template:

value_template: >
  {% if 'Burglar alarm triggered' in subject %}
    Alarm triggered
  {% elif 'Burglar alarm cleared' in subject %}
    No alarm
  {% endif %}

Of course, you need to customize this to whatever you want.

Hi guys, i found a solution:
i put this in my sensor.yaml file, check this out: https://www.home-assistant.io/components/imap_email_content/

######################################
### Mail alarm system sensor setup ###
######################################
  - platform: imap_email_content
    server: imap-mail.outlook.com
    name: home_alarm_system
    port: 993
    username: !secret hotmailusername
    password: !secret hotmailpassword
    senders:
      - [email protected]
    value_template: >-
      {% if "alarm_on" in subject %}
        alarm_on
      {% elif "alarm_off" in subject %}
        alarm_off
      {% endif %}