Hello community,
I am just starting with Home Assistant and got my 2 Aqara sensors on my Conbee2 running to get a status about my garage doors.
At the moment I do not plan to configure an external access to my network, so I configured an imap sensor and a notification. So if I send an email to the monitored mailbox I got an email back with the status about these 2 sensors.
What I want to achieve is:
Depending on who requested the status mail (looking for the senders address) the notification’s recipient should be filled dynamically.
This would mean:
- I send an email to the home assistant mailbox → I got the status back.
- My wife send an email to the home assistant mailbox → ONLY my wife get the status back.
At the moment I use this config:
configuration.yaml
sensor:
- platform: imap_email_content
name: imap_state_req
server: server
port: 993
username: mail
password: pw
senders:
- sender1
- sender2
notify:
- name: smtp_state_ans
platform: smtp
server: server
port: 587
timeout: 15
sender: sender-address
starttls: true
username: mail
password: pw
recipient:
- sender1
sender_name: sender-name
automations.yaml
- id: statreq
alias: Check Status by Mail
trigger:
platform: state
entity_id: sensor.imap_state_req
action:
service: notify.smtp_state_ans
data_template:
title: Status from Home Assistant
message: Status
data:
html: >
STATUS GARAGE <br>
Door left: {{ states.binary_sensor.sensor_garage_left.state }} <br>
Door right: {{ states.binary_sensor.sensor_garage_right.state }}
Do you have any idea how I get this working with dynamic recipients depending on the sender’s address?
Many thanks in advance!
toasti