SleepNumber Integration

@smrtdrmmr Are you still hosting the sleepnumber integration? If yes, can you send me an invite :)…

Hey there! Yes it is. Here is the Invite URL: SmartThings Channel and Drivers

Let me know if you experience any issues, since different beds have different configurations and the integration may need further refinement to be wider-reaching.

I’d like to try this out as well but looks like the maximum number of users has been reached.

Says the maximum number of users has reached :(…

DMing both of you @S_P and @sdaltons

Me too. I have wanted this for two years.

I’ll DM you an invite.

1 Like

I would love an invite, I’ve had my bed since 2017 and complained to both Sleep Number and ST about not having any integration.

I have a split king that is configured to move both sides at the same time using the remote.

This skill works really well for me with smart things integration. thank you. I am able to use Alexa to control sleep number firmness as well as raise the bed. Thanks a ton.

Is there a channel for reporting problems and feature requests? I love that my bed now shows in Smartthings. So far, no issues as Ican fully control it in real time. :smile:

I’d really like to be able to do two things:

  1. Trigger automations based on presence (example: If I get out of bed, turn on a light at 20%, color red). I see it in the data, but cannot select it as a trigger in routines.
  2. Get last night’s sleep score data for showing in my SmartTools dashboard

Sorry that I missed your message @hscox030 ! I’ll send you a DM invite.

You can post in github if you want, or just DM/ask me. I’ll respond to your two requests:

  1. Trigger automations based on presence - Can you say more about what you mean by “I see it in the data”? For something like this to work, the bed/SleepNumber would have to trigger a notification that goes to SmartThings to kick off an automation. I am not aware of any data flows that go in that direction (a webhook). If you can find documentation about that somewhere, let me know and I can look more into it.
  2. Sleep Score - Similarly, if you can find documentation for getting the Sleep Score info from the SleepNumber API, let me know and I can look into it further. I don’t recall seeing that data in any of the APIs that I used as the foundation for this integration, but it could definitely exist and be documented somewhere. You can see the sources that I found in the Readme.

I was going to ask about the presence then found this post. I have an underbed light that will come on when I get out of bed then turn off after so long once I get back into bed. I am on SmartThings on my laptop and when I pulled up my side of the bed I see under Activity History I see:
Presence: not present

I am going to test and see if that changes if I get into bed. I would like to trigger a routine or control a device if I were to get out of bed and say I am in Night mode. Do you think that is possible?

@hscox030 now I understand what you mean. For this integration, I used a presenceSensor Capability to reflect if footwarming is available for the user’s bed and either enable or disable those respective controls in the UX.

I went back into the SDK code and you are correct that there is a isInBed flag that is provided from the SleepNumber API when getting Bed Side Statuses, and looked at the Hubitat post where presence is mentioned. It looks like Hubitat supports setting a refresh interval, and then sends an event to the user’s view.

I was mistaken about webhooks/callbacks: in SmartThings, a callback can update the state from the server, so it CAN be done. I’d have to:

  1. Add a new component (maybe another presenceSensor) to the device profile to represent the “in bed” state. I’m not sure if I can update the existing device profile or if I have to create a new one since I believe it has been published for invites to be available (I’ll have to double check that)
  2. Update the integration to pass that along to SmartThings
  3. Set up a cron job to periodically call the SleepNumber API and get the in-bed state
  4. Add callback support to update SmartThings with the state information. My integration is stateless currently, so it doesn’t keep track of whether a user was in bed and no longer is (or vice versa). SmartThings might not like sending the same status over and over with infrequent state changes (when the user was in bed and now isn’t or the opposite), so that would require some testing to see if it poses a problem.

Also, because item 3 may not be possible on my current server, it looks like you can set up a combo of routines to trigger an interaction that could refresh the state of the device at some interval:

This is probably way more info than you wanted, but it’s also a breadcrumb trail for me to circle back to as I start investigating more. :sweat_smile:

I’ve gone ahead and started with the API changes based on what I’ve discovered so far. Progress is good, so I’ll keep folks posted as updates occur.

This is exactly my use case for my wife’s side of the bed. She stubs a toe at least once a week fumbling around the bed getting up at night.

I did test presence on 17 Dec 24. The Presence variable does not change with in or out of bed.

May I have an invite to the SmartThings integration for Sleep Number beds?

DMing you an invite.

Hi. Is there any update on this? I am very excited about it.

Yes, I’ve been making progress, but I’ve also had some problems with the SmartThings API. I’m going to keep doing more testing and see if I can overcome it, but if not I’ll be opening a new thread to ask for help from the SmartThings folks. It’s definitely not as simple as just getting the data from SleepNumber.

1 Like