Push Notifications - Notification registration failed

Hello all. I get this popup error ‘Notification registration failed’ in the latest version of Chrome on both Windows and Android when I try to register for Push Notifications. Chrome is set to ask if I want to display notifications. Tried clearing cache and stuff. Home Assistant is running from a static IP, all SSL’d up and accessible from the outside on https://hass.domain.com - that’s all good.

I have this in my configuration.yaml file:

notify:
name: HTML5
platform: html5
gcm_api_key: ‘AIzaSyAD0yjFai4fCRsokcwqIjEuZeQCK9ycBog’ (not the real one)
gcm_sender_id: ‘1007339650905’ (nor this)

I put rubbish in and tried to start Home Assistant to make sure I’m editing the right file.

The guide I found on this website mentioned GCM which seems to have been replaced by Firebase. If I go to Project Settings | Cloud Messaging in Firebase, after creating a project, I can see Server Key and Sender ID. I used these respectively for the gcm_api_key and gcm_sender_id.

No doubt it’s something silly but I cannot for the life of me figure out why it doesn’t work. I enabled debug logging but it doesn’t seem to log anything extra at all.

Hopefully someone with a brain can point me in the right direction. Thanks! e.

Hi,

I’m having the exact same issue, running latest HA 0.29.6, behind NginX. I don’t think this has anything to do with Firebase/GCM but GCM was working for me before I de-registered a device and now I only get the “Notification registration failed” error when trying to enable notifications.

The logs show nothing but when I enable FireBug and monitor the Net console when switching on notifications I get “Error: No Service Worker Registered”?

Was something broken in latest release I wonder? @robbiet480 ?

Edit: Also, now when I click on the padlock icon in browser I do not see a option to configure notifications, I did have this previously so I suspect that something is broken with the HTML notifications service.

Paul

It sounds like you are using the incorrect value for gcm_sender_id. From Firebase I’m using the “Web API Key” from the general tab. This seems to match the Web App code snippet provided by Firebase.

Also make sure you have your certs configured correctly to be trusted.

Hi, thanks for the suggestions.

@norrisp90 yep - that’s pretty much what I’m seeing too with the ‘No worker registered’ messages behind the scenes in the browser.

@Devanl - good call. The API key and Sender ID/Project ID do all match across GCM, Firebase and the configuration.yaml file. Checked and double-checked. SSL cert is working just fine, set up as per the guide here.

Done a complete reinstall using the all-in-one installer this time and still the same problem.

Also tried following the instructions to reinstall pywebpush under the virtualenv.
https://github.com/home-assistant/home-assistant/issues/3028#issuecomment-244215004
Installed with no errors.

Unsure what to try next. Little bit stuck. Might grab another Pi2 and try it again with a fresh install of Raspbian.

Fixed. I did the upgrade to 0.30.0 which took an eternity to install pywebpush… again. Left it alone and all seems to be fine now. I can only assume I had a broken install of that component. Odd how it happened on a fresh install of the HASSbian too.

Bit unclear from guides I found but for html5 notifications, ‘gcm_api_key’ and ‘gcm_sender_id’ relates to ‘server key’ and ‘sender id’ respectively from firebase | project settings | cloud messaging.

1 Like

If you kept getting stuck working it out (like I did) this screen shot should help

1 Like