Smappee Unauthorized

Since a few days, my smappee integration on home assistant has stopped working.
I am getting an unauthorized error.

When I do a post request (with postman), I get an access token, so my credentials are ok.

POST /dev/v3/oauth2/token HTTP/1.1
Host: app1pub.smappee.net
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
grant_type=password&
client_id=[YOUR_APP_ID]&
client_secret=[YOUR_CLIENT_SECRET]&
username=[USER_NAME]&
password=[USER_PASSWORD]

This is my error log, does anyone else have this problem?
Thank you in advance

Logger: homeassistant.config_entries
Source: helpers/config_entry_oauth2_flow.py:201
First occurred: 17 april 2022 09:29:36 (1 occurrences)
Last logged: 17 april 2022 09:29:36

Error setting up entry smappeeCloud for smappee
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pysmappee/api.py", line 21, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pysmappee/api.py", line 67, in get_service_locations
    r.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://app1pub.smappee.net/dev/v3/servicelocation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/smappee/__init__.py", line 104, in async_setup_entry
    await hass.async_add_executor_job(smappee.load_service_locations)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/pysmappee/smappee.py", line 22, in load_service_locations
    locations = self.smappee_api.get_service_locations()
  File "/usr/local/lib/python3.9/site-packages/pysmappee/api.py", line 24, in wrapper
    self._oauth.token = self.refresh_tokens()
  File "/usr/src/homeassistant/homeassistant/components/smappee/api.py", line 43, in refresh_tokens
    run_coroutine_threadsafe(
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 445, in result
    return self.__get_result()
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 460, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 88, in async_refresh_token
    new_token = await self._async_refresh_token(token)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 175, in _async_refresh_token
    new_token = await self._token_request(
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 201, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://app1pub.smappee.net/dev/v3/oauth2/token')

I also have the same problem which started right after Smappee had cloud issues on April 14th.
My client_id and secret are correct and working in a different script outside Home Assistant.
On the status page https://status.smappee.net/, it advise that when issues with third party integrations, you may need to relogin or reconnect with your Smappee account.

I’ve removed the smappee integration, and attempted to re-install it to the cloud. During installation I get redirected to app1pub.smappee.net for autorization (which I can do), but then I’m HA simply says ‘Error’ without any details.

Anybody else suggestions how to fix ?

I contacted smappee, they told me to remove the smappee integration.
After reinstalling the integration, it worked immediately.
No need to reconfigure, or re-enter your password…

1 Like