Who will notify.notify notify?

Tags: #<Tag:0x00007f73923e9ce0>

Hello, newbie here, sorry for my (probably) stupid question. I’ve been setting up hangouts and gmail smtp notifications, which work under their own service (notify.hangouts and notify.gmail), but can’t get them to work as expected under the notify.notify service.

If I understood correctly, notify.notify should notify all platforms. Is that correct? Because when calling notify.notify I am only getting notifications in the mobile App, which I haven’t even configured. I am not trying to configure a group, only trying to understand what is notify.notify supposed to do.

Thank you in advance.

See this post:

1 Like

It notifies all the people.
If you use notify.your_phone it will be just you.
notify.notify sends the notification for everybody with the app who is logged in in your home assistant (family, friends and everybody you share your HA).
If you need something special, you need to change the notifications, for example notify.whatsapp (with callmebot).
So be careful with sensitive information you notify.

No it does not. Read my post above.

Also as evidenced by observations in the original question:

Thank you for your answers. Sorry to bother, but I still don’t get it though.

I am not really trying to notify all with a group, I just would like to understand why it is behaving like that. I’ve been searching for info on how notify.notify works to no avail, and it is really frustrating.

This makes sense, as it is exactly how it is behaving.

I’m sure this makes sense, but I don’t understand it… which notification platform is used if you don’t specify it through service name? If I go to “Services > developer tools”, invoke “notify.notify” and simpy provide a message, it will be sent without specifying any platform. Is there any “default platform” which happens to be in-app messages?

Thank you again.

What app? Do you mean the android app? Or the ios app?

There are 69 notification integrations.

The service you haven’t given a name, or if they all have names, possibly the first one. I’m not reading the source to find out.

Just in case anyone comes across this post and thinks this is useful information, I’ve been doing a little research and this is what I’ve found:

notify.notify will notify one of the platforms (and only one) without a “name” attribute.

The thing is, when calling the service “notify.xxx” you are calling the notify platform and the “xxx” notification integration through it’s name.
And here comes the confusion (and I think it’s not an ideal design), the name’s attribute default value is “notify” (in any notify platform integration). So, if you don’t overwrite the default value for the “name” attribute on your notify integrations, all of them will become the service name “notify.notify”. HA doesn’t call them all, probably the “notify.notify” service data is overwritten with each definition that doesn’t have a name. I’ve gone through the code trying to find it out but I am not into Python at all, so I don’t have a clue on which is the behaviour. I can tell it is not the first/last definition, I’ve tried moving platform configurations and I always got notifications in this order: “mobile_app” > “hangouts” > “smtp”.

This means in fact, that “notify.notify” is not really a default service for notifications, but the casual result of omitting an attribute in any of your notification platform configs. The fact that installing the HA mobile app automagically creates a notify integration configuration behind the scenes that also targets “notify.notify” service name only adds more confusion.

This means that if you only define one notify platform without name, it will be reachable through the “notify.notify” service. If you only define one notify platform with a name, you won’t have a “notify.notify” service (you’ll have to call it through “notify.platform_name”). If you have the mobile_app installed, no matter what, this is the one that will get “notify.notify” notifications.

It’s very confusing indeed, and I really think it could be better explained in the documentation. I found this issue that gave the best clues, but it was closed without a conclusion:

Hope this helps anyone.

PS: I know all of this is exactly what @tom_l was saying, but I just wanted to have a broader explanation.

I always thought notify.notify was an odd construct.