SMTP Integration

I am trying to get basic SMTP notification working following docs.

I have following automation yaml:

alias: Send E-Mail Every Morning
description: ""
trigger:
  - platform: time
    at: "08:00:00"
condition: []
action:
  - action: notify.gmail
    data:
      title: Good Morning
      message: Rise and shine
      target:
        - [email protected]
mode: single

I have following block in the configuration.yaml

notify:
  - name: "gmail"
    platform: smtp
    server: "smtp.gmail.com"
    port: 587
    timeout: 15
    sender: "blah"
    encryption: starttls
    username: "blah"
    password: "blah"
    recipient:
      - "[email protected]"
    sender_name: "blah"

I get this error: Error: Action notify.gmail not found

what I am doing wrong? HASS is running in docker container.

Thanks

btw, removing quotes did not help: name: gmail

Hi leonbrag,

Here are my gmail notify yaml’s if they help you any. These work.

Home-Assistant-Config/notify.yaml at 939d14a3ca362ddbcb2c11bd5f6833af64c8814c · SirGoodenough/Home-Assistant-Config · GitHub.

Thanks. It did not help. I split notify to separate file similar to what you have. And get the same error.
I suspected it’s related how automation is called, it cannot find automation profile

I figured it out. It appears the be an issue/bug, the name does not bind to “notify”.

so if I comment this line:

name: “NOTIFIER_NAME”

then this works:
action: notify.notify

it works because default string is notify:

name string (Optional, default: notify)

It does not seem like a bug, but working as intended.

Quotes from the docs at Notifications - Home Assistant

The legacy notify platform will expose a generic notify action that can be called to send notifications.

and

Be aware that the notify.notify action is shorthand for the first notify action the system can find. It might not work as intended. Choose a specific action to make sure your message goes to the right place.

yes, you are correct. I did not realize that notify.notify send SMS and not email. So for some reason name is not bound to notify.name.

looks the same as HELP - issue with hass saying notify.email does not exist - #8 by davel4wa

Solved it.
Per this post, this error is reported FOR ANY SMPT error. Once I enabled debug, i saw the problem.
The error should state that it’s related to STMP dialog, NOT caused by finding profile