I seem to be missing a basic understanding of dashboards. I selected "sleepIQSummary" for the tile, and all I get is some HTML code. What am I doing wrong?
You need a text or html tile, not a presence sensor. Unfortunately I have no idea if you can do that with EZ Dashboards. You can with the classic dashboard for sure.
Thanks for the tip. I switched to classic dashboard and its working fine.
I have a rule that runs once a day, picks up some numbers from the bed and sends me a message with the numbers.
This works fine with one exception. The numbers do not get refreshed from the previous day.
I tried doing a "Poll" first, but that did nothing. Then I tried "Capture" which also did nothing. I then looked for "Refresh" but it was not an available option.
If I go to the Device page for the bed and select "Get Sleep Data", the numbers DO refresh. How do I get the numbers to refresh from within a rule?
Use "getSleepData()" as a custom action in your rule. From the Rule 5.1 documentation:
I just want this to happen at a specified time, so I don't have a last trigger device. Without a trigger device, I can't get to the correct action list.
Yes you can. Using a custom action on the Sleep number device isn’t dependent on using a device as the trigger.
Yes, Got it.
I had to give it an attribute of the bed before I could select the bed from a list of devices. All working now.
Thanks for your help.
I'm trying to set a variable to the sleeping attribute of the bed but it always comes back as null even though I can see it updates in the bed events to either sleeping or not sleeping. Am I missing something?
Show us how you are attempting to set the variable.
This works for me:
Poll: Ken's Bed
// Without 'Poll' getSleepData() failed with authorization error.
getSleepData() on Ken's Bed
Delay 0:00:01
Set nScore to Ken's Bed sleepScore
I'm using rule machine. I see you're doing the sleepScore (which also works for me). The issue I'm having is with the sleepSensor or sleeping attribute (it's labeled differently in different places it seems). I'm trying to set it in rule machine but the value is always null even though you can see in the device events its set when it changes.
I also get "null" for "sleeping". Could you use "presence"?
Just a random idea, try checking the variable while someone is in the bed.
Unfortunately presence doesn't work. That only tells me if I was in bed or not. I’m trying to get the asleep vs restless state (which is what I’m assuming the sleepState is) like you see in the sleep number app. I've tried checking it when I know the value but it still returns null every time.
I still not sure what you are trying to get at. My Sleep Number App shows 4 stats. Time to fall asleep, Restful, Restless, Bed exit. All 4 of these are available as individual items in HE.
Is what you want Total_Sleep = Restful + Restless?
Then just add restfulAverage + restlessAverage.
I'm trying to capture the specific times where it detects that I'm restless. So I'd be able to see I was restless from 12:30am-12:45am for example in hubitat. Then I'm going to use that information to trigger cooling automations (because every time I'm restless it's because I'm hot).
Now I understand. If you sample every few minutes, and restless has changed between samples, wouldn't that mean that you were in restless mode?
I think what you are saying is to check the cumulative restless time (restlessAverage) and see if it has increased? I currently poll every 1 minute at night and unfortunately that number only updates after it detects that I've left the bed.
I looked at the driver code, and (I may be wrong, but) it looks to me that "Sleeping" is supposed to be the same as "Present".
It looks like you are out of luck.
Your main issue with the null value, I can see the problem.
The driver itself is using the capability SleepSensor, which specifies an attribute (current state) of "sleeping". The driver also defines "sleeping" on its own, which is not needed but also harmless.
However, the driver is incorrectly trying to set the attribute sleepSensor instead of sleeping, as shown in your events screenshot.

The bug is in the library file line 100 @rvrolyk : SleepNumberController/SleepNumber_Library.groovy at 45b6270e24f612c6ea5821410c5dbea38f67bbec · rvrolyk/SleepNumberController · GitHub
If that was changed to:
@Field static final String sSLEEPSENSOR = 'sleeping'
then the Current State would populate correctly and not be null.
However, the only values you will see there is "sleeping" or "not sleeping"

Thanks for pointing out a possible problem. I’m away for the holidays but will take a look when I get back and fix this. Off hand I recall that value being the event value not the key but I’ll have to dig a bit to refresh my memory.




