lukas-clarke / eight_sleep

Home Assistant Eight Sleep integration that works with Eight Sleep's new API and OAUTH2
MIT License
106 stars 19 forks source link
eight-sleep home-assistant

Eight Sleep Integration for Home Assistant

hacs_badge

Home Assistant Eight Sleep integration that works with Eight Sleep's V2 API and OAUTH2

Installation

HACS

  1. Add this repository to HACS AS A CUSTOM REPOSITORY.
  2. Search for Eight Sleep, and choose install.
  3. Reboot Home Assistant and configure from the "Add Integration" flow.

NOTE: Ensure neither side is in away mode when setting up the Eight Sleep integration.

Authentication

When setting up the integration you need your Eight Sleep credentials:

You can leave the client_id and/or client_secret blank.

[!NOTE] If you really want to set your own client ID and secret, you can capture the login POST request from the app to auth-api.8slp.net.

Usage

The integration will function similarly to the previous Home Assistant core Eight Sleep integration. It will import the Eight Sleep bed sides and account as devices.
Setting the temperature on the bed is between a -100 to 100 range. This range is unit-less in the API.

There are a few services you can use on the <..>_bed_temperature entities:


Example Service Calls

Example service call

Example service call yaml

There are a few possible sensor values for each Eight Sleep side. Some ones with caveats are

Entity Owner Type Reliable Notes
Has Water Bed Boolean Yes
Is Priming Bed Boolean Yes
Last Prime Bed Datetime Yes
Needs Priming Bed Boolean Yes
Room Temperature Bed Temperature Yes
Bed Presence Side Presence Sort Of Uses heart rate sensors to detect presence.
Bed State Side Percent Sort Of This value is pulled directly from the API and relates to the target heating level. While it may not seem to relate to anything, some people are able to use it to correlate a bed presence to.
Bed State Type Side String Yes Options are: "off", "smart:bedtime", "smart:initial", "smart:final"
Bed Temperature Side Temperature Yes* Only accurate when the pod is on.
Target Temperature Side Temperature Yes The target temperature for the bed side in degrees.
Breath Rate Side Measurement Yes
Heart Rate Side Measurement Yes
HRV Side Measurement Yes
Next Alarm Side Datetime Yes The alarm ID is available as an attribute on the sensor.
Presence End Side Datetime Yes
Presence Start Side Datetime Sort Of This is continuously updated during an active sleep session
Sleep Fitness Score Side Measurement Yes
Sleep Quality Score Side Measurement Yes
Routine Score Side Measurement Yes
Sleep Stage Side String No
Time Slept Side Duration Yes
Side Side String Yes The current side that this user side is set to

Sensor values are updated every 5 minutes

When the Base is installed, the following entities are available:

Entity Type Notes
Snore Mitigation Boolean Indicates that the snore mitigation is active, raising the head
Feet Angle Number Can be changed from the UI
Head Angle Number Can be changed from the UI
Base Preset Select The app currently offers three presets for the base: sleep, relaxing, and reading.

These values are updated every minute.

Alarms

There are alarm switches that will be auto-configured for each alarm you have setup. In order to modify/sync the alarms with the eight sleep app you will need to either reload the integration, or reboot Home Assistant.

example_alarms.png

Further information about the alarms are available under attributes: example_alarm_attributes.png

TODO

FAQS

This is also based on work from https://github.com/lukas-clarke/pyEight and I will likely maintain this repo over the aforementioned one.

Buy Me A Coffee