Triggering a custom SMTP notification - Falling at the first hurdle

I’ve understood you. I just wondered if there’s a similar authentification procedure regarding your server.
I had exactly the same problem you described when setting up SMTP for my Gmail account.

I’m sorry, I’m not sure that I’m explaining this very well.

My problem isn’t that the authentication is failing, it’s that I’m failing to even get that far.

I can’t trigger the code that does the authentication. It says that it cannot find Notify.vmail, not that there is an error with notify.vmail. It’s failing to run it, rather than failing while running it.

The service won’t work if the authentication fails. At least this was the reason in my case.

My problem isn’t that the service is failing, it’s that I can’t call the service. I I put some dummy code in the service it still can’t find it.

ERROR (MainThread) [homeassistant.components.automation.smtpmessage] SMTPMessage: Error executing script. Service not found for call_service at pos 2: Unable to find service notify.vmail

We are running in circles. If the service is unknown, there’s a chance that it’s not set up properly. Anything in the HA logs that would be helpful?

P.S.: The integration settings accept a debug option:

debug boolean (optional, default: false)
Enables Debug, e.g., true or false.

debug boolean (optional, default: false)
Enables Debug, e.g., true or false .

Sorry, but could you please dumb it down a little, I haven’t gotten that far in the documentation yet. I don’t know where this code should go or how to run it.

We are running in circles. If the service is unknown, there’s a chance that it’s not set up properly. Anything in the HA logs that would be helpful?

This is how I set it up

trigger4

The error log says:

ERROR (MainThread) [homeassistant.components.automation.smtpmessage] SMTPMessage: Error executing script. Service not found for call_service at pos 2: Unable to find service notify.vmail

I’ve not yet included the content of the message that I want to send as I can’t even get that far.


# Example configuration.yaml entry
notify:
  - name: "NOTIFIER_NAME"
    platform: smtp
    sender: "YOUR_SENDER"
    recipient: "YOUR_RECIPIENT"
    debug: true

Then go to Developer Tools / Services and try to call the notify service with the required fields.

I’m afraid that you’re going to need to dumb it down a little more

notify:
  - name: "vmail"
    platform: smtp
    sender: "..."
    recipient: "..."
    debug: true

If I write the above, with two valid email addresses on my sever in the … I get the error message

No service defined, please define a service: key

This looks like the same problem as I was having originally, HA can’t find notify.vmail. Which means that I’ve probably either tried to configure it in the wrong place or that I’ve gotten the syntax wrong and the system isn’t recognizing it as existing in the form that I want.

I still suspect your server settings.

I just noticed that the ssl option of the integration is enabled by default. So you could give it a try:


notify:
  - name: "vmail"
    platform: smtp
    sender: "..."
    recipient: "..."
    verify_ssl: false

I hate to sound like a broken record, but HA is telling me that it can’t find notify.vmail, not that there is a problem with notify.vmail.

I don’t think that it’s even gotten far enough to even reach that line of code. The error messages keep saying “service not found”.

I’ve changed it and restarted the server, but I get the same error message.

I don’t think that HA is even triggering notify.vmail, The log files keep saying that the can’t find it.

I’ve set up notify.vmail in the configuration.yaml. Do I need to set any permissions in order for it to be visible?

That’s the same. The notify integration have to be set up properly. If it isn’t, there will be no service and so it is unknown for HA. The only thing I can think of is to check your server settings (sounding like a broken record, too :slight_smile: )
Another possibility is of course that there’s a bug in the integration refering to own SMTP servers. You could raise an issue against on Github.

Can you give me something that I can copy and paste in to see if properly formed code will run.

Is there an HA equivalent to Hello World?

The network logs say that there were no outbound SMPT requests from my HA server, and the mail sever says that there were no inbound requests, so nothing ever left HA.

I’m afraid that I don’t understand enough debug this.

IS there any documenation on this?

Try looking in your log file.

grep smtp /config/home-assistant.log

If nothing there, up the logging on notify - see the logger docs.

Oh and PLEASE stop posting pictures. Yaml is text. Logs are text.

As per my original post. I have only just started using HA, and I don’t know how to do any of that yet.

You appear to know how to type. So do it.

In the console. Or the ssh addon.

And stop posting multiple threads about the same issue.

1 Like