Hi all, I’m a newbie when it comes to HA, but I’ve managed to get most things working so far. I have a trigger that is able to send an email to one recipient. I’d like to send the same email to several people at the same time
notify:
name: NOTIFIER_NAME
platform: smtp
server: MAIL_SERVER
port: YOUR_SMTP_PORT
sender: SENDER_EMAIL_ADDRESS
starttls: true or false
username: YOUR_SMTP_USERNAME
password: YOUR_SMTP_PASSWORD recipient:
- [email protected]
- [email protected]
I’ve tried the above and various iterations that are similar to conditional nesting (used in automation) but to no avail.
I’ve also tried recipient: '[email protected]; [email protected]’
My second question is around the “message:” field. I am able to setup the message with simple text, but when I try to use a template it fails. As an example this works… message: 'Door open’
this doesn’t message: 'Door is open @ {{states.sensor.garagefeedback.state}}%.'
although the second works fine in the template tester showing this- > Door is open @ 10%.
Hi,I’ve tried a lot of variations here are some samples
like this recipient: '[email protected][email protected]’
produces… 16-10-03 01:29:31 homeassistant.bootstrap: Invalid config for [notify.smtp]: expected an Email for dictionary value @ data[‘recipient’]. Got ‘[email protected][email protected]’
like this recipient: ‘[email protected]’, '[email protected]’
produces… 16-10-03 02:08:36 homeassistant.util.yaml: while parsing a block mapping in “/home/hass/.homeassistant/devices/notify.yaml”, line 1, column 3 expected , but found ‘,’ in “/home/hass/.homeassistant/devices/notify.yaml”, line 9, column 32
I’ve checked my gmail account and a comma is used to separate email addresses in the ‘To:’ field when constructing a email. I have a work around that sends two separate emails from the same trigger using two services from the same action, calling two different “notify” constructs which are identical except for the recipient addresses and the name of course. Using the work around generates emails that are a few seconds apart with slightly differing values…not a big deal but it would be nice if they were identical and sent at the same time.
17-01-15 22:43:10 homeassistant.core: Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1054, in execute_service
service_handler.func(service_call)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/notify/__init__.py", line 110, in notify_message
notify_service.send_message(**kwargs)
File "/home/hass/.homeassistant/custom_components/notify/my_smtp.py", line 138, in send_message
return self._send_email(msg, recipient)
File "/home/hass/.homeassistant/custom_components/notify/my_smtp.py", line 145, in _send_email
mail.sendmail(self._sender, recipient.split(','),
AttributeError: 'list' object has no attribute 'split'
def _send_email(self, msg, recipientstring):
"""Send the message."""
mail = self.connect()
for _ in range(self.tries):
try:
mail.sendmail(self._sender, recipientstring.split(','),
msg.as_string())
I setup my notify.smtp in configuration because I wanted to get SMS messages for notify automation, and it works great. ATT allows you to send an email that generates an SMS: