A comprehensive Home Assistant integration for Eight Sleep smart mattresses and mattress covers, featuring a beautiful custom Lovelace card, device actions, enhanced error handling, and real-time sleep stage tracking.
This integration provides comprehensive control and monitoring for Eight Sleep smart mattresses and mattress covers. It includes real-time temperature control, sleep stage tracking, biometric monitoring, and a beautiful custom Lovelace card for easy bed management.
Key Features:
- ποΈ Real-time temperature control with custom Lovelace card
- π Comprehensive sleep stage and biometric monitoring
- π§ Device actions for automation integration
- π‘οΈ Enhanced error handling with offline support
- π± Responsive design for mobile and desktop
- Real-time Temperature Control: Adjust bed temperature with intuitive sliders
- Visual Bed Presence Indicators: See when someone is on each side of the bed
- Sleep Metrics Display: View heart rate, HRV, breath rate, and sleep quality
- Responsive Design: Works perfectly on mobile and desktop devices
- Theme Support: Automatically adapts to light/dark themes
- Side-by-Side Controls: Independent control for left and right sides
- Temperature Control: Set temperature, increment/decrement, and preset modes
- Side Control: Turn individual sides on/off
- Away Mode: Start/stop away mode with one-touch actions
- Pod Management: Prime pod and configure bed sides
- Modern Integration: Uses Home Assistant's device action framework
- Exponential Backoff: Intelligent retry logic with exponential delays
- Connection Recovery: Automatic token refresh and connection recovery
- Graceful Degradation: Continues working when API is temporarily unavailable
- Detailed Logging: Comprehensive error reporting and debugging information
- Real-time Sleep Stage Tracking: Monitor sleep stages with detailed attributes
- Sleep Stage Breakdown: Detailed breakdown of sleep stage percentages
- Biometric Monitoring: Heart rate, HRV, and respiratory rate tracking
- Environmental Sensors: Room temperature and bed temperature monitoring
- Device Health: Water level, priming status, and device health monitoring
- Add this repository to HACS
- Install the integration
- Add your Eight Sleep credentials in Home Assistant
- Add the custom card to your Lovelace dashboard
- Copy the
custom_components/eight_sleepfolder to your Home Assistantcustom_componentsdirectory - Restart Home Assistant
- Add your Eight Sleep credentials in the integrations page
- Go to Settings β Devices & Services
- Click Add Integration
- Search for Eight Sleep
- Enter your Eight Sleep credentials
- The integration will automatically discover your devices
Add this to your Lovelace dashboard:
type: custom:eight-sleep-bed-card
title: "Eight Sleep Bed"
left_side: "left"
right_side: "right"type: custom:eight-sleep-bed-card
title: "Master Bedroom"
left_side: "left"
right_side: "right"
show_metrics: true
show_presence: true
temperature_range:
min: 16
max: 32
step: 0.5The integration provides device actions that can be used in automations:
- Set Temperature: Set specific temperature for bed sides
- Increment Temperature: Adjust temperature by increment
- Set Preset: Apply Cool/Warm/Neutral presets
- Turn On Side: Activate heating/cooling for specific side
- Turn Off Side: Deactivate heating/cooling for specific side
- Start Away Mode: Enable away mode
- Stop Away Mode: Disable away mode
- Prime Pod: Prime the Eight Sleep pod
- Set Bed Side: Configure bed side settings
- Sleep Stage: Real-time sleep stage tracking with duration and history
- Sleep Stage Breakdown: Detailed breakdown of sleep stage percentages
- Sleep Efficiency: Calculated sleep efficiency percentage
- Heart Rate: Real-time heart rate monitoring
- HRV: Heart rate variability tracking
- Breath Rate: Respiratory rate monitoring
- Sleep Quality: Sleep quality score
- Room Temperature: Current room temperature
- Bed Temperature: Current bed temperature
- Target Temperature: Target heating temperature
- Water Level: Pod water level status
- Priming Status: Pod priming status
- Device Health: Overall device health status
The integration provides several services for advanced control:
eight_sleep.heat_set: Set heating level with durationeight_sleep.heat_increment: Increment heating level
eight_sleep.side_on: Turn on bed sideeight_sleep.side_off: Turn off bed sideeight_sleep.away_mode_start: Start away modeeight_sleep.away_mode_stop: Stop away mode
eight_sleep.alarm_snooze: Snooze alarmeight_sleep.alarm_stop: Stop alarmeight_sleep.alarm_dismiss: Dismiss alarm
eight_sleep.prime_pod: Prime the podeight_sleep.set_bed_side: Configure bed side settings
automation:
- alias: "Cool Bed at Bedtime"
trigger:
platform: time
at: "22:00:00"
action:
- service: climate.set_temperature
target:
entity_id: climate.eight_sleep_left_side
data:
temperature: 18automation:
- alias: "Notify Deep Sleep"
trigger:
platform: state
entity_id: sensor.eight_sleep_sleep_stage_enhanced
to: "Deep Sleep"
action:
- service: notify.mobile_app
data:
message: "Deep sleep detected - optimal rest phase"automation:
- alias: "Start Away Mode When Gone"
trigger:
platform: state
entity_id: person.your_name
to: "not_home"
action:
- service: eight_sleep.away_mode_start
target:
entity_id: sensor.eight_sleep_sensor- Real-time Slider: Adjust temperature from 16Β°C to 32Β°C
- Preset Buttons: Quick access to Cool, Warm, and Neutral settings
- Side-specific Control: Independent temperature control for each side
- Visual Feedback: Active sides are highlighted
- Heart Rate: Real-time heart rate monitoring
- HRV: Heart rate variability tracking
- Breath Rate: Respiratory rate monitoring
- Sleep Quality: Sleep quality score percentage
- Visual Indicators: Green dots show when someone is present
- Side-specific: Separate indicators for left and right sides
- Real-time Updates: Updates automatically when presence changes
- Mobile Optimized: Touch-friendly controls for mobile devices
- Desktop Enhanced: Full feature set for desktop use
- Theme Support: Automatically adapts to light/dark themes
- Authentication Failed: Verify your Eight Sleep credentials
- No Devices Found: Ensure your Eight Sleep device is online
- Connection Errors: Check your internet connection and Eight Sleep service status
- Card Not Loading: Ensure Eight Sleep integration is properly configured
- Temperature Controls Not Working: Check that climate entities are available
- Metrics Not Displaying: Verify sensor entities are available and sleep session is active
- No Sleep Data: Ensure you're actively using the bed for sleep tracking
- Missing Sensors: Check that all sensor entities are properly created
- Stale Data: Verify the integration is updating regularly
- Smart Polling: Updates based on device state and activity
- Connection Pooling: Efficient API connection management
- Caching: Intelligent data caching to reduce API calls
- Background Updates: Non-critical data updates in background
- Exponential Backoff: Intelligent retry logic prevents API overload
- Token Refresh: Automatic token refresh when expired
- Graceful Degradation: Continues working during temporary API issues
- Connection Monitoring: Real-time connection status tracking
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Eight Sleep for providing the API
- Home Assistant community for inspiration and feedback
- Contributors who have helped improve this integration
- GitHub Issues: Report bugs or request features
- Discussions: Join the community discussion
- Documentation: Full documentation
Made with β€οΈ for the Home Assistant community