Yup, that was the problem. Thanks for the quick reply.
BUG REPORT:
I am seeing constant (every 5 minutes) INFINITE LOOP / DIVIDE BY ERRORS in the IDE at line 610 for the Mattress Device.
Apparently days.size() is returning 0, and the implied loop is 0ā¦-1 - I temporarily added a if (days.size() > 0) around everything starting at line 607, but youāll probably want to figure out why youāre getting an empty Map/List containerā¦
I have added the defensive code check to Release 8c. Iāll keep an eye on this but canāt recreate days.size() returning 0. This would return 0 if you have been on holiday for the past 7 days and havenāt been in the bed so good to add the code in.
Ah, ok, that explains it. I have 2 mattress covers, one at home and one at my other property - it is in fact that one that is generating the divide by zero errors, since I have been there in a few weeksā¦
Thanks!
Announcing the end of the BETA. Many thanks all for your feedback and being pioneers with this device. No major changes from the last BETA release just a relabelling exercise as it seems frequent code changes are not required anymore.
As always, please do report any further bugs, suggestions and feedback.
Thanks for all your work on this. It works great so far for me. Works well inputting two Eightsleep mattress covers. I was able to configure both of them and have them both show up in the app and distinguish between them even though Eightsleep requires them to be configured with separate emails and cannot view both of them in the same app so your smartapp enables me to be able to do that. Great work!
Youāre my hero! Iāve been waiting for this integration. Will try it tonight.
Please update to Eight Sleep (Connect) v1.0b that fixes a crippling bug around token renew.
I got the feeling that the contact sensor should update realtime, mine doesnāt seem to be. Been lying in my bed about ten minutes and the device type still shows āOut of Bedā. Any idea?
Thanks again for this Amazing integration!
It doesnāt update in realtime. There are some calculations that occur before the app determines youāre actually in bed. I find within 10 - 15 minutes it updates to āin bedā.
I believe that this would require effort on Eight app side.
My dog causes my sleep numbers to be wrong especially when Iām traveling, it shows my best night sleep.
I was thinking that if i was able to tie the Eight presence routine to only show when my Presence device iPhone was also present.
Thoughts?
Hello,
is it possible to expose the temp sensor and presence as devices ?
thanks
There is no temperature provided from 8sleep in the api. Itās a value of 1-100 as a heat level indicator. The temeprature you see in the app is post processed information. I suppose an option would be to set this value as a temperature capability so other apps can use it but note itās neither C or F. Is that what you were asking for?
As for presence, the āin bedā indicator is a contact sensor that is available for use in other smart apps to build rules.
Hope that helps.
Thanks for the info Alex.
I assumed there is a room temperature sensor built into the hub since it seems to accurately show the room temperatures in the eight app (in Farenheit). So I was wondering if that can be used as a room temp sensor device in ST with your app.
Use case example: If room temperature detected by eight hub is less than 71degree, then increase heating level.
Thanks for the tip on the contact sensor.
It does look like there is a room temperature sensor somewhere on the device. As of yet this reading is not exposed in the real time API that Iām using. Iām sure it will be as they evolve the mobile app. Once it is, Iāll add it in. There is no official documentation for the API and Iām relying on what functionality the current Eight Sleep mobile app is using.
I received a notification that my Eight Sleep Mattress has only 13% battery remaining.
I think my sleep score was 13% so it must be mapping sleep score to battery.
Is that correct?
Dude! Get some sleep!
Yes. This is correct.
It was added a couple weeks ago.
Here is the quote from the dev: