Notify Platform

Hi everybody,

I am just trying to find a notification platform that suits my needs.
I can’t expose HASS on the web because my internet provider blocks incoming connections.

So I have to use some external service.

I was thinking about SMTP but looks like google does not like anymore plain connection.
I wrote what’s inside the docs:

notify:
  - name: NOTIFIER_NAME
    platform: smtp
    server: smtp.gmail.com
    port: 587
    timeout: 15
    sender: [email protected]
    encryption: starttls
    username: [email protected]
    password: thePassword
    recipient:
      - [email protected]
      - [email protected]
    sender_name: My Home Assistant

Of course I didn’t send any email to James or bob, and I am no john.
The error that I see in the log is:

[homeassistant.components.notify.smtp] SMTP server not found (smtp.gmail.com:465).

I changed the port to the tls one but also with the default one the message is the same.

I was thinking about IFTTT but for some reason the error that I receive is similar to the one posted for SMTP

[homeassistant.components.ifttt] Error communicating with IFTTT
...
<urllib3.connection.VerifiedHTTPSConnection object at 0x728968f0>: Failed to establish a new connection: [Errno -3] Try again

It looks like home assistant is unable to contact the servers. From ssh I can ping both hosts.
Some idea about where to investigate?

I am using dhcp plugin of Hass.io and PiHole pluging as domain provider. But I can reach both services from multiple points inside my local network.

Thank you for reading and for the suggestion that I will receive.
Andrea

My config looks like what you have here and it works correctly. Do you have anything else on your network that connects to the Google SMTP server OK? If so then your Gmail account should be OK and I’d look to your firewall to make sure you are allowing the outgoing connection to the server.

For Gmail yo work you must login to account in web and set it to allow insecure connection or something (sorry I forget)

MQTT is option also.
You can use external broker/server to pass messages.
This can be your own server or 3rd party

EDIT
Gmail requires allow less secure apps
https://support.google.com/accounts/answer/6010255?hl=en

Thank you both for your comments.
I already allowed secure connections. That was the first thing I did as it is written in the documentation.

The error that I see is more “general” I think.
Cannot connect to smtp.google.com.

I tried other client in the meanwhile, it connects correctly from inside my network,

If smtp.google.com not allowed, standard email from phone or PC should fail also. Is that OK?

mmmpf… I ate technology.

I had the password escaped in the yaml config file. I changed it without strange characters.

Solved with the first rule of computers… Reboot.

yes, it worked.