Eight Sleep component

Having the same issue.

1 Like

Eight changed the API url recently. The component has been updated and the version increase is merged into the dev branch. Things will be back to normal with the next release.

2 Likes

I got hacky with it and changed the constants file with the correct URL… Winning!

can you share the edit please?
[Edit: for those looking to edit before the next update]
manifest.json

0.1.1 -> 0.1.2

located in docker:

/usr/src/homeassistant/homeassistant/components/eight_sleep

Sure :slight_smile: Not responsible if something breaks…

use portainer to launch the container’s console as root

cd to /usr/local/lib/python3.7/site-packages/pyeight

edit the constants.py file with vi

change app-api.8slp.net to client-api.8slp.net

profit.

interesting, i just changed the version of pyeight being used in manifest.json.
I imagine the new pyeight version has the api change in it.

Thanks for sharing!

That would work too…

Hi All,

I added this to my custom_components in the meantime to give it a test. It seems there is something funky going on with the left vs right side. If I have my bed site set to “left” in the eight sleep app, the component loads with the following error:

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/setup.py", line 151, in _async_setup_component
    hass, processed_config)
  File "/usr/src/app/homeassistant/components/eight_sleep/__init__.py", line 103, in async_setup
    success = await eight.start()
  File "/usr/local/lib/python3.7/site-packages/pyeight/eight.py", line 102, in start
    await self.assign_users()
  File "/usr/local/lib/python3.7/site-packages/pyeight/eight.py", line 149, in assign_users
    if data['result']['rightUserId'] == self._userid:
KeyError: 'rightUserId'

If I go back to the eight sleep app and change my side to “right” then everything seems to load fine, including the heat service and states for right side of bed. Any idea what may be causing this?

I did find the following, tried it, to no avail: https://github.com/mezz64/pyEight/issues/6

EDIT: By adding a partner to my bed, the left side now works. Definitely strange behaviour.

As you noted from the referenced github issue this has popped up before. It’s a difficult thing to troubleshoot since I’m just reverse engineering the API and making some decisions on the way I think things behave based on my own tests. It seems in some cases the data doesn’t always update the way I expect it to leading to those kind of errors.

I’m considering buying the Eight Sleep Pod and I’m curious based on the service specified if there is an ability to cool as well as heat from hassio?

I’m not sure if anyone with a Pod is currently using the integration. What is currently defined was discovered as a result of my own reverse engineering based on the original eight sleep mattress cover so any additional functions added by the Pod would need to go through the same process in order to be added into the component.

Ahh. Is that likely? That was the hinge pin for me buying that thing. Otherwise I’ll just stick to swimming in my sweat at night lol.

I don’t have any plans to buy one personally so the contributions would have to come from someone else. I have noticed some new fields in the api results since I originally wrote the code, but I can’t see anything related to cooling since my device only supports warming.

I have the pod and have it set up with home assistant.

It looks like this:

Setting the temp to 1-100 still works correctly. If I try to set it to any negative number (like -5 or -80) it sets the target temperature to 10. So its probably a quick and easy fix, just somehow allowing it to do negative numbers correctly.

I guess i can’t post links so the image didn’t work. Here is what it looks like on my end:

So the fix might be as easy as allowing negative numbers to be passed.

Interesting. Would you be willing to open a feature request issue on the pyEight github and do some API queries for me with something like Postman? If you can supply the api results for a Pod I should be able to make the necessary changes.

I can try. It’s not something I’ve done before but I’m sure I can figure it out. I will be away from home Tuesday-Saturday, so I won’t be local to the Eight Pod if that matters. I have setup Postman and installed pyeight. Running me through it would help. Would I open a pull request on Github?

I’d like you to open a github issue (just title it Pod Support) so I can track the progress within the library repository. I’ll give you details on what URL’s and header values to use and you can post the json responses. Once I have an example from a pod I can figure out the differences and make the right adjustments.

Anyone been able to get ‘binary_sensor.eight_left_bed_presence’ or ‘binary_sensor.eight_right_bed_presence’ to work? Mine is always at ‘Off’.

These are working fine as far as I know. What type of mattress do you have? Do the bed state values update correctly?