[OBSOLETE] Eight Sleep (Connect) V1.0 [Eight Sleep Mattress and Cover]

Alyc100
Wed, 11 Jan 2017 01:19:47 +0000
Projects & Stories

This is an unofficial Eight Sleep and SmartThings integration. With this smart app and device handler you are able to connect the Eight Sleep Mattress and Cover to SmartThings. https://www.eightsleep.com

Author - @Alyc100
getCSSData and HTMLTile elements - @tonesto7

Donations
This integration is provided completely free of charge and is open source. If however you really feel like it, you can make a donation here

#Latest Versions
Ensure you install the latest versions of both the Smart App and Device Handler

Smart App - Eight Sleep (Connect) v1.0b - Updated 26/01/2017 20:15

(1.0b) Token renew error fix.

Remove BETA label.

Device Handler - Eight Sleep Mattress v1.1 - Updated 13/11/2017 12:30

Add back up method for determining sleep event if presence values from API become unreliable.

#Supported Devices

Eight Sleep Cover (tested)

Eight Sleep Mattress

#Notable Features

Separate devices within SmartThings for left and right side of bed.

On/Off functionality

Control heat level and set timer within SmartThings

Turn on notifications from your Eight Sleep mattress

View historic sleep/presence data within SmartThings app

View mattress presence status

Feed latest Sleep Score event into SmartThings. Turn on the coffee machine if you’ve had a terrible nights sleep.

Full control over your Eight Sleep Mattress including usage in rules and routines (i.e, CoRE)!!

#Screenshots

#Installation Guide
To install the Eight Sleep (Connect) app and Eight Sleep Mattress device handler:

1. Add the Eight Sleep (Connect) app from GitHub as a new ‘My SmartApps’, select create from code option and paste. Save and Publish.

2. Add the Eight Sleep Mattress device type from GitHub as a new ‘My Device Handlers’, select create from code option and paste. Save and Publish.

3. Add the Eight Sleep (Connect) app within the ST app from the Marketplace, then selecting the ‘SmartApps’ tab and locating the Eight Sleep (Connect) app under the ‘My Apps’ section which should be at the bottom of the list.

4. Add your Eight Sleep credentials (email and password) and select ‘Done’ on top right of app.

5. You should be able to select your Eight Sleep devices in the configuration screen.

6. Once you have selected your devices, click Done on the top right.

7. For every Eight Sleep device, you should see two devices automatically appear under ‘Things’ with the labels Eight Sleep [device ID] [Left] and Eight Sleep [device ID] [Right] (may require SmartThings app restart). You most likely will want to relabel these devices to something more useful. This can be done by pressing the settings icon on the top right of the device tile screen.

#Github Links
Github Repository Integration details:
Owner: alyc100, Name: SmartThingsPublic, Branch: master

Smart App

github.com

alyc100/SmartThingsPublic/blob/master/smartapps/alyc100/eight-sleep-connect.src/eight-sleep-connect.groovy

/**
 *  Eight Sleep (Connect)
 *
 *  Copyright 2017 Alex Lee Yuk Cheung
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *	VERSION HISTORY
 *	26.01.2017: v1.0b - Token renew error fix.
 *	26.01.2017: v1.0 - Remove BETA label.
 *
 *	19.01.2017: 1.0 BETA Release 6 - Added notification framework with option screen.
 *	12.01.2017: 1.0 BETA Release 5 - Stop partner credentials being mandatory. Change device creation based on whether partner credentials are present.

This file has been truncated. show original

Device Handler

github.com

alyc100/SmartThingsPublic/blob/master/devicetypes/alyc100/eight-sleep-mattress.src/eight-sleep-mattress.groovy

/**
 *  Eight Sleep Mattress
 *
 *  Copyright 2017 Alex Lee Yuk Cheung
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *	VERSION HISTORY
 *	13.11.2017: 1.1 - Add back up method for determining sleep event if presence values from API become unreliable.
 *	26.01.2017: 1.0 - Remove BETA label.
 *
 *	25.01.2017: 1.0 BETA Release 8c - Stop Infinite Loop / Divide by Errors.
 *	20.01.2017: 1.0 BETA Release 8b - Ensure one sleep score notification per day.

This file has been truncated. show original

#Feedback
Please post your comments, any issues experienced, suggestions and feedback on this topic thread.

163 posts - 31 participants