Can't get work HTML5 Push Notifications - VAPID

Just to verify, you try below?
No result?

Check to see if messages being received by browser but not displayed

CHROME
Browse to chrome://gcm-internals
Send message and you should see receipt by browser or error.
Be aware PC show more detailed info than mobile but both allow identify receiving OK or not

This is best done from desktop browser.
Connection state: <should be connected>
Registered App IDs: <your HA site should appear hear>
Last checkin: <strangely mine work but date is expired by 3 day due to PC sleeping; I close and reopen browser for update>
Next checkin: <mine expired by 1day, close /reopen refrshed>

Do you see any log entry?


FIREFOX
Is in devtools.
Should see message received or error

Send message and you should see receipt by browser or error.

I don’t see anything when call notify service

Do you see any log entry?

There isn’t any log entry in HA

Is the duckdns showing in “registered apps ids” your HA site?

Did you deenroll devices after change to VAPID (Turn OFF push in HA web frontend for each device then TurnON again)?

  • if you do this you will see the HA device disappear from “registered apps” in the devices browser when turn Off then reappear when back ON.
    -i would expect that if site is showing here you should at least see attempts to deliver messages even if not successful.

The instructions for changing over, “start at step 4” etc, definitely work which suggests you have something wrong elsewhere. I swapped mine over yesterday and it all worked immediately after restarting HA.

YES

YES

HA device dissappear when I turn off notifications, an reappears OK when I turn on it again.

When I send a test notification from services in HA I’ve got no error logs (or any log at all)
Neiter in chrome://gcm-internals

To discard this I try to stop HA, modify my VAPID keys to non valid ones, start HA, no error show in HA, but when try to enable push notifications on frontend, I clearly see the error:

Failed to execute ‘subscribe’ on ‘PushManager’: The provided applicationServerKey is not valid.

So that rules out that VAPID is configured incorrectly.

Again, when setting it up it took 48 hours to start working, it did it for two days, and then again the notifications stopped appearing, nothing was modified in the HA configuration

Post issue in git and see if you get reply.
Could be HA issue?

You did verify your server (docker container) time is accurate?

I’m running in virtual enviroment, and already check Time, is ok.

I noticed that the following messages appear in chrome: // gcm-internals:

This tells you something?

Just that push seem to be working for you browser.

Honestly this may be HA code issue but I am not dev so truely I not know.
You have done all troubleshooting step and all seem correct so time to escalate beyond forum.

This or farily similar issue has occured for a few user.
At a minimum the cause need to be found and documented as it is frustrating so best to submit issue to git so maybe someone with better knowledge of component function can assist or provide guidance.

After it was working, did you restart HA?
I assume you try restart after it stop working?

Yes, I restarted HA a few times.
I will open a issue on git.
I comment here the results, thank you very much everyone

So…this may be worth using. It supposedly use Mozilla and not require any Vapid or GCM parameter. I will give a try when not having party and needing html working to open door :grin:

https://community.home-assistant.io/t/local-push-notifications

Did you manage to fix the Vapid notifications?

I have the exact same symptoms described by you: the push notifications do not show up in any Chrome browser, although I can enable the push notification toggle on the user profile. There is no error in the Home Assistant log, there is no entry from Home assistant in the chrome://gcm-internals message list. Simply nothing happens when I try to test by calling the notify.notify service.

One thing that is not clear to me is what email address to add into the config as the value of the vapid_email field? My own main email address? Some FireBase service account email address?

yes…it basically resolved itself eventually I believe (forget). maybe version upgrade helped.

email is account you setup firebase with.
I think my issue was related to migration from gcm to vapid. if never using push on the device maybe your issue is notification not being sent

Thank you! Yes, mine is a new hass.io installation. Any tips on how to find out if Home Assistant is sending out the notifications? The log contains nothing related to this problem.

Could maybe be caused by my reverse proxy… I use an Apache2 reverse proxy set up based on these instructions.

The notifications setup instructions mention how to configure an Nginx proxy for notifications, but I have no idea how to do it in Apache.

I’ve solved the problem.

In my case I had to give the notify service a name, like this:

- name: html5push
    platform: html5
    vapid_pub_key: YOUR_VAPID_PUB_KEY
    vapid_prv_key: YOUR_VAPID_PRV_KEY
    vapid_email: YOUR_EMAIL

Glad to hear that.
I think necessary make an explanation about hardware/software caracteristics where HA is running first.
I was using an Android TV Box (RK3688 Octa Core, 2 GB Ram), running Linux deploy App.
Inside Linux deploy, I installed Ubuntu 18 server (wich runs in chroot mode), then install HA in a python virtual enviroment.
That hardware/software setup sounds freak, but wait a moment, there is 8 cores, 2 GB Ram, 16GB eMMC, really better than a Rpi.
Also remember, this was working REALLY fine for around 2 and half years.
SO, I haven’t any doubt that the migration to VAPID and possibly updates in HA version made notifications fail, not hardware.
BUT, i’ve tried to run HA in another Android TV Box, but this time running Armbian (outside Android), and… VOILA! Push Notifications works fine!
Then looking for the problem I found that there is a regional time difference between native Android running in the TV box, and the ubuntu running trough Linux Deploy app on them.
No matter what you do with the setup, after a few hours this is back to happening.
This issue could be the cause, so there is no a problem with VAPID method, just there is a time difference between HA made a push notification and the time on receiver device.
Google Firebase just drop the message.
Sadly I was forced to change my HA server for a native Linux one.

Regards.-

Time can be issue and sometime docker container not have correct timezone.

I usually mount /etc/timezone as read only.
There may be environment variable but this unclear Soni choose mount for consistency.