vicr
(victor richter)
January 14, 2021, 10:48pm
1
I added this to my conf yaml file:
sensor:
- platform: imap_email_content
server: imap.hostinger.com
name: alarm_status
port: 993
username: [email protected]
password:1234
senders:
- [email protected]
value_template: >-
{% if 'arm' in subject %}
alarm_armed
{% elif 'disarm' in subject %}
alarm_disarmed
{% endif %}
Now, I don’t know what to do next to make the status appear on the overview page. Please help this newbie!
tom_l
January 15, 2021, 4:15am
2
Add the entity (sensor.alarm_status
) to an entities card or a glance card.
To start, go to the Home Assistant Overview page, click the three dots at the top right of the screen and select ‘Edit Dashboard’. Then click the blue ‘+ Add Card’ icon at the bottom right and select a card to add.
vicr
(victor richter)
January 15, 2021, 4:42am
3
Thanks for the help. I found I had the wrong password!
vicr
(victor richter)
January 15, 2021, 4:47am
4
I changed the logic to:
{% if 'Disarm' in subject %}
alarm_disarmed
{% elif 'Arm' in subject-%}
alarm_armed
{% else -%}
alarm_unknown
{% endif %}
But when I get the email that alarm is armed, it is not changing to alarm_armed, stays at alarm_disarmed. BTW, what does -% do?
vicr
(victor richter)
January 15, 2021, 5:03am
5
Well, changed to alarm_armed, but took about 5 minutes. But, then changed back to alarm_disarmed…
How often does it check for a new message?
tom_l
January 15, 2021, 5:37am
6
I interpreted this:
to mean, “how do I put the sensor on a Lovelace dashboard.”
Did you mean to ask “why isn’t my sensor showing the correct sate?”
It does not check. The state is pushed to home assistant by the email server:
vicr
(victor richter)
January 15, 2021, 5:56am
7
yes, why doesn’t it show the correct state?
vicr
(victor richter)
January 20, 2021, 3:09pm
9
I switched it over to gmail and changed the security level, and now it works fine!
tom_l
January 20, 2021, 3:18pm
10
So just a slow email server then.