SleepIQ integration not working

This might be a question for a separate post, but if our API access gets cut off at some point, I’m sure we will all be interested… Has anyone tried to get any information (like bed presence) out of the bed with some hardware hacking of some kind? I’m sure nobody wants to void their warranty and/or break their bed, so maybe it hasn’t been tried…

I’m still getting issues with this integration. Looks like sleepiq is having issues with unauthorized API requests on thier backend per the PR from sleepyq.

@javellin how’s the integration looking now? I was thinking about getting a sleep number bed in the next few months and got excited when I saw the integration. But if it’s a pain to maintain, I might just avoid it lol

I restarted this morning and it appears the integration is picking up my bed and providing accurate information. I’m hoping going forward it’s ok.

1 Like

I was hoping the errors I was getting would disappear with the newer updated Sleep IQ integration with v. 2022.3 as it has not been working for some time. This used to work and was set up in YAML back in 2020 and worked well up until several months ago.
Running HA on a supervised HA Blue appliance: 2022.3.2

My logs are strewn with errors:

Logger: homeassistant.components.sleepiq.coordinator
Source: components/sleepiq/coordinator.py:37
Integration: SleepIQ (documentation, issues)
First occurred: March 7, 2022, 12:21:44 PM (3189 occurrences)
Last logged: 2:19:39 PM

Unexpected error fetching XXemailmaskedXX@SleepIQ data: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/sleepiq/coordinator.py", line 37, in _async_update_data
    await self.client.fetch_bed_statuses()
  File "/usr/local/lib/python3.9/site-packages/asyncsleepiq/asyncsleepiq.py", line 189, in fetch_bed_statuses
    self.beds[bed_status['bedId']].sleepers[i].in_bed = bed_status[side+'Side']['isInBed']
TypeError: 'NoneType' object is not subscriptable

and

Logger: homeassistant.components.sleepiq.coordinator
Source: components/sleepiq/coordinator.py:37
Integration: SleepIQ (documentation, issues)
First occurred: March 8, 2022, 7:50:03 AM (4 occurrences)
Last logged: 9:21:52 AM

Unexpected error fetching XXmaskedemailXX@SleepIQ data: API call error response 401 <bound method ClientResponse.text of <ClientResponse(https://prod-api.sleepiq.sleepnumber.com/rest/bed/familyStatus?_k=GA1Fm1VTaiVwo) [401 Unauthorized]> <CIMultiDictProxy('Date': 'Tue, 08 Mar 2022 13:50:03 GMT', 'Content-Type': 'application/json;charset=ISO-8859-1', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'Set-Cookie': 'AWSALB=HgnRdcCJei/qTz9nzDBl+FzITJxg4F8DoHAlna1A7eoDW0zylEvLunuQmamfgtwPObO3oaMuNRR/kIAP+2NrYqfAOE+m+YI+cRL86uKHcec+UQTB+LS6vXDWmq7d; Expires=Tue, 15 Mar 2022 13:50:03 GMT; Path=/', 'Set-Cookie': 'AWSALBCORS=HgnRdcCJei/qTz9nzDBl+FzITJxg4F8DoHAlna1A7eoDW0zylEvLunuQmamfgtwPObO3oaMuNRR/kIAP+2NrYqfAOE+m+YI+cRL86uKHcec+UQTB+LS6vXDWmq7d; Expires=Tue, 15 Mar 2022 13:50:03 GMT; Path=/; SameSite=None; Secure', 'Server': 'Apache-Coyote/1.1', 'WWW-Authenticate': 'Password realm="bamRealm"')> >
Unexpected error fetching XXmaskedemailXX@SleepIQ data: API call error response 401 <bound method ClientResponse.text of <ClientResponse(https://prod-api.sleepiq.sleepnumber.com/rest/bed/familyStatus?_k=PoIEXKAs7zR7X) [401 Unauthorized]> <CIMultiDictProxy('Date': 'Wed, 09 Mar 2022 04:02:00 GMT', 'Content-Type': 'application/json;charset=ISO-8859-1', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'Set-Cookie': 'AWSALB=8HYJZuIn+CeRd0KxwsZBuKVxKAn/6vJdk4mt7odqglZobWrksxR+/E5M7XcSayi4iey17tDOmA2vUwUwMqotTwl2QA+z5qdVedazx/Uh9L7Vd0iF9We9VYoI8MU1; Expires=Wed, 16 Mar 2022 04:02:00 GMT; Path=/', 'Set-Cookie': 'AWSALBCORS=8HYJZuIn+CeRd0KxwsZBuKVxKAn/6vJdk4mt7odqglZobWrksxR+/E5M7XcSayi4iey17tDOmA2vUwUwMqotTwl2QA+z5qdVedazx/Uh9L7Vd0iF9We9VYoI8MU1; Expires=Wed, 16 Mar 2022 04:02:00 GMT; Path=/; SameSite=None; Secure', 'Server': 'Apache-Coyote/1.1', 'WWW-Authenticate': 'Password realm="bamRealm"')> >
Unexpected error fetching XXmaskedemailXX@SleepIQ data: API call error response 401 <bound method ClientResponse.text of <ClientResponse(https://prod-api.sleepiq.sleepnumber.com/rest/bed/familyStatus?_k=VVw46MQt1Jjoz) [401 Unauthorized]> <CIMultiDictProxy('Date': 'Wed, 09 Mar 2022 04:13:18 GMT', 'Content-Type': 'application/json;charset=ISO-8859-1', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'Set-Cookie': 'AWSALB=AJUPfpT+f5cY9voM/qM5Mahp2xljvBuxeljSrmg0azFl1U+I9eV5liufbLOrg+g0ObAatoONDAgJowJy5srWck8D5zpQDxqqwGlnnUtjPrICAyHQCCAh9YpP82Rt; Expires=Wed, 16 Mar 2022 04:13:18 GMT; Path=/', 'Set-Cookie': 'AWSALBCORS=AJUPfpT+f5cY9voM/qM5Mahp2xljvBuxeljSrmg0azFl1U+I9eV5liufbLOrg+g0ObAatoONDAgJowJy5srWck8D5zpQDxqqwGlnnUtjPrICAyHQCCAh9YpP82Rt; Expires=Wed, 16 Mar 2022 04:13:18 GMT; Path=/; SameSite=None; Secure', 'Server': 'Apache-Coyote/1.1', 'WWW-Authenticate': 'Password realm="bamRealm"')> >
Unexpected error fetching XXmaskedemailXX@SleepIQ data: API call error response 401 <bound method ClientResponse.text of <ClientResponse(https://prod-api.sleepiq.sleepnumber.com/rest/bed/familyStatus?_k=jiDTBYUDhbiE1) [401 Unauthorized]> <CIMultiDictProxy('Date': 'Wed, 09 Mar 2022 15:21:52 GMT', 'Content-Type': 'application/json;charset=ISO-8859-1', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'Set-Cookie': 'AWSALB=tWC7Lz2HT0rTfq/yTJtWDj9XnC2EOsVDxt3V0rc1GMMS5FObeex3cy7EHxy1rGfloZDqLVLZBycqTDgSObg2XQFNxolsvqLvTc1634BTKKKVYcp2g3gK6A3QEbW8; Expires=Wed, 16 Mar 2022 15:21:52 GMT; Path=/', 'Set-Cookie': 'AWSALBCORS=tWC7Lz2HT0rTfq/yTJtWDj9XnC2EOsVDxt3V0rc1GMMS5FObeex3cy7EHxy1rGfloZDqLVLZBycqTDgSObg2XQFNxolsvqLvTc1634BTKKKVYcp2g3gK6A3QEbW8; Expires=Wed, 16 Mar 2022 15:21:52 GMT; Path=/; SameSite=None; Secure', 'Server': 'Apache-Coyote/1.1', 'WWW-Authenticate': 'Password realm="bamRealm"')> >
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/sleepiq/coordinator.py", line 37, in _async_update_data
    await self.client.fetch_bed_statuses()
  File "/usr/local/lib/python3.9/site-packages/asyncsleepiq/asyncsleepiq.py", line 185, in fetch_bed_statuses
    data = await self.get('bed/familyStatus')
  File "/usr/local/lib/python3.9/site-packages/asyncsleepiq/asyncsleepiq.py", line 134, in get
    return await self.__make_request(self._session.get, url, data, params)
  File "/usr/local/lib/python3.9/site-packages/asyncsleepiq/asyncsleepiq.py", line 153, in __make_request
    return await self.__make_request(make_request, url, json, params, False)
  File "/usr/local/lib/python3.9/site-packages/asyncsleepiq/asyncsleepiq.py", line 154, in __make_request
    raise SleepIQAPIException(f"API call error response {resp.status}\n{resp.text}")
asyncsleepiq.asyncsleepiq.SleepIQAPIException: API call error response 401
<bound method ClientResponse.text of <ClientResponse(https://prod-api.sleepiq.sleepnumber.com/rest/bed/familyStatus?_k=GA1Fm1VTaiVwo) [401 Unauthorized]>
<CIMultiDictProxy('Date': 'Tue, 08 Mar 2022 13:50:03 GMT', 'Content-Type': 'application/json;charset=ISO-8859-1', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'Set-Cookie': 'AWSALB=HgnRdcCJei/qTz9nzDBl+FzITJxg4F8DoHAlna1A7eoDW0zylEvLunuQmamfgtwPObO3oaMuNRR/kIAP+2NrYqfAOE+m+YI+cRL86uKHcec+UQTB+LS6vXDWmq7d; Expires=Tue, 15 Mar 2022 13:50:03 GMT; Path=/', 'Set-Cookie': 'AWSALBCORS=HgnRdcCJei/qTz9nzDBl+FzITJxg4F8DoHAlna1A7eoDW0zylEvLunuQmamfgtwPObO3oaMuNRR/kIAP+2NrYqfAOE+m+YI+cRL86uKHcec+UQTB+LS6vXDWmq7d; Expires=Tue, 15 Mar 2022 13:50:03 GMT; Path=/; SameSite=None; Secure', 'Server': 'Apache-Coyote/1.1', 'WWW-Authenticate': 'Password realm="bamRealm"')>
>

Am I the only one ready to just give up on this integration for whatever reason or are others having similar issues, as reported in these forums on the Sleep Number people being upset about the number of API calls to their servers?
If you have a solution, I would be grateful :pray:

No, you are not the only one, it doesn’t work for me either. I reverted back to 2022.2.9 as I have automations that depended on this integration. This “NoneType” issue was reported and allegedly fixed on github. It doesn’t look like the fixes in the pull request were submitted in time for 2022.3.3 but I’d imagine that it should get pushed out whenever 2022.3.4 rolls out.

1 Like

Unfortunately, there really isn’t a good alternative that works as well that I’ve found that doesn’t require a fair amount of hacking.

The integration has been very stable for me for about 9-10 months since the last round of issues. Really, until SleepIQ releases an actual API, I’m afraid this is going to be the norm.

This is also why I only update my HA instance about once a quarter.

1 Like

Very wise. But ever since I gave up running the unsupported Synology package through Docker that could not be updated and they discovered a security issue, I suffer from FOMO :laughing:
Only took 4 months to get my Blue and I keep it relatively current.
Thank you kindly.