[OBSOLETE] Sleep Number SleepIQ SmartThings Integration

This is great! I’ve been looking for something like this for Home Assistant for a while (there is only a presence integration that I’m aware of at the moment), but since I still use Smartthings to integrate certain devices into HA so this works just as well for me. I have a split-top king and the app works perfectly for me on both sides. I had no issue creating two users and can control each side of the bed independently from the other. Thanks for creating this awesome app.

The only feature that might be nice, if it were possible, would be to have a dimmer for the bed adjustment like there is for the sleep number. As I understand it, the adjustable base can only be set to flat or the favorite position using a switch.

After using the app for a bit, I have discovered a minor bug, which is somewhat similar to what /u/Jckickflip described, except mine is more of a cosmetic bug. Both sides adjust independently of one another, but the state of both beds can never be “off” at the same time. I can still place both bed positions in a flat state with no problem, but one of them will immediately show as “on” in the user interface. Here’s an example: If both sides of the bed are in their raised “on” position, I can turn one side off and the user interface then shows one side “on” and the other side “off”. As soon as I put the side that’s “on” in the flat “off” position, both sides remain flat, but the UI immediately shows the other side in the “on” position. It’s really strange, but no matter what I do, I cannot get both sides of the bed to show as being off at the same time in the UI. This is not an issue operating them manually from my phone, but it does create issues with automations. I think I can work around this by just changing the state in my automation before the scheduled automation is to occur, but if there were a fix for this it would be nice.

Do you have a discord or some other type of instant messenger?

I’d love to debug this but it’s impossible since it works perfectly with my bed!

My Discord tag is Classic_Tim#9011

I just ordered a sleep number smart bed with the adjustable base so I can’t actually use this app just but love the idea and as soon as it gets here will play with it. Can this app adjust the base as well? It looks like it can cycle between the presets and favorite. Might be something with needing a second “dimmer” if I understand correctly. If so, could it just be a separate device (bed and base separately that is)? We could pair this with webcore to have them work together. Happy to help test anything out for you once my bed arrives. It’ll be a king flex top with a flex 2 base (head and foot).

Hi all - thanks for taking this on @Classic_Tim! I’d love to get this working, but I’m having the same problems as @Cyberfreak. When I set this up, it works the first time, then throws an error. From the logs, it looks like because I don’t have an adjustable foundation, it throws an error and can’t recover.

Below are the logs with the oldest at the bottom. I set bed to 99 firmness and it logs in ok, but it checks for foundation status and then errors out. Maybe there can be a setup option check box that only enables the foundation check if a user has an adjustable foundation?

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:47 PM: error[SleepNumberManager] Put Request failed: /rest/bed/-xxxxxxxxxxxxxxxxx/sleepNumber?_k=null : {‘bed’: -xxxxxxxxxxxxxxxxx, ‘side’: R, ‘sleepNumber’: 99} : Error (groovyx.net.http.HttpResponseException: Unauthorized)

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:47 PM: error[SleepNumberManager] Login failed: Error (java.lang.NullPointerException: Cannot get property ‘fsCurrentPositionPresetRight’ on null object)

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:47 PM: error[SleepNumberManager] Error updating foundation status - Error (groovyx.net.http.HttpResponseException: Not Found)

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:46 PM: trace[SleepNumberManager] Updating Foundation Status for: Right

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:46 PM: debuggetChildDevices(false), children=1

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:46 PM: trace[SleepNumberManager] Updating Family Status

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:46 PM: tracegetBedData()

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:46 PM: trace[SleepNumberManager] Login was successful

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:46 PM: trace[SleepNumberManager] Logging in…

f358e7c9-1def-4843-b0f3-xxxxxxxxxxxx 8:20:46 PM: trace[SleepNumberManager] Setting sleep number side R to 99…

Hi Tim, new to this; however, I installed the app and handler. I see the on / off and the dimmer, but the bed does not inflate or deflate when I change the dimmer; what m I missing. Thanks

Hi Tim! Thanks for your work on this. Is there a way that I can pull the community not using your app, just the native sleep number app and see if people had issues with recording sleep data on Sunday night? Not sure if there was an issue with daylight savings but my bed was connected, sleep IQ on and I had connectivity but no recorded sleep session. Thanks for any help you can provide!

@Classic_Tim I got this up and working. Was wondering if there would be any way to request a feature. Is it possible to control the privacy mode (on means it’s not tracking you in bed for Sleep IQ, off it is). I often sit in bed to watch TV or something and it would be nice to use webcore to turn off in the morning at a certain time and back on later in the evening automatically. Nice work so far tho! Much appreciated!

Just wow!! I’ve been waiting on this forever! Gave up hope for a year or two and then just searched today and I’m so thrilled!!

Thanks, everyone for the support and help to improve this app!
For those of you who were having issues because you do not have an adjustable base:
@Scott_Purkey, @Cyberfreak, @scoot05redss, @YellekNagrom, @jconnolly1977, and @GUSBETA
and anyone else for that matter that doesn’t have an adjustable base I have split the app and device manager in two, one if you DO have an adjustable base and one if you DON’T have an adjustable base. I’ll copy the links from above here as well

If you HAVE an adjustable base use these:
Adjustable Base Smart App
Adjustable Base Device Handler
If you DON’T have an adjustable base use these:
No Adjustable Base Smart App
No Adjustable Base Device Handler

The only difference between the two is the one without the adjustable base removes the functionality of turning the bed “on” or “off” to raise/lower the bed. It also will display the sleep number on the “My Home” tab rather than whether the bed is raised or flat.

And of course, you will no longer get any errors with either as long as you use the one right for your configuration!

2 Likes

Hi Tim, thank you so much for looking into this. I reinstalled the app and device handler, however, i didn’t get it to work. According to IDE, the device type is set as “Sleep Number Bed” with status active. When I go to the classic app / new up, the device appear as presence sensor with status off. I also checked my sleep number app “Sleep IQ” and I don’t see Smartthings under connected app. wat would suggest me to do… Thanks

Thank you for this! I am no longer seeing any errors in the logs, but I cannot get the pressure to adjust. Everything communicates properly when my side is added and the app correctly returns the presence and current pressure level, but it doesn’t do anything after the initial handshake with the sleepnumber servers.

You won’t see it listed in the sleep number app as it is not an officially supported integration. You should see the bed as dimmer switch, and the slider will adjust the sleep number. Please note that it will not do anything unless it matches an actual sleep number increment (100, 95, 90, 85, 80, 75, 70, …etc.)

Thank you Jason. that was very helpful. I got it to work using the new ST app after trying several times.

So here are my logs. As soon as I get the app installed in ST and I set up my side of the bed, I get this in the logs - it connects, gets the status, and then nothing further. If I navigate to the bed in the app and try to adjust the pressure, nothing displays in the logs - no error and no indication that anything happens. Its as if it is locked up.

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:21 PM: debug getChildDevices(false), children=1

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:20 PM: trace [SleepNumberManager] Updating Family Status

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:20 PM: trace getBedData()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:20 PM: trace initialize()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:20 PM: trace updated()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:20 PM: trace updated()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:18 PM: debug getChildDevices(false), children=1

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:18 PM: trace rootPage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:18 PM: debug getChildDevices(false), children=1

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:18 PM: trace rootPage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:17 PM: debug getChildDevices(false), children=1

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:17 PM: trace rootPage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:17 PM: trace createDevicePage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:17 PM: trace createDevicePage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:16 PM: trace selectDevicePage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:14 PM: trace selectDevicePage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:13 PM: debug Response Data: [beds:[[bedId:-0000000027075130068, leftSide:[alertDetailedMessage:No Alert, alertId:0, isInBed:false, lastLink:00:00:00, pressure:3960, sleepNumber:100], rightSide:[alertDetailedMessage:No Alert, alertId:0, isInBed:false, lastLink:00:00:00, pressure:3064, sleepNumber:100], status:1]]]

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:13 PM: debug getChildDevices(false), children=0

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:13 PM: trace [SleepNumberManager] Updating Family Status

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:13 PM: trace getBedData()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:13 PM: trace findDevicePage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:13 PM: trace getBedData()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:13 PM: trace findDevicePage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:11 PM: debug Response Data: [beds:[[bedId:-0000000027075130068, leftSide:[alertDetailedMessage:No Alert, alertId:0, isInBed:false, lastLink:00:00:00, pressure:3960, sleepNumber:100], rightSide:[alertDetailedMessage:No Alert, alertId:0, isInBed:false, lastLink:00:00:00, pressure:3064, sleepNumber:100], status:1]]]

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:11 PM: debug getChildDevices(false), children=0

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:11 PM: trace [SleepNumberManager] Updating Family Status

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:11 PM: trace getBedData()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:11 PM: trace findDevicePage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:11 PM: debug getChildDevices(false), children=0

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:11 PM: trace rootPage()

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:09 PM: debug getChildDevices(false), children=0

353de50d-fd64-493b-a161-2f5ad05b262e 8:19:09 PM: trace rootPage()

@Classic_Tim - any ideas what I might be doing wrong? It doesn’t look like anyone else is having the same issue as I am.

I’ve installed the app and device handler but when I enter my username and password and click to create a new device I get a quick “thinking” spin that goes away and nothing happens. Not sure what I can be doing wrong as well. Thanks in advance for your help!

@Classic_Tim first of formost thanks for this. I am a more of a hobbiest than a coder so still quite a steep learning curve for me expecially in java have never really done anything with it. Using your Source code on my queen split non-adjustable has worked but, I’m not sure it’s working as intended. The dimmer for either side you have to hold at position for the bed to inflate/deflate you can’t just slide to number and let go? Anouther question I have is with the google assistant intergration within SmartThings I can’t get any voice function to work. Any answers or input as to where to look to imporve this would be greatly appricated. Again thanks much for the app for a man just getting going on my home automation setup this has been a great starting point for my custom stuff.

This is great! Thank you for the work on this. Bed position and firmness settings work perfectly!

This is excellent and it works exactly as you said for me. I have a split king. Among the features I would like to see if you can add is to raise head and legs separately and for each bed to a custom value not just the favorite if possible. Thank you!