SimpliSafe State Not Updating

Sorry about that - missed that piece. All set now - definitely running the custom component and it seems to be holding state much better now.

I just tested a few back and forth between off and armed_home and it changes within a few seconds and holds the state!

Thanks again for all the help! If it’s not a ton of work and you get a chance to try the event based fall back, let me know and I’ll load that (now that I actually know what to do :slight_smile: )

@bachya - update from a little more time with the newest version…

The polling overriding the the state from the webhook is definitely solved (as would be expected for disabling the REST API polling on the V2 systems).

The HA state is being updated maybe 50% of the time from the webhooks. For example, this morning after disabling the alarm at the keypad, HA continued to show armed_home and the automation for morning routines was never triggered.

Similar thing leaving this morning - the armed_away at the keypad did not update the app.

I am see this chunk of logs repeatedly:

2021-11-24 08:53:59 ERROR (MainThread) [custom_components.simplisafe] Error fetching 447616 data: SimpliSafe error while updating: 401, message='Unauthorized', url=URL('')
2021-11-24 08:54:38 ERROR (MainThread) [simplipy] Giving up _async_request(...) after 4 tries (aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL(''))
2021-11-24 08:55:17 ERROR (MainThread) [simplipy] Giving up _async_request(...) after 4 tries (aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL(''))
2021-11-24 08:55:56 ERROR (MainThread) [simplipy] Giving up _async_request(...) after 4 tries (aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL(''))
2021-11-24 08:56:35 ERROR (MainThread) [simplipy] Giving up _async_request(...) after 4 tries (aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL(''))
2021-11-24 08:57:13 ERROR (MainThread) [simplipy] Giving up _async_request(...) after 4 tries (aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL(''))
2021-11-24 08:57:51 ERROR (MainThread) [simplipy] Giving up _async_request(...) after 4 tries (aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL(''))
2021-11-24 08:58:29 ERROR (MainThread) [simplipy] Giving up _async_request(...) after 4 tries (aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL(''))

I’m staring to wonder if the V2 systems have just run their course… In your opinion, is the upgrade to V3 worth it?

Interesting… Do those log entries correspond to the timeframe in which you checked in the morning?

Not to cop out, but I think it’s worth it. I’m very glad we upgraded. I have the expectation that going forward, all the updates, bug fixes, etc. are going to go to the V3 systems. I know it’s not trivial, cost-wise, but I really would recommend it.

@bachya - not exactly at the moment when I change the state on the keypad. They seem to be happening about once per hour.

I don’t want to ask you to go on a wild goose chase on a legacy system that might not be worth the updates.

I might mess around with the events thing a bit to see if I can hack some solution there before jumping ship on V2. Could you point me to an example in your SS library of how SS uses the new code to authenticate to its API? Any code I’ve written to SimpliSafe used their old authentication sequence.

Interesting. I wonder if V2 systems handle authentication/refresh tokens differently than V3 systems… I can’t imagine so, but you never know, I guess.

You bet. Check out this section of simplisafe-python’s docs: Usage — simplisafe-python 2024.01.0 documentation

The repo also has an examples folder: simplisafe-python/examples at dev · bachya/simplisafe-python · GitHub

Glad to see you guys are working to solve this issue. This is the same problem I posted about here:

It would appear this is a V2 related issue since all of us (@DaveCo1701) who have weighed in with this problem have that system.

I have seriously considered moving to the V3 system, but am holding back because I’m exploiting a weakness in the V2 system. I use a Pi and rtl_433 to eavesdrop on the V2 communications from the sensors to the base station. Doing this allows me to pull the SimpliSafe sensors into Home Assistant. Has someone figured out a way to do this with the V3 sensors? My understanding is the V3 system encrypts wireless transmissions. Looking for a solution that doesn’t have me installing two door sensors on every door.

I ultimately decided to upgrade to Gen3. I figured the problems with Gen2 will keep popping up and at some point it probably won’t make sense for HA to support Gen2. @DaveCo1701 - @bachya can keep me honest but I think the HA integration does pick up individual sensors for Gen3 systems.

@ChitFam - my hack until I get the Gen3 system is to use @bachya 's simplipy library. I have a script that runs every 30 seconds to check the events list. The logic looks like:

systems = await simplisafe.async_get_systems()
for system in systems.values():
    # Print system events:
    events = await system.async_get_events()
    for event in events:
        if event["messageSubject"] == "SimpliSafe System Armed (home mode)":
            msg = "armed_home"
        if event["messageSubject"] == "SimpliSafe System Armed (away mode)":
            msg = "armed_away"
        if event["messageSubject"] == "SimpliSafe System Disarmed":
            msg = "disarmed"

The msg is then sent to a Mosquito MQTT broker. HA subscribes to the topic to update a sensor. So HA is getting the most recent alarm state from the events every 30 seconds. I’m ignoring the state reported by HA for the alarm because it’s usually un reliable. The REST state polling doesn’t work because it’s cached data for Gen2 and the websockets update on events are unreliable for my system.

I considered using the recent event available in HA on the alarm sensor (i.e., update a new sensor based off that event without needing the custom script/MQTT). The only problem there is if there were other events (e.g., power outage) that I could see causing issues. The MQTT method is a little more robust and ensures proper state is always set.

I started looking at how I could tweak the SimpliSafe component to do this natively, but that was a bit over my head for a quick fix :slight_smile:

1 Like

I haven’t heard of a similar exploit for V3 systems. I saw a pretty good V3 tear down and SS has done a much better job encrypting traffic.

Correct, with one caveat: The values are updated via a 20-second polling interval. In our house, unfortunately, that doesn’t really help me with anything useful… @DaveCo1701 is exploiting a workaround that allows them real-time access to sensor values via sniffing the RF signals.

Ahhh. Ok, makes sense.

Yeah, 20 second delay wouldn’t be good for triggering actions (e.g., when door opened, turned on light). But I guess it could be good for monitoring/alerting - (e.g., if weather is raining and window is open, send me an alert)

1 Like

hi, im a beginner using HA… is there any way to reduce this 20-second refresh rate… im actually trying to automate to turn on front light when Front Door Entry Sensor is open… but it take too much time to trigger. thanks!!!

1 Like

@Jisg.apps - there is no way in the UI. You’d have to edit the polling code to change the frequency. Even at that, I don’t think you’ll ever get the outcome you want. Even at a frequency of 3 seconds polling, it takes time to make the HTTP requests so you’re still looking at several seconds for the action to run in HA. Something like a door opening trigger for turning on a light needs to be close to instant.

Could you put a Z-Wave motion sensor near the front door to turn on a light based on motion? That would trigger much faster. Or, look for another Z-wave door sensor that could talk directly to HA to trigger a light.

1 Like

I am continuing losing authentication on restarts of HA. The only fix I see is deleting the integration then reinstalling.

Are you using SimpliSafe V2 or V3?

V3. No changes in my system.

Hm. Haven’t seen that on my system once I got on V3. Might be worth opening a bug?

There is an open GitHub issue.

I am losing this integration every couple of days. The only fix I have found is to delete and re-install.

@Jisg.apps I am trying to do the same thing. Did you find a way to make this work?