HTML5 - Could not deserialize key data


I’ve followed the instructions to setup HTML5 notifications

I’m running HASSIO on an raspberry pi 4 and the following versions:

Home Assistant 0.103.0

arch armv7l
dev false
docker true
hassio true
os_name Linux
python_version 3.7.5
timezone America/Los_Angeles
version 0.103.0
virtualenv false

I have duckdns setup as follow and can access my server from outside
base_url: example…
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem’

I’m using the following method to login:

  • platform: html5
    name: Android_Push
    vapid_pub_key: !secret vapid_pub_key
    vapid_prv_key: !secret vapid_prv_key
    vapid_email: !secret email

Here’s the error message when I try to call the service in the developper tools: sending {“message”:“hello world”}
Failed to call service notify/android_push_desktop_html5. Could not deserialize key data.

here’s the log:

Could not deserialize key data.
Traceback (most recent call last):
‘File “/usr/src/homeassistant/homeassistant/components/websocket_api/”, line 133, in handle_call_service
File “/usr/src/homeassistant/homeassistant/”, line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File “/usr/src/homeassistant/homeassistant/”, line 1260, in _execute_service
await handler.func(service_call)
File “/usr/src/homeassistant/homeassistant/components/notify/”, line 120, in async_notify_message
await notify_service.async_send_message(**kwargs)
File “/usr/local/lib/python3.7/concurrent/futures/”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/homeassistant/homeassistant/components/html5/”, line 490, in send_message
self._push_message(payload, **kwargs)
File “/usr/src/homeassistant/homeassistant/components/html5/”, line 524, in _push_message
self._vapid_email, info[ATTR_SUBSCRIPTION], self._vapid_prv
File “/usr/src/homeassistant/homeassistant/components/html5/”, line 573, in create_vapid_headers
vapid = Vapid.from_string(private_key=vapid_private_key)
File “/usr/local/lib/python3.7/site-packages/py_vapid/”, line 143, in from_string
return cls.from_der(pkey)
File “/usr/local/lib/python3.7/site-packages/py_vapid/”, line 100, in from_der
File “/usr/local/lib/python3.7/site-packages/cryptography/hazmat/primitives/serialization/”, line 28, in load_der_private_key
return backend.load_der_private_key(data, password)
File “/usr/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/”, line 1144, in load_der_private_key
File “/usr/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/”, line 1315, in _load_key
File “/usr/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/”, line 1373, in _handle_key_loading_error
raise ValueError(“Could not deserialize key data.”)
ValueError: Could not deserialize key data.
Failed to call service notify/android_push_desktop_html5. Could not deserialize key data.’

Any recommendations on what to do?


Turns out I wasn’t using the correct PW. I had to get the public & private key

how do you fix it?
Thank you