[RELEASE] Eight Sleep (Community)

WHOA. Wish I had seen that pricing error. I love using mine, warms the bed in the winter and cools it in the summer. I looked at the HaaS integration and it looks like that hasn't really been updated either. An I'm sure the HE driver written by @amosyuen has the same clause about the API's being undocumented and not supported by Eight Sleep. Unfortunately I don't know where to look to see if there is anything new. I'd love to ability to set the "away" mode that Eight recently put into their app. Rule ideas I've had - If I'm away for >24 hours, set my side of the pad to away. Or if HE hub is in Vacation mode, set both pad sides away.

My recommendations would be to start by adding debug output line in the current code for the server responses. Then look in the response to see if there's a field that seems to correspond with home/away mode. You can change the mode in the eight sleep app, and then seeing how that changes the response.

Setting the value may be trickier, might just be a simple post to the same HTTP resource with the changed value or might be a brand new HTTP endpoint. You can do some trial and error to see if POST works. If not, then the most reliable way would be to capture the HTTP traffic of the app to see what the app does and then replicate that logic.

Mine are not the heating/cooling but rather a simpler heating-only mattress pad.

1 Like

Is there any way to fix the Sleep Stage? Mine only ever say Out or Awake.

Seeing

Login Error There was a problem connecting to Eight Sleep: Status: 429 Data:[status:429, code:Too Many Requests]

When trying to login.

429 means youre getting rate limited by the server. try disabling the app for a bit and come back to it.

Thanks, managed to login but now seeing this in the logs when trying to get the active devices

app:8902023-10-30 16:02:16.543errorgroovyx.net.http.HttpResponseException: status code: 401, reason phrase: Unauthorized on line 297 (method updated)

app:8902023-10-30 16:02:16.528warnmakeHttpCall: Access token is not valid

app:8902023-10-30 16:02:16.527errormakeHttpCall: HttpResponseException status=401, body=[status:401, code:Unauthorized, error:session token not supported]

app:8902023-10-30 16:02:10.466errorgroovyx.net.http.HttpResponseException: status code: 401, reason phrase: Unauthorized on line 297 (method selectDevicePage)

app:8902023-10-30 16:02:10.431warnmakeHttpCall: Access token is not valid

app:8902023-10-30 16:02:10.429errormakeHttpCall: HttpResponseException status=401, body=[status:401, code:Unauthorized, error:session token not supported]

i realized iā€™m getting the same 401 errors as you and Iā€™m on version 4.0.2 (2021-10-14). I think eight has made changes to their API that the app has not been updated with.

Ugh. I am seeing this too. I heard something about them coming out with new API's. Sadly though, @amosyuen left Hubitat and is no longer maintaining this app. I haven't looked to see if the HaaS integration has been updated though.

EDIT: Welp... Acorrding to a Reddit post, and the HaaS forums, Eight Sleep has removed all API integrations.

Looks like HA have updated their driver

Looking at the code, it still relies on a secret-ish client_id and fact that APIs not requiring a client_secret for now. I was going to attempt fixing existing app on Hubitat but not sure how long it would work for at this point.

I can easily see them start requiring a client secret once they ensure apps and hardware are updated. In fact based on a quick test, looks like they are already doing it. I am getting a 400 when I make a post to the auth-api endpoint calling it the same way that is being called from the HomeAssistant code above.

1 Like

The latest version of the code no longer requires the id or secret. I integrated it into my HaaS, but there isn't a simple On/Off. Or at least I can't make out where the on/off settings are.