0.0
No release in over 3 years
Low commit activity in last 3 years
Used to connect Legion to Sleep Number SleepIQ API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0.3.0
>= 1.3.11
>= 1.4.9
>= 1.4.17
>= 1.2.1
 Project Readme

lex-sleepiq

Sleep Number SleepIQ integration for LegionIO. Control and query Sleep Number beds including sleep number adjustment, foundation control, pump status, and sleep data.

Installation

gem install lex-sleepiq

Or add to your Gemfile:

gem 'lex-sleepiq'

Configuration

{
  "extensions": {
    "sleepiq": {
      "enabled": true,
      "username": "your_sleepiq_username",
      "password": "your_sleepiq_password"
    }
  }
}

Credentials are used for initial login. Session tokens are cached automatically (10-minute TTL) via legion-cache and refreshed as needed.

Runners

Runner Methods
Bed sleep_number, set_sleep_number, get_sleep_number_favorite, set_sleep_number_favorite, status, get_pause_mode, set_pause_mode, get
Family family_status - bed occupancy and side data summary
Foundation get_light, set_light, preset, stop_motion, status, system
Pump pump_status, force_idle
Sleeper sleeper, sleep_data, sleep_slice_data

Polling Actor

Legion::Extensions::Sleepiq::Actors::Poll automatically polls Family#family_status on an interval. This provides ongoing bed occupancy and pressure data without manual task triggers.

Standalone Client

Use lex-sleepiq as a standalone library without the full LegionIO framework:

require 'legion/extensions/sleepiq/client'

client = Legion::Extensions::Sleepiq::Client.new(username: 'user@example.com', password: 'secret')

# Session tokens are fetched automatically on first call
client.status
client.sleep_number(side: 'R')
client.family_status
client.pump_status
client.sleeper
client.sleep_data(date: '2026-03-15', interval: 'D1')

Session tokens (awsalb, key, sessid, bedid) are stored as instance variables and reused across calls. Call client.login explicitly to force re-authentication.

Requirements

  • Ruby >= 3.4
  • Sleep Number SleepIQ account (username + password)
  • LegionIO framework (optional — standalone Client works without it)

License

MIT