SleepIQ Smart-Home-Integration, kostenlos und Open Source

Sleep Number beds (US) via the SleepIQ cloud: in bed, firmness, sleep score; optional commands.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
Shows your Sleep Number beds (United States) in Gladys, through the SleepIQ cloud, with the account of the SleepIQ app.
Unofficial API, never tested with a real account nor a real bed. The integration talks to the API of the SleepIQ app, like the asyncsleepiq library and the Home Assistant integration. Sleep Number may change it without notice. Not affiliated with Sleep Number.
What you get
For each bed, one device for the bed and one device per side somebody sleeps on (a side without a sleeper in the app has no device).
On the bed device:
| Feature | Content |
|---|---|
| Someone in bed | Yes when at least one side is occupied |
| Head / foot position | 0 to 100, for a single foundation (shared by both sides) |
| Foundation position | The preset in use (Flat, Read…), for a single foundation |
| Move the foundation to | Choice of presets (command, see below), for a single foundation |
| Stop the foundation | Button (command), for a single foundation |
| Night light | The under-bed light of the newer ("fuzion") beds (command) |
On each side device:
| Feature | Content |
|---|---|
| In bed | Yes / no, read every minute |
| Firmness (Sleep Number) | 5 to 100 |
| Set the firmness | Choice 5 to 100 by 5 (command) |
| Pressure (raw) | The raw pressure value of SleepIQ, without a unit |
| Sleep score of last night | The SleepIQ score (0 to 100) of the main session, read every hour |
| Head / foot position | 0 to 100, for a split foundation |
| Foundation position | The preset in use, for a split foundation |
| Move the foundation to | Choice of presets (command) |
| Stop the foundation | Button (command) |
| Night light | The night light of that side (command) |
| Foot warming | Off, low, medium, high (read only) |
| Heating / cooling | Off, heating or cooling low/medium/high (read only) |
The foundation, light, foot warming and climate features appear only when the bed has them. In bed and the firmness are read every minute (on a "fuzion" bed, the firmness shown is read again every 5 minutes only); the foundation, the lights, the foot warming and the climate every 5 minutes; the sleep score every hour; the beds and their parts every 6 hours.
"In bed" uses the Gladys "motion sensor" category (as Gladys does for the Zigbee presence and occupancy sensors): the dashboard may call it "motion".
Scene triggers
In the scene editor (Gladys 5.1 or later), category Integrations:
- Got into bed and Got out of bed. Filter on the bed and/or the side
(empty: any). The actions can read
{{triggerEvent.data.side}}(leftorright),side_name,bed_name,sleeper_nameandat(the time the change was seen, UTC).
They fire within a minute of the change, never on the first reading after a start (that is the state found, not a change), and never after an outage or a pause of more than 5 minutes (the change happened at an unknown time). One that Gladys cannot take within 5 minutes (Gladys restarting) is dropped, never delivered late. The "In bed" feature can also start a scene, like any device.
Setup
- Install the integration from the Gladys store.
- In its configuration, enter the e-mail and the password of the SleepIQ app. The password is kept by Gladys in its database, never shown again, sent only to the SleepIQ sign-in.
- Check the time zone of the bed (America/Chicago by default): it is used to ask SleepIQ for the score of the right night.
- Save, then add the bed and its sides from the Discovery tab.
The Test the connection button reads the beds once (at most every 30 seconds) and says who is in bed.
Commands (off by default)
Firmness, foundation presets, the stop button and the night light refuse every command while Allow the commands is off. On:
- Set the firmness: 5 to 100, by 5 only (any other value is refused);
- Move the foundation to: one of the presets the bed offers (Flat, Favorite, Read, Watch TV, Zero G, Snore). There is no command for a free head or foot position: only presets. A preset moves the bed with whoever lies on it, also when a scene sends it at night: allow the commands knowingly, and keep such scenes for when you are awake;
- Stop the foundation: stops a moving foundation. It always goes: it never waits for another command, nor for a pause after a 429;
- Night light: on or off.
Firmness and presets are choices, the stop is a button: a "turn everything off" never reaches them. The night light is a Gladys light, so "turn the lights off" in a room does turn it off (when the commands are allowed).
Before each command, the integration reads the state again (the firmness, the preset, the light) and decides on it, never on a value in memory: a useless command is not sent; a firmness change while the bed is already adjusting is refused; a state that cannot be read refuses the command. The stop is sent without a read (it is always safe). A command that cannot leave within 3.5 seconds is refused unsent. Gladys gets an answer after 4.3 seconds at most; the real state shows about 10 seconds later. One command at a time: two commands sent together (two lights turned off by a scene) go one after the other, and one that cannot leave in time is refused unsent. A command never signs in to SleepIQ: while the integration is not signed in, it is refused ("not connected").
The foot warming and the heating/cooling are read only: the integration never heats nor cools.
Errors and limits
- E-mail or password refused: the integration stops and says so; one new try after 6 h, then every 24 h (not to lock the account). Saving new credentials or the test button try again at once.
- Session refused: the integration signs in again once (never at every cycle: the session key is kept and reused); refused again right after, a pause then one try after 1 h, 6 h, then every 24 h.
- Sign-in rejected (HTTP 403 "User Agent is blocked", or another error): the API has probably changed; one new try after 6 h, then every 24 h.
- 429 (too many requests): a pause of 1 minute to 6 hours (15 minutes without a hint), for everything (reads, button, commands), kept across a restart and a reconnection to Gladys. 403 of the main read: one hour.
- Network, 5xx: new try after 2, 5, 10, 15, then 30 minutes, never faster than every minute. A failing secondary read (foundation, score) never hides the presence and is not read again before its own interval.
- Stops and pauses are kept in
/data, for 24 h at most./dataalso keeps the SleepIQ session key, in clear, in a file reserved to the container user (0600), so also readable by the administrator of the machine and in the backups of the volume; never the e-mail nor the password. - The nightstand sockets of the classic foundations (outlets 1 and 2) are not shown: they may power anything.
- Massage, pause (privacy) mode, the favorite firmness and the calibration are not supported.
- The logs never hold the e-mail, the password, the session key, nor the text of the SleepIQ error answers.
Credits
Ported from asyncsleepiq (Keilin Bickar, MIT) and the Home Assistant SleepIQ integration (Apache-2.0). Apache-2.0 license.
Konfigurationseinstellungen
Diese Einstellungen fragt SleepIQ in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Your SleepIQ account | section | Nein | Shows your Sleep Number beds in Gladys through the SleepIQ cloud: for each side, in bed or not (read every minute, with "In bed" and "Out of bed" scene triggers), firmness, pressure and the sleep score of the night; the foundation, the night light, the foot warming and the climate when the bed has them. Enter the e-mail and password of the SleepIQ app, save, then add the beds from the Discovery tab. The firmness, the foundation presets and the night light can be changed from Gladys only if you allow the commands below. Unofficial API, never tested with a real account. Not affiliated with Sleep Number. |
| SleepIQ e-mail | string | Ja | |
| SleepIQ password | secret | Ja | Kept by Gladys in its database, never shown again, sent only to the SleepIQ sign-in. |
| Allow the commands | boolean | Nein | Off by default. On: Gladys may change the firmness (5 to 100), move the foundation to a preset or stop it, and turn the night light on or off. Off: these features refuse every command. |
| Time zone of the bed | string | Nein | Used to ask SleepIQ for the sleep score of the right night. IANA name, e.g. America/Chicago or America/New_York. |
| Language of the feature names | select | Nein | Used for the names of the devices and features added from now on, for the texts shown and for the command errors. |
So installierst du SleepIQ in Gladys
- Öffne in Gladys Integrationen: SleepIQ erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-sleepiq:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration). - Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
- Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-sleepiq.
SleepIQ benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.
Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.
Über externe Integrationen
SleepIQ ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.
- Alle Integrationen durchsuchen, native und aus der Community
- Deine eigene externe Integration bauen und veröffentlichen
- Quellcode auf GitHub — Quelle dieser Dokumentation