Hi everyone,
I have a few automations set in my home-assistant instance to send push notifications to my phone through the HTML5 notification component.
I originally used the GCM method which was working fine at the start. Since April though this has been deprecated.
Today I have followed the instruction the component page to update and use the VAPID method. I have retrieved new keys from the “web configuration” section on firebase, put the keys in my config (through a secrets.yaml file), deleted the html5 configuration file and re-enabled notifications on both my laptop Firefox browser and my mobile Android / Chrome brower.
When I call the service from the HA service (dev-service), nothing happens. I do not see any error message pop up either on the UI or in the HA log file and no push notification is received.
Do you have any idea ? Is there something I have missed in my upgrading process ?
You can look to see if messages being received by browser.
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
FIREFOX
Is in devtools.
Should see message received or error
If nothing shows then likely not sending So HA or VAPID misconfigured. If decrypt errors maybe try unregister device, clear html5_push_registrations.conf from HA, reboot and reregister device. If received but not showing in browser maybe unregister, clear cache may be enough.
EDIT
In case of mobile I’ve experienced issue due to settings. I specifically believe auto setup on new device held settings and prevent message display. Anyway, if problem on mobile it’s best to confirm on PC to be sure
I have now gone through the process you suggested.
When I toggled the push notification item again from chrome (to enable notifications), I noticed a couple of lines shown in gcm-internals like this : “Registration response received : SUCCESS”
However, when calling the service itself to generate a notification, nothing happens : no error message, no notification and no new message in gcm-internals.
I’m having the exact same problem with 0.95.4 (Docker, PC). Working before with GCM, domain verified, followed VAPID method, can’t send notifications. No errors anywhere. Devices register OK, they appear in html5 config file, gcm-internals show Registration SUCCESS, nothing when notifications are sent.
Did you verify messages using browser tools mentioned previously.
The migration worked but some devices seem to hold the old keys or some other type issue. Browser or possible phone reset will correct. I would verify messages being received before that however
Gcm-internals don’t show any trace of message, fail or success. It does show notification registration traces. It also fails on a new phone (never visited my HA on it before).
More details: I had notifications setup using GCM on an old HA installation (Docker + Traefik reverse proxy with LetsEncrypt certificates). I hadn’t used it for a few months. Now I started from scratch on 0.95 and decided to set up notifications using the VAPID method.
I’ve tried following the instructions from point 4 (Reusing the original Google Cloud Project), went to firebase, edited the already imported project to add the Key pair under Web Configuration.
Pasted key pair under vapid_pub_key and vapid_prv_key.
I have done nothing about my domain as it was verified already (using the DNS method, check with google and says still valid).
One more detail: On Google Compute Platform Dashboard there are 3 charts showing Traffic, Errors, and Latency. Well, there seem to be some errors, but I can’t figure out how to see logs or check what the errors were).
So you can see the registration in gcm-internals but you don’t see messages?
Yes. With the VAPID setup I can see registration events in gcm-internals when I enable notifications in that browser. But I don’t see any log there when notifications are sent.
This is the relevant config for VAPID (Please tell me if you need more info):
notify:
- platform: html5
vapid_pub_key: myPubKeyFromFirebaseProject (No quotes or anything)
vapid_prv_key: myPrvKeyFromFirebaseProject
vapid_email: [email protected]
I’m sending messages by calling the service notify.notify with service data {“message”:“hello”}
Currently none of my devices get notifications, even a new phone I just enabled them in.
But it doesn’t work. When I try to enable notifications in a browser, I get a little notice at the bottom that says “Registration failed. Push service error”.
GCM Internal Registration Logs show an entry that says “Registration response received INVALID_SENDER”.
I would like to share my experience with html5 notification with you.
When I first activated VAPID it worked flawlessly like out of the box. However it stopped working after a few month with my chrome browser and I had no Idea why. GCM-Internal showed registration success and it also seemed to receive all messages sent from HA.
Jim Witherspoon explained how disabling “Enable native notifications.” in chrome://flags/ solved the Problem for him and so it did for me. After disabling the Feature and restarting Chrome my Notifications from HA showed up immediately.
It still seems to be workaround and I am looking to fix the Problem on Windows 10 side. Disabling native notification will not put the messages to the Windows Notification Center. So the problem seems to be related to windows and not chrome.
As soon as I have found a proper solution for this I will leave it here.
edit:
Ok lol. This was much easier than I expected. Went to Windows 10 Settings Notifications and Actions and (re)enabled to show messages from Apps and other sender. I set the previously disabled native notifications flag in Chrome back to default, restarted the browser and voila the Notifications are back again