The delay that happens with polling the Yale doorman lock makes my hass to not get information about who unlocked it. I need that information to trigger certain automations, and at the same time I don’t want to sacrifice the built in auto lock feature.
I made a user for hass in the Verisure app and also a Gmail account for it. Then I enabled email notifications for unlocking.
I then utilized the imap email content sensor to get information from those emails in hass. I made an additional template sensor for just unlocking from outside and then searched the body of the email for certain words (usernames) and finally set the sensor to that user.
Maybe this can help someone else with the same problem. Could be extended to contain time and who locked etc.
sensor:
- platform: imap_email_content
server: imap.gmail.com
port: 993
name: Verisure Mail
username: !secret verisure_mail_username
password: !secret verisure_mail_password
senders:
- [email protected]
- platform: template
sensors:
unlocked_by:
friendly_name: "Unlocked by"
value_template: >-
{% if states.sensor.verisure_mail.attributes.subject == "Upplåst utifrån" %}
{% if states.sensor.verisure_mail.attributes.body.find("Isabella") | int >= 0 %}
Isabella
{% elif states.sensor.verisure_mail.attributes.body.find("Stefan") | int >= 0 %}
Stefan
{% elif states.sensor.verisure_mail.attributes.body.find("firma") | int >= 0 %}
Cleaners
{% elif states.sensor.verisure_mail.attributes.body.find("Dante") | int >= 0 %}
Dante
{% elif states.sensor.verisure_mail.attributes.body.find("drar") | int >= 0 %}
Parents
{% else %}
Unknown
{% endif %}
{% endif %}