Action notify.XXX not found

Notification is not recognized in action.

In configuration.yaml:

notify:
  - name: "OUTLOOK"
    platform: smtp
    recipient: "[RECIPIENT]"
    sender: "[SENDER]"
    server: "[SERVER]"
    port: 587
    username: "[USERNAME]"
    password: "[PASSWORD]"
    starttls: "true"
    sender_name: "Home Assistant"

In automation:

alias: "Record video on motion"
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.dlink_dcs8635lh_motion_alarm
conditions: []
actions:
  - action: camera.record
    metadata: {}
    data:
      entity_id: camera.dlink_dcs8635lh_profile1
      duration: 30
      lookback: 0
      filename: >-
        /media/video/camera-record-motion_{{now().strftime("%Y-%m-%d_%H:%M:%S")}}.mp4
  - action: notify.OUTLOOK
    data:
      title: "Motion detected"
      message: "Motion detected"
mode: single

The video is recorded without problem but when the notify action is performed I get a error:

Error: Action notify.outlook not found
Result:

params:
  domain: notify
  service: outlook
  service_data:
    title: Motion detected
    message: Motion detected
  target: {}
running_script: false

I have searched everywhere without understanding why this error occurs.

(PS: How do I format this text better?)

Post code as preformatted text (</> in the cogwheel toolbar).

Thank you.

  1. Go to Developer Tools → Actions
  2. In the Action field type notify.outlook
  3. Confirm it appears in the list of available actions. If it’s not in the list, it doesn’t exist.

It does not exist in Developer tools / Actions.

Why? It is defined in configuration.yaml and I have restarted HA.

Hi Sten, did you check the logs?

Open your Home Assistant instance and show your Home Assistant logs.

Hi Nick. Thanks for the suggestion but I have checked logs many times and the only entry is:

Error: Action notify.outlook not found
Result:

params:
  domain: notify
  service: outlook
  service_data:
    title: Motion detected
    message: Motion detected
  target: {}
running_script: false

I have also configured a simple version on another HA on a Raspberry Pi and I get the same result there.

Could it be an authentication issue since MS switched to OAuth 2.0 ?

Thank you for this suggestion, I will try another smpt service.

I tried another smtp service that do not require OAuth2 but I get the same result. I have also checked agains the documentation at https://www.home-assistant.io/integrations/smtp and confirmed it looks correct in my configuration.yaml file. I also checked that the mail server is reachable from within my HA with ping.

  1. Did you check the mail provider(s) for the correct settings?
  2. Did you run a full restart of HA?

IMHO if the notify action is not showing, you should have an entry in the logs

Yes of course there are entries in the log, I just did not checked the log files only in the logbook:

2025-03-08 12:12:18.724 ERROR (MainThread) [homeassistant.components.notify] Error setting up platform smtp
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/smtplib.py", line 398, in getreply
    line = self.file.readline(_MAXLINE + 1)
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 108, in async_setup_platform
    notify_service = await hass.async_add_executor_job(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        platform.get_service, hass, p_config, discovery_info
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 103, in get_service
    if mail_service.connection_is_valid():
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 165, in connection_is_valid
    server = self.connect()
  File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 151, in connect
    mail = smtplib.SMTP(self._server, self._port, timeout=self._timeout)
  File "/usr/local/lib/python3.13/smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
                  ~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/smtplib.py", line 343, in connect
    (code, msg) = self.getreply()
                  ~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/smtplib.py", line 401, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed: "
                                 + str(e))
smtplib.SMTPServerDisconnected: Connection unexpectedly closed: timed out

I really don’t understand why. I will check with my provider.

There you go!

If configured correctly, you should be able to see/use the notify.outlook action (as stated by @123)

I am really confused. It work perfectly well to send a mail from Thunderbird with these settings. I also checked the raw message from Thunderbird and everything is as expected. So why do I get a time-out?

Here is the log after I renamed the nofity name to “smtp _mail” and reloaded the yaml configuration. I see that a test connection is done and that fails:

2025-03-08 13:17:50.824 ERROR (MainThread) [homeassistant.components.notify] Error setting up platform smtp
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/smtplib.py", line 398, in getreply
    line = self.file.readline(_MAXLINE + 1)
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 108, in async_setup_platform
    notify_service = await hass.async_add_executor_job(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        platform.get_service, hass, p_config, discovery_info
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 103, in get_service
    if mail_service.connection_is_valid():
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 165, in connection_is_valid
    server = self.connect()
  File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 151, in connect
    mail = smtplib.SMTP(self._server, self._port, timeout=self._timeout)
  File "/usr/local/lib/python3.13/smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
                  ~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/smtplib.py", line 343, in connect
    (code, msg) = self.getreply()
                  ~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/smtplib.py", line 401, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed: "
                                 + str(e))
smtplib.SMTPServerDisconnected: Connection unexpectedly closed: timed out

Problem solved.
I experimented and found that

encryption: starttls

Should be

encryption: tls

Thank you for all help !

I’m late to the discussion but the answer to your question is that if it doesn’t exist in Developer Tools → Actions then it means the supporting integration (SMTP) either isn’t installed or isn’t working properly.

In your case, it wasn’t working properly (failed connection).

So the original error message, reporting that notify.outlook didn’t exist, was the first clue that there was something wrong with the SMTP integration’s ability to use your Outlook account. The action’s absence in Developer Tools → Actions confirmed it.

My confusion was that I did not know that the smtp connection was evaluated upon creation, I thought it was checked when automation executed.

Now I learned a lot more how do error check in HA.

Does it work now with outlook?

Unfortunately not, only with other mail service provider. Strange is that if I misconfigure the server name then I can find the outlook action in Developer tools/Actions but with correct server address it is no longer there.

For my case it works fine now but how to do config with OAut2?