Verify domain in hass.io - HTML5 push notifications

I’m trying to add the html5 notify component, but I can’t verify my domain to google. I tried to add the verification html to the www folder in the config folder but it didn’t worked.

I’m looking for the “homeassistant/components/frontend/www_static” folder I’ve read about in other topics, but I can’t find it on the hassIO installation.

Can someone help me, please?
Or can someone explain me how I could add the meta tag to the homassistant site?

3 Likes

I am also trying to do the same, not sure either sorry

Hi!
Any news about this topic? :slight_smile:

I got it working by verifying my url with the /local ending. For that I put the verification html in a “www” folder inside the config.
Now my html5 push notifications are working, but only for chrome (pc and android) but not for firefox… But I don’t think that this is related to the url with the local ending.

1 Like

Oh ok! thank you!
Can you explain your process step by step please? Thanks!! :slight_smile:

I would also be interested in a bit more explanation on this.

Create a folder called ‘www’ in the folder ‘config’. Every file you put in here can be reached by the url yourhassio:8123/local

Like mentioned on https://home-assistant.io/components/notify.html5/ go now to https://console.cloud.google.com/apis/credentials/domainverification and add the domain but with the “/local” ending.
In the next step you will get a html verification file which you now place in the ‘www’ folder.
Because the url will go to the /local it will see the verification file.

6 Likes

Thanks! Works great!

Thank you!!! <3

I’m looking at the HTML 5 Documentation and I can’t find anything about how to meet all of the requirements with Hass.io. Can you help explain this part?

pywebpush must be installed. libffi-dev, libpython-dev, and libssl-dev must be installed prior to pywebpush (i.e. pywebpush probably won’t automatically install).

Sorry, I don’t know anything about that part…
I just did what I explained before and I didn’t installed anything. But it’s working for Chrome.

Are you, by any chance, using duckdns and let’s encrypt? I was able to verify my domain and all that stuff, but I’m getting “Notification Registration Failed” when I flip the switch.

1 Like

I’d like to add that I needed to restart Home Assistant before it knew of the file. Before restarting I’d get a 404 not found.

1 Like

OMG. Why doesn’t the docs say that you need to reboot. Why don’t they say you need to use the /local (maybe that because it’s hassio only). The docs are the biggest problem of the whole home assistant ecosystem IMHO. Sending a PR for the docs in a few minutes.

I’m struggling here, can someone help me out? I’m using Hassio. I was able to follow most of the documentation here, but I’m trying to get the ‘Push Notification’ slider to show up on my sidebar.

  • I completed the ‘Verify Your Domain with Hass.io’ section and verified my domain with Google as mynamehere.duckdns.org/local/, using similar instructions as Marylein

  • I completed the ‘Getting Ready for Chrome’ steps and obtained my server key and sender ID.

  • I have port forwarding, Duckdns and Letsencrypt working for some time, using the Hass.io add-on. I am able to access my HA UI through https://mynamehere.duckdns:8123 (not my real address)

  • I’m not using a proxy

  • I added to the configuration.yaml the notify component and added the server key (gcm_api_key) and sender ID (gcm_sender_id)
    notify:

  • platform: html5
    gcm_api_key: ‘verylongkey’
    gcm_sender_id: ‘shortnumber’
  • I don’t know if I ever accepted the notification permission in my Chrome browser. I can’t find the setting.

  • I rebooted several times using SSH and command hassio host reboot, through HA UI.

  • I don’t know if I have ‘pywebpush’ installed. I’m using Hass.io, and sounds like Hass.io users got this working without manually installing ‘pywebpush’

I access the HA UI on my laptop using the Chrome and Firefox browsers, and using an Amazon Fire HD10 with Google Chrome installed. I don’t see the ‘Push Notifications’ slider in the sidebar. The weird thing is, I remember seeing that slider a week or two ago, but I wasn’t messing with HTML5 notifications at the time. I flipped it to ‘on’ once but couldn’t tell what it did.

Is there anything I should check to troubleshoot? The HA logs don’t show me anything so far. I’ve tried sending a test notification but nothing happened. I recently added some iframes to the sidebar, but disabled those thinking that was the reason why the ‘Push Notification’ slider wasn’t showing up.

I’m not sure in which homeassistant or hassio version this happend, but for me the ‘Push Notification’ switch is moved to Configuration > General > Enable Push Notifications.

2 Likes

Thank you! The switch showed up on Chrome browser via laptop.

Hello Guys, someone tried to use html5 notifications with caddy? I tried but I got some errors into the log that I cannot understand. Maybe I have to configure something in the vhosts but I am not finding any guidance:frowning: