- id: '1615404312568'
alias: smtp test
description: ''
trigger: []
condition: []
action:
- service: notify.smpt_text_email_charter
data:
message: Plug in Tesla
title: Alarm
mode: single
Here’s the log output:
2021-03-10 13:40:51 ERROR (MainThread) [homeassistant.components.notify] Error setting up platform smtp
Traceback (most recent call last):
File "/usr/local/lib/python3.8/smtplib.py", line 389, in getreply
line = self.file.readline(_MAXLINE + 1)
File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 298, in async_setup_platform
notify_service = await hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 87, in get_service
if mail_service.connection_is_valid():
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 141, in connection_is_valid
server = self.connect()
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 127, in connect
mail = smtplib.SMTP(self._server, self._port, timeout=self._timeout)
File "/usr/local/lib/python3.8/smtplib.py", line 253, in __init__
(code, msg) = self.connect(host, port)
File "/usr/local/lib/python3.8/smtplib.py", line 339, in connect
(code, msg) = self.getreply()
File "/usr/local/lib/python3.8/smtplib.py", line 392, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed: "
smtplib.SMTPServerDisconnected: Connection unexpectedly closed: timed out
Any suggestions appreciated. I can make this work using Go.
- id: '1615404312568'
alias: smtp_test_charter
description: ''
trigger: []
condition: []
action:
- service: notify.smtp_text_email_charter
data:
message: Plug in Tesla
title: Alarm
mode: single
Log gives:
2021-03-10 19:59:54 ERROR (MainThread) [homeassistant.components.automation.smtp_test_charter] smtp_test_charter: Error executing script. Service not found for call_service at pos 1: Unable to find service notify.smtp_text_email_charter
2021-03-10 19:59:54 ERROR (MainThread) [homeassistant.components.automation.smtp_test_charter] Error while executing automation automation.smtp_test_charter: Unable to find service notify.smtp_text_email_charter
My service is not listed anywhere. Tried restarting several times. Works the same way for gmail.
I can reproduce this error message, when I alter the data für my notify service, for example when using wrong credentials, like wrong username or password (smtp with gmail):
Service not found for call_service at pos 1: Unable to find service notify.send_email
ps
username: my_user
password: my_pass
charternet wants a smtp email-address, not just an username. Just in case…
Thanks for your reply. I’ve checked credentials and they are correct. Also tried gmail (different credentials). Same failure. The interesting thing is that the service defined in my configuration.yaml does not appear in my list of services for the automation UI.
This is what happens, when something is wrong with the definition of the notify service: here the SMTP service is not generated and by this won’t show up.
I have two notify.send_email* services defined. When I change the loginname to something else (not valid) I get this:
You might give us your real values of the notify service, for example this
sender: me@someplace
is not accepted and I can’t tell if you just show it this way because you want to hide the real address or you really using this.
If you don’t want to show email addresses at least post the correct domain names and put it like this
my_address**@gmail.com** or my_name**@arcor.de**.
I used your definition and change the values to my gmail server credentials:
I tried changing the encryption to TLS. That caused the service to load. Still lots of diagnostics at restart but no “unable to find service” message. Nothing happens when I run the automation.
Tried gmail again and it works now. No idea what changed. I’ll go with it. I don’t like reducing the security level of apps with Google. This process reverses if no apps access for a period.
As I said before one of them is a HA integration called notify.events
You decide if you want to receive an email and/or a SMS and/or get a browser notification:
and/or a notification to the Android of your mobile and lots of other possibilities:
Since I knew about notify.events I prefer this over sending mails out via SMTP. It’s much faster than sending out and receiving an email.
For example sending a notification to the app on my mobile or as browser notification takes ~1.6 sec from triggering a script until it pops up at my mobile or my browser on my PC.
Fair enough. Having administered a few enterprise-grade email servers over the years I can definitely understand the pain, and the choice to not go down that rabbit hole . Thanks for the fast response.