SimpliSafe 'refresh_token' error

After about a month of running SimpliSafe via HA, I came across the below cryptic error log:

Logger: homeassistant.config_entries
Source: components/simplisafe/__init__.py:357
First occurred: 2:55:23 PM (2 occurrences)
Last logged: 3:57:21 PM

Error setting up entry SimpliSafe for simplisafe
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/simplisafe/__init__.py", line 357, in async_setup_entry
    api = await API.async_from_refresh_token(
  File "/usr/local/lib/python3.10/site-packages/simplipy/api.py", line 154, in async_from_refresh_token
    await api.async_refresh_access_token()
  File "/usr/local/lib/python3.10/site-packages/simplipy/api.py", line 406, in async_refresh_access_token
    self._save_token_data_from_response(token_data)
  File "/usr/local/lib/python3.10/site-packages/simplipy/api.py", line 258, in _save_token_data_from_response
    self.refresh_token = token_data["refresh_token"]
KeyError: 'refresh_token'

It sounds like its a token refresh issue, but I am not sure what the steps are for acquiring the new token. Also, is this something that would require routine refreshes?

@bachya looks like you are the code owner. Have you come across this? And, do you have a solution to fixing the issue?

Roger that, it’s being tracked here: Simplisafe fails to setup · Issue #90870 · home-assistant/core · GitHub (its an upstream issue, so if you’re interested, more data can be found here: Auth API is no longer providing a refresh token · Issue #487 · bachya/simplisafe-python · GitHub)

3 Likes

ignore, read recent comments in github, will try process

A big thanks to @bachya as always getting things fixed in a timely manner! I installed the 2023.4.1 update and it looks good again. Yesterday I did remove the integration before reading up on the forum. So today, I re-added the integration and was able to get it all working on my HA again.

2 Likes

Great to hear!

likewise!!!

I’m having the opposite problem. Every time I try to get SimpliSafe integrated into Home Assistant, I keep getting this error. Not sure what to do with this since I haven’t previously had the integration running like Jayyovs.

Logger: homeassistant.config_entries
Source: components/simplisafe/init.py:357
First occurred: 8:35:41 PM (3 occurrences)
Last logged: 8:42:13 PM

Error setting up entry 6161121 for simplisafe
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 372, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/simplisafe/__init__.py", line 357, in async_setup_entry
    api = await API.async_from_refresh_token(
  File "/usr/local/lib/python3.10/site-packages/simplipy/api.py", line 154, in async_from_refresh_token
    await api.async_refresh_access_token()
  File "/usr/local/lib/python3.10/site-packages/simplipy/api.py", line 406, in async_refresh_access_token
    self._save_token_data_from_response(token_data)
  File "/usr/local/lib/python3.10/site-packages/simplipy/api.py", line 258, in _save_token_data_from_response
    self.refresh_token = token_data["refresh_token"]
KeyError: 'refresh_token'

Any help would be appreciated!
Thanks!