Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpliSafe Websocket Issues #33003

Closed
ssilence5 opened this issue Mar 19, 2020 · 10 comments · Fixed by #33013 or #33059
Closed

SimpliSafe Websocket Issues #33003

ssilence5 opened this issue Mar 19, 2020 · 10 comments · Fixed by #33013 or #33059

Comments

@ssilence5
Copy link

The problem

@bachya, After updating to 0.107 my websocket push updates stop working after a while. They appear to start working again on a reboot of my PI or of Home-assistant, and then after some time stop working again. I can still command from Home-assistant for disarming and arming the system. However, if I control the alarm from the keypad, the status doesn't get updated in Home-assistant.

Environment

  • Home Assistant release with the issue: 0.107.0 and 0.107.1
  • Last working Home Assistant release (if known): 0.106.X
  • Operating environment (Hass.io/Docker/Windows/etc.): Docker on PI
  • Integration causing this issue: Simplisafe
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/simplisafe/

Problem-relevant configuration.yaml

---
#
# https://www.home-assistant.io/integrations/simplisafe/
#
simplisafe:
  accounts:
    - username: !secret simplisafe_username
      password: !secret simplisafe_password

Traceback/Error logs

**FIRST ERROR**
Log Details (WARNING)
Logger: aiohttp.websocket
Source: __main__.py:342
First occurred: 11:36:36 AM (1 occurrences)
Last logged: 11:36:36 AM

websocket connection is closing.

**SECOND ERROR**
Logger: homeassistant.components.simplisafe
Source: components/simplisafe/__init__.py:458
Integration: simplisafe (documentation, issues)
First occurred: 12:36:58 PM (1 occurrences)
Last logged: 12:36:58 PM

SimpliSafe cloud error; trying stored refresh token

Additional information

@probot-home-assistant
Copy link

Hey there @bachya, mind taking a look at this issue as its been labeled with a integration (simplisafe) you are listed as a codeowner for? Thanks!

@bachya
Copy link
Contributor

bachya commented Mar 19, 2020

This looks like a case of aiohttp forcefully closing the websocket connection (open issue: aio-libs/aiohttp#1768). I can't address this directly, unfortunately. I'll take a look at some sort of watchdog in python-simplisafe (i.e., if no data comes down the websocket in an X-minute time period, forcefully reconnect).

@ssilence5
Copy link
Author

Are you seeing anything similar in your setup? I was rock solid on 0.106.X, but after updating to 0.107 I am seeing this on a regular basis.

@bachya
Copy link
Contributor

bachya commented Mar 19, 2020

I saw it once after a SimpliSafe cloud 502 forced the websocket to close; after a HASS restart several hour ago, I haven't seen it since.

@ssilence5
Copy link
Author

Just had it happen again about 1 hour after a restart.

@bachya bachya changed the title Websocket Issues SimpliSafe Websocket Issues Mar 19, 2020
@bachya
Copy link
Contributor

bachya commented Mar 19, 2020

Thanks, @ssilence5. I'm seeing the same. It appears that the what-I-thought-was-unnecessary watchdog I removed in #32129 was actually helping. I'll get a fix in shortly.

@ssilence5
Copy link
Author

Here is another error message that I found in the logs:

Log Details (WARNING)
Logger: asyncio
Source: components/websocket_api/http.py:84
First occurred: 3:39:03 PM (14 occurrences)
Last logged: 3:39:03 PM

socket.send() raised exception.

Then it was followed later by this:

Log Details (WARNING)
Logger: aiohttp.websocket
Source: __main__.py:342
First occurred: 4:06:23 PM (1 occurrences)
Last logged: 4:06:23 PM

websocket connection is closing.

@bachya
Copy link
Contributor

bachya commented Mar 20, 2020

Ugh, sorry – my bleary, recently-100%-WFH brain didn't quite fix this in #33013. Doing more research and hope to have a real fix soon.

@bachya bachya reopened this Mar 20, 2020
@ssilence5
Copy link
Author

ssilence5 commented Mar 20, 2020

My fault, didn't see the comment here before I commented over in the simplisafe-python repository. So, we will still have this issue in 0.107.3?

@bachya
Copy link
Contributor

bachya commented Mar 20, 2020

From that PR:

It may be a problem, yes – in my house, I notice that only 2 out of every 4 websocket events came through because it was reconnecting too quickly. You can install my latest PR as a custom component in the meantime (that's what I'm doing).

enter360 pushed a commit to enter360/core that referenced this issue Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants