Eight Sleep Mattress - Port from ST

Thatā€™s great! Thank you. Iā€™m working on commenting out the code that Iā€™m not finding helpful now. For example, he used the battery as a way to report on the sleep score. Using the battery automatically included it in my HSM battery rule (and I can use the app to see the sleep score) so I commented it out. Iā€™m also looking at the contact switch (in bed) part to see if it works and how I can speed up the reporting of it. Iā€™d like to drive some automation based on whether Iā€™m in bed or not.

I can keep you updated on this if you want. Iā€™m not sure what has value to you in the code though, and itā€™ll be a slow process as I continue to relearn how to program. Seems thatā€™s taking longer than I thought.

There is definitely something strange going on. The devices will only log a poll and refresh. So, even when I select the On or Off buttons and the Device page shows the switch turning on/off, I donā€™t see any updates on the Events or Log pages.

I have noticed the lack of logging as well.

In addition, when I make changes through the app, they do not appear in the driver and vice-versa.

Iā€™m going to simply turn on the heater with the driver to see if the bed heats up and report back.

Actually this is the issue, itā€™s within the Bed App

[app:433](http://192.168.7.201/logs#app433)2018-03-21 21:39:29.433:infoStatus: 200

[app:433](http://192.168.7.201/logs#app433)2018-03-21 21:39:25.799:errorNo encoder found for request content type */* on line 538

[app:433](http://192.168.7.201/logs#app433)2018-03-21 21:39:25.793:debugBeginning API POST: /devices/3b0037000151363133343338, [leftHeatingDuration:11700]

[app:433](http://192.168.7.201/logs#app433)2018-03-21 21:39:23.792:errorNo encoder found for request content type */* on line 538

[app:433](http://192.168.7.201/logs#app433)2018-03-21 21:39:23.779:debugBeginning API POST: /devices/3b0037000151363133343338, [leftTargetHeatingLevel:10, leftHeatingDuration:11700]

I'm not seeing those errors. I'm getting this when I select the "off"

but when I select the "on", I get:

So the app is connecting and doing some things. I'm trying to figure out why it is and not doing some of this.

Is that within the specific device or within the log for the app itself?

Here is the device log:

I changed the httpPut to httpPutJson and that got rid of the API POST: null error I was getting when I selected the off button.

Still trying to sort out the contact open/close issue.

I guess my question is this: when you make a change in the Eight app (ios/Android) does the change reflect in hubitat and vice-versa?

I would expect this behavior to ensure connectivity.

The short answer is that it does for me. If I go into my iOS app and change the warming from 6 to 10. I do see that reflected in the device after the next polling cycle (5 minutes).

To expand (and complicate) your question, I think itā€™s about ā€œwhatā€ is reflected by ā€œwhichā€ platform. Unfortunately, the 8SLP API is private. Alex did a really great job at sniffing out what he could get and then building a pretty complicated DTH and App to support it. He put in a lot of stuff to recreate the sleep analysis and other stuff that is done on the 8SLP side. This isnā€™t just a simple pull and put as other DTHs are.

Unfortunately, things like the ā€œcontactā€ arenā€™t so simple. There is no contact switch that was accessed in the API. Alex used a pretty complicated formula of temperature measurement to guess if someone was in bed or not. So, somethings like ā€œdesiredLevelā€ or ā€œonā€ or ā€œoffā€ will be synced between the two platforms. Other things arenā€™t.

If I follow the philosophy of Hubitat (which I think is just automation) then I can setup some rules to heat the bed (repeat every 3 hours since I canā€™t set the timer through the DTH) at night.

I was hoping to drive some automation in the house by being able use the ā€œget out of bedā€, but Iā€™m having a hard time finding why that part of his code isnā€™t working. And Iā€™m just starting to relearn how to code after decades of not doing it, so Iā€™m far from being close to the sharpest tool in the shed.

My friend you are sharper than I.

I know Alex abandoned the app as he is in the UK and eight is not in the UK.

Maybe he would lend support?

Iā€™ll reach out later today. He dropped support as his 8SLP died. Maybe I can get some of his previous code to help strip it down for more simple functionality.

I also have Eight sleep cover and would like to integrate it in HE, but after reading the whole thread I still don't completely understand is it working or not. @JDogg016 or @homeauto2112 can you clarify?

Not working and frankly it did not work that well on ST either. Iā€™ve had better luck creating Virtual switches for the ā€˜Heatā€™ function in HE and then integrating with IFTTT.

THis works out as I do not require instantaneous changes to the bed heater.

I gave up on it. It was working, but there was such a delay in registering when I was in bed that it wasn't worth trying to tweak the rules to make it work.

Understood. Thank you guys. Is it possible that the problems were related to very unstable hub internet connection at that time(March 2018 and before)?.Right now I can say that internet connection for the hub is very stable and I didn't have any outage at least for 6 month already.
Which App an Dth is the latest one I can try if I decide to test it?

I no longer have the device code, it must be here somewhere.

I will caution you that when the internet goes down on the Eight Hub... this will assuredly crash the HE hub as it did for me.

I have just ordered an Eightsleep Pod and was wondering if this port works with the Pod as well which has the temperature controls?

Iā€™m assuming everyone said forget it?

I wrote my own app based on Alex's app with some additional features at [RELEASE] Eight Sleep Pod.