SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Posted on
Thu Jul 12, 2018 3:05 pm
tatrog offline
Posts: 39
Joined: Nov 16, 2013

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Hi-just installed plugin. All actions and triggers are working but my log keeps filling up with the below. Any ideas? Love the plugin btw.
On vs 1.1.0


SleepyBed IQ Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 160, in runConcurrentThread
File "plugin.py", line 464, in parseBedData
AttributeError: 'NoneType' object has no attribute 'data'

SleepyBed IQ Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
SleepyBed IQ Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 160, in runConcurrentThread
File "plugin.py", line 464, in parseBedData
AttributeError: 'NoneType' object has no attribute 'data'

SleepyBed IQ Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
SleepyBed IQ Error Error in plugin execution runConcurrentThread:

Posted on
Thu Jul 12, 2018 8:49 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Interesting. I need debug log output to track that down. Enable debug logging (Plugins -> SleepyBed IQ-> Toggle Debuggjng). Then reload the plugin and paste in the log into your response from where the plugin reloads to the error.

Posted on
Mon Jul 16, 2018 2:19 pm
tatrog offline
Posts: 39
Joined: Nov 16, 2013

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Turned on debugging and restarted the plugin but it didn't show any additional information. I did notice that the actions work fine (change tilt, sleep # etc) however the custom states are not updated at all eg. anyoneinbed=false always.


log after reloading with debugging on:

Reloading plugin "SleepyBed IQ 1.1.0"
Stopping plugin "SleepyBed IQ 1.1.0" (pid 34075)
Stopped plugin "SleepyBed IQ 1.1.0"
Starting plugin "SleepyBed IQ 1.1.0" (pid 34119)
Started plugin "SleepyBed IQ 1.1.0"
SleepyBed IQ Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 160, in runConcurrentThread
File "plugin.py", line 464, in parseBedData
AttributeError: 'NoneType' object has no attribute 'data'

SleepyBed IQ Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
SleepyBed IQ Error Error in plugin execution runConcurrentThread:

Posted on
Mon Jul 16, 2018 3:37 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Doesn't look like debugging was turned on. It should look something like this when debugging is on...

Code: Select all
   SleepyBed IQ                    Turning on debug logging
   SleepyBed IQ Debug              Stopping device: Bedroom Bed
   SleepyBed IQ Debug              Starting device: Bedroom Bed
   Reloading plugin "SleepyBed IQ 1.1.0"
   Stopping plugin "SleepyBed IQ 1.1.0" (pid 96413)
   SleepyBed IQ Debug              Stopping device: Bedroom Bed
   SleepyBed IQ Debug              shutdown called
   Stopped plugin "SleepyBed IQ 1.1.0"
   Starting plugin "SleepyBed IQ 1.1.0" (pid 96422)
   SleepyBed IQ Debug              Initializing Plugin.
   Started plugin "SleepyBed IQ 1.1.0"
   SleepyBed IQ Debug              startup called
   SleepyBed IQ Debug              Running plugin version check (if enabled).
   SleepyBed IQ Debug              Starting device: Bedroom Bed
   SleepyBed IQ Debug              Starting runConcurrentThread.
   SleepyBed IQ Debug              parseBedData called.
   SleepyBed IQ Debug              parseBedData: Setting device "Bedroom Bed" properties to:
com.nathansheldon.indigoplugin.sleepybed-iq : (dict)
     AllowOnStateChange : false (bool)
     AllowSensorValueChange : false (bool)
     SupportsBatteryLevel : false (bool)
     SupportsOnState : true (bool)
     SupportsSensorValue : false (bool)
     SupportsStatusRequest : true (bool)
     accountId : <redacted> (string)
     address : <redacted> (string)
     base : FlexFit 1 (string)
     bedId : <redacted> (string)
     bedName : Sheldon Bed (string)
     dualSleep : true (bool)
     generation : legacy (string)
     isKidsBed : false (bool)
     macAddress : <redacted> (string)
     model : C2 (string)
     purchaseDate : 2015-02-17T21:24:56Z (string)
     reference : <redacted> (string)
     registrationDate : 2015-03-04T19:39:57Z (string)
     returnRequestStatus : 0 (integer)
     serial :  (string)
     size : None (empty)
     sku : <redacted> (string)
     status : 1 (integer)
     timeZone : US/Pacific (string)
     version :  (string)
     zipCode : <redacted> (string)
   SleepyBed IQ Debug              parseBedData: Setting device "Bedroom Bed" states to:
[{'value': False, 'key': 'leftIsInBed'}, {'value': 34, 'key': 'leftPressure'}, {'value': 50, 'key': 'leftSleepNumber'}, {'value': u'<redacted>', 'key': 'leftSleeperId'}, {'value': u'Elizabeth', 'key': 'leftSleeperName'}, {'value': 480, 'key': 'leftSleepGoal'}, {'value': 0, 'key': 'leftAlertId'}, {'value': u'No Alert', 'key': 'leftAlertText'}, {'value': False, 'key': 'rightIsInBed'}, {'value': 96, 'key': 'rightPressure'}, {'value': 40, 'key': 'rightSleepNumber'}, {'value': u'<redacted>', 'key': 'rightSleeperId'}, {'value': u'Nathan', 'key': 'rightSleeperName'}, {'value': 390, 'key': 'rightSleepGoal'}, {'value': 0, 'key': 'rightAlertId'}, {'value': u'No Alert', 'key': 'rightAlertText'}, {'value': False, 'key': 'anyoneInBed'}, {'value': False, 'key': 'onOffState'}, {'value': False, 'key': 'everyoneInBed'}]
   SleepyBed IQ Debug              Stopping device: Bedroom Bed
   SleepyBed IQ Debug              Starting device: Bedroom Bed
   SleepyBed IQ Debug              parseBedData called.
   SleepyBed IQ Debug              parseBedData: Setting device "Bedroom Bed" properties to:
com.nathansheldon.indigoplugin.sleepybed-iq : (dict)
     AllowOnStateChange : false (bool)
     AllowSensorValueChange : false (bool)
     SupportsBatteryLevel : false (bool)
     SupportsOnState : true (bool)
     SupportsSensorValue : false (bool)
     SupportsStatusRequest : true (bool)
     accountId : <redacted> (string)
     address : <redacted> (string)
     base : FlexFit 1 (string)
     bedId : <redacted> (string)
     bedName : Sheldon Bed (string)
     dualSleep : true (bool)
     generation : legacy (string)
     isKidsBed : false (bool)
     macAddress : <redacted> (string)
     model : C2 (string)
     purchaseDate : 2015-02-17T21:25:12Z (string)
     reference : <redacted> (string)
     registrationDate : 2015-03-04T19:39:57Z (string)
     returnRequestStatus : 0 (integer)
     serial :  (string)
     size : None (empty)
     sku : <redacted> (string)
     status : 1 (integer)
     timeZone : US/Pacific (string)
     version :  (string)
     zipCode : <redacted> (string)
   SleepyBed IQ Debug              parseBedData: Setting device "Bedroom Bed" states to:
[{'value': False, 'key': 'leftIsInBed'}, {'value': 34, 'key': 'leftPressure'}, {'value': 50, 'key': 'leftSleepNumber'}, {'value': u'<redacted>', 'key': 'leftSleeperId'}, {'value': u'Elizabeth', 'key': 'leftSleeperName'}, {'value': 480, 'key': 'leftSleepGoal'}, {'value': 0, 'key': 'leftAlertId'}, {'value': u'No Alert', 'key': 'leftAlertText'}, {'value': False, 'key': 'rightIsInBed'}, {'value': 96, 'key': 'rightPressure'}, {'value': 40, 'key': 'rightSleepNumber'}, {'value': u'<redacted>', 'key': 'rightSleeperId'}, {'value': u'Nathan', 'key': 'rightSleeperName'}, {'value': 390, 'key': 'rightSleepGoal'}, {'value': 0, 'key': 'rightAlertId'}, {'value': u'No Alert', 'key': 'rightAlertText'}, {'value': False, 'key': 'anyoneInBed'}, {'value': False, 'key': 'onOffState'}, {'value': False, 'key': 'everyoneInBed'}]
   SleepyBed IQ Debug              Stopping device: Bedroom Bed
   SleepyBed IQ Debug              Starting device: Bedroom Bed


If you don't see that kind of output, then debug logging isn't turned on. Be sure you go to the Plugins menu, then SleepyBed IQ, then Toggle Debugging. You will see "SleepyBed IQ Turning on debug logging" appear in the Indigo log. If you don't then there's something wrong with Indio, or the SleepyBed IQ plugin has become corrupted somehow and will need to be re-installed.

Posted on
Sat Jul 28, 2018 9:33 am
tatrog offline
Posts: 39
Joined: Nov 16, 2013

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Things slowed down a bit so figured I would try and work this out. I did re-install the plugin as toggling the debug was producing the same results. Unfortunately that did nothing to resolve the problem. However I did get the following when I did the new config as a result of reload/start over.

Code: Select all
I enter the username/passwd and it verified, click safe and the following results on log file:
Jul 28, 2018 at 11:14:26 AM
   Enabling plugin "SleepyBed IQ 1.1.0"
   Starting plugin "SleepyBed IQ 1.1.0" (pid 1576)
   Started plugin "SleepyBed IQ 1.1.0"
   SleepyBed IQ                    Your plugin version, v1.1.0, is current.
   SleepyBed IQ Error              Unable to connect to the SleepIQ service. Error: 'key'
   SleepyBed IQ Error              Unable to load the list of beds associated with this SleepIQ account. Error: 'key'


I am not able to locate my bad when I add the the bed as a new device, the configuration drop down is empty at this point. However if I reload the plugin I get the following logs (same logs debug on or off):
Code: Select all
l 28, 2018 at 11:26:44 AM
   Reloading plugin "SleepyBed IQ 1.1.0"
   Stopping plugin "SleepyBed IQ 1.1.0" (pid 1576)
   Stopped plugin "SleepyBed IQ 1.1.0"
   Starting plugin "SleepyBed IQ 1.1.0" (pid 1600)
   Started plugin "SleepyBed IQ 1.1.0"
   SleepyBed IQ Error              Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 160, in runConcurrentThread
  File "plugin.py", line 464, in parseBedData
AttributeError: 'NoneType' object has no attribute 'data'

   SleepyBed IQ Error              plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


But now I can see my Bed (Gerry) in the device config drop down. I can execute actions against the bed, set sleep number etc but none of the custom state information is updating and the logs file with the same above code.

Thanks for taking another look.

Posted on
Sat Jul 28, 2018 9:01 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Hi.

I need to see the debug log output. Toggling Debugging won't fix the problem, but it'll show me where in the code the problem begins.

The first error clearly indicates that it wasn't able to connect, though that may be intermittent if you're able to send commands to the bed successfully. The second error indicates the plugin isn't getting any data from the SleepIQ service even after connecting. Without the debug logs I cannot tell you any more about the error nor can I attempt to fix it. Please click on the Plugins menu, select SleepyBed IQ then Toggle Debugging. Then go back to the Plugins menu, select SleepyBed IQ then select Reload. Copy the entire log from the point where you reloaded to the point where you see the "AttributeError" message and paste it into your reply. I'll look at the debug logs and see if it's a problem I can fix, or at minimum make the error more helpful.

Posted on
Fri Dec 13, 2019 4:15 pm
Ricco offline
Posts: 6
Joined: Oct 13, 2013

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

I am having problems with side of the beds, if a trigger happens or an action is executed the wrong side of the bed reacts.

Posted on
Fri Dec 13, 2019 6:22 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Hi Rocco.

Do the sides of the bed look correct in the SleepIQ app on you phone and in the SleepIQ web site? The sides may be reversed in the SleepIQ system if you’ve disconnected and reconnected the base of the bed recently.

Posted on
Sun Dec 22, 2019 11:51 am
Ricco offline
Posts: 6
Joined: Oct 13, 2013

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

The settings on my phone and website are correct, they match.... any thoughts.
Another question, should I have my own account on the SleepIQ or does not make any difference.
Thanks you.

Posted on
Sun Dec 22, 2019 4:30 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Hmmm. Interesting. I'll look into fixing that. Thanks for the report.

Posted on
Sun Nov 22, 2020 1:48 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Version 1.2.0 Posted

  • Updated Sleep IQ API library to support changes in the Sleep IQ API.
  • Added states for separate left and right side head and foot base position values.
  • Added action to set the foot and head parts of supported bed bases to precise positions.

Posted on
Sun Nov 22, 2020 3:31 pm
Doctor Q offline
Posts: 67
Joined: Feb 18, 2020

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Hi, Nathan. I noticed a while back that actions I had set to trigger with Sleep IQ were not occurring. I assumed Sleep Number had messed with their API and was glad to see your update. I'm getting constant 404 errors concerning status info and features list. Before I posted this, I had my wife lay down on the bed and and the plug-in's status changed to on! About a minute after she got up, it turned off! Still churning out 404 errors, though.

Posted on
Sun Nov 22, 2020 5:00 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Thanks for the report.

That’s strange that it’s still partially working. We only have the one SleepNumber bed for me to test with and it’s an older model. Perhaps there are different API URLs for different models. I should also note that we’re in the United States. If you’re not, I wouldn’t be surprised if Select Comfort set up different URLs for different regions due to different privacy laws. Maybe you could turn on debug logging in the SleepyBed IQ plugin and provide some debug logs from before through after seeing that 404 error. I’m hoping that will help track down the source of the problem.

Posted on
Mon Nov 23, 2020 11:14 am
tatrog offline
Posts: 39
Joined: Nov 16, 2013

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Hi Nathan,
over the weekend I was getting errors and couldn't validate my sleepIQ login. The latest update fixed that issue. However now I am having the following:
environment-4 year old sleepnumber bed in the USA and plugin has been solid. We use this plugin heavily for several use cases such as night time actions, when to turn on/off overhead fan, A bunch of wakeup action for each of us. Thanks so much or the plugin and hope you can sort out the new issues.

1. I tested the ability to set the % level for head and foot. This works great and a nice addition
2. Presence works as expected. can tell when each person is in bed or out.
3. set sleep number fails-happens using any number between 0 and 100-note I did not try every number but enough to figure the number wasn't the issue.
Nov 23, 2020 at 12:05:44 PM
Action Group test sleep bed
SleepyBed IQ Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 608, in setSleepNumber
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/SleepyBed IQ.indigoPlugin/Contents/Server Plugin/sleepyq/__init__.py", line 264, in set_sleepnumber
ValueError: Invalid SleepNumber, must be between 0 and 100

4. set flex presets fails using any of the presets--I also tested using slow and fast speeds with same results:
Nov 23, 2020 at 12:07:30 PM
Action Group test sleep bed
SleepyBed IQ Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 637, in selectFlexFitPreset
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/SleepyBed IQ.indigoPlugin/Contents/Server Plugin/sleepyq/__init__.py", line 225, in preset
AttributeError: 'int' object has no attribute 'lower'

Posted on
Mon Nov 23, 2020 1:03 pm
Doctor Q offline
Posts: 67
Joined: Feb 18, 2020

Re: SleepyBed IQ - Free SleepNumber Bed Monitor Plugin

Nathan, just sent you a PM with the debug log.

Who is online

Users browsing this forum: No registered users and 1 guest