Side note i am also seeing this:
2020-12-07 05:13:46.626 pm [error] Sleep data only available on presence (main) device, this is null
Side note i am also seeing this:
2020-12-07 05:13:46.626 pm [error] Sleep data only available on presence (main) device, this is null
Here is a sequence in the logs - when the Poll happens, it does set the state on my Outlet. But when I manually change that state from the parent or the generic component, that same Poll code never seems to fire to update the state:
If I manually hit Poll on the parent, it does indeed update the state on the child outlet to the correct setting.
Re error about sleep data - oops, I inverted a condition. Just fixed in 3.0.2.
Interesting that the polling isn't updating your child devices but does when you manually invoke it on the parent... in the (manual) poll case, all it does it tell the parent to invoke refreshChildDevices. In the scheduled case, you should have a scheduled job that invokes scheduledRefreshChildDevices
That method calls refreshChildDevices (apparently HE wants that indirection for scheduled vs. runIn calls) which in turn does the same thing the manual poll does. Similarly, after you tell a device to "do something", a runIn will invoke refreshChildDevices.
Can you turn on debug logging in the app and the device and then turn something on/off and include a screenshot of the logs captured during all that?
I upgraded and did a clean install. Here are the logs.
Right after install - the scheduledRefreshChildDevices does exist on the App
Outlet and Underbed have correct State values.
Foot and Head DO NOT have any state
Here are the logs - clearly the Poll is not processing any values for my Head and Foot settings. I'm not sure why that is? Maybe some requests I should run in the Diagnostics?
Here is a sequence turning the Outlet On:
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:22.605 pm [debug](http://192.168.2.170/installedapp/configure/101)Cached data: [:] [:]
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:22.601 pm [debug](http://192.168.2.170/device/edit/108)Setting sleepNumberFavorite to 60, it was 60
[dev:112](http://192.168.2.170/logs#dev112)2020-12-07 09:54:22.596 pm [info](http://192.168.2.170/device/edit/112)Left Outlet was turned on
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:22.590 pm [debug](http://192.168.2.170/device/edit/108)Setting outletState to On, it was On
[dev:111](http://192.168.2.170/logs#dev111)2020-12-07 09:54:22.586 pm [info](http://192.168.2.170/device/edit/111)Left Underbed Light level was set to 3
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:22.579 pm [debug](http://192.168.2.170/device/edit/108)Setting underbedLightBrightness to High, it was High
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:22.575 pm [debug](http://192.168.2.170/device/edit/108)Setting underbedLightTimer to Forever, it was Forever
[dev:111](http://192.168.2.170/logs#dev111)2020-12-07 09:54:22.570 pm [info](http://192.168.2.170/device/edit/111)Left Underbed Light was turned off
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:22.565 pm [debug](http://192.168.2.170/device/edit/108)Setting underbedLightState to Off, it was Off
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:22.561 pm [debug](http://192.168.2.170/device/edit/108)Setting privacyMode to off, it was off
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:22.557 pm [debug](http://192.168.2.170/device/edit/108)Setting sleepNumber to 60, it was 60
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:22.552 pm [debug](http://192.168.2.170/device/edit/108)setStatus([sleepNumber:60, privacyMode:off, underbedLightState:Off, underbedLightTimer:Forever, underbedLightBrightness:100, outletState:On, sleepNumberFavorite:60])
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:21.440 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/sleepNumberFavorite with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:21.436 pm [debug](http://192.168.2.170/installedapp/configure/101)Getting Sleep Number Favorites
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:21.433 pm [debug](http://192.168.2.170/installedapp/configure/101)Not updating footwarming state, no data
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:21.430 pm [debug](http://192.168.2.170/installedapp/configure/101)Not updating foundation state, no data
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:21.408 pm [debug](http://192.168.2.170/device/edit/108)departed()
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:21.403 pm [debug](http://192.168.2.170/device/edit/108)setPresence(false)
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:20.522 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk, outletId:2]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:19.485 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk, outletId:1]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:18.520 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk, outletId:4]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:17.497 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/system with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:17.327 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/underbedLight with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:16.723 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk, outletId:3]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:16.567 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/pauseMode with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:16.563 pm [debug](http://192.168.2.170/installedapp/configure/101)Getting Privacy Mode for -9223372034804985069
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:16.472 pm [debug](http://192.168.2.170/installedapp/configure/101)Response data from SleepNumber: [beds:[[status:1, bedId:-9223372034804985069, leftSide:[isInBed:false, alertDetailedMessage:No Alert, sleepNumber:60, alertId:0, lastLink:00:00:00, pressure:663], rightSide:[isInBed:false, alertDetailedMessage:No Alert, sleepNumber:90, alertId:0, lastLink:00:00:00, pressure:2045]]]]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:16.322 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/familyStatus with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:16.318 pm [debug](http://192.168.2.170/installedapp/configure/101)Getting family status
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:54:06.020 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk]: {"timer":null,"setting":1,"outletId":1}
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:05.965 pm [debug](http://192.168.2.170/device/edit/108)sending to parent setOutletState, On
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:05.961 pm [debug](http://192.168.2.170/device/edit/108)setOutletState(On)
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:54:05.956 pm [debug](http://192.168.2.170/device/edit/108)componentOn outlet
And at this point, I do see the State updating correctly for the Outlet and the Underbed Light. They take a bit for all the queries to come back, but that's fine...
Just no state showing up for Feet or Head children. Here is that sequence in the log:
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:51.646 pm [debug](http://192.168.2.170/installedapp/configure/101)Cached data: [:] [:]
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:51.641 pm [debug](http://192.168.2.170/device/edit/108)Setting sleepNumberFavorite to 60, it was 60
[dev:112](http://192.168.2.170/logs#dev112)2020-12-07 09:58:51.637 pm [info](http://192.168.2.170/device/edit/112)Left Outlet was turned on
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:51.633 pm [debug](http://192.168.2.170/device/edit/108)Setting outletState to On, it was On
[dev:111](http://192.168.2.170/logs#dev111)2020-12-07 09:58:51.628 pm [info](http://192.168.2.170/device/edit/111)Left Underbed Light level was set to 3
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:51.618 pm [debug](http://192.168.2.170/device/edit/108)Setting underbedLightBrightness to High, it was High
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:51.614 pm [debug](http://192.168.2.170/device/edit/108)Setting underbedLightTimer to Forever, it was Forever
[dev:111](http://192.168.2.170/logs#dev111)2020-12-07 09:58:51.609 pm [info](http://192.168.2.170/device/edit/111)Left Underbed Light was turned off
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:51.604 pm [debug](http://192.168.2.170/device/edit/108)Setting underbedLightState to Off, it was Off
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:51.600 pm [debug](http://192.168.2.170/device/edit/108)Setting privacyMode to off, it was off
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:51.594 pm [debug](http://192.168.2.170/device/edit/108)Setting sleepNumber to 60, it was 60
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:51.589 pm [debug](http://192.168.2.170/device/edit/108)setStatus([sleepNumber:60, privacyMode:off, underbedLightState:Off, underbedLightTimer:Forever, underbedLightBrightness:100, outletState:On, sleepNumberFavorite:60])
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:50.501 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/sleepNumberFavorite with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:50.497 pm [debug](http://192.168.2.170/installedapp/configure/101)Getting Sleep Number Favorites
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:50.493 pm [debug](http://192.168.2.170/installedapp/configure/101)Not updating footwarming state, no data
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:50.489 pm [debug](http://192.168.2.170/installedapp/configure/101)Not updating foundation state, no data
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:50.422 pm [debug](http://192.168.2.170/device/edit/108)departed()
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:50.417 pm [debug](http://192.168.2.170/device/edit/108)setPresence(false)
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:49.555 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk, outletId:2]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:48.462 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk, outletId:1]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:47.405 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk, outletId:4]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:46.563 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/system with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:46.358 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/underbedLight with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:45.787 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/outlet with query [_k:E76vaZA7CEGTk, outletId:3]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:45.614 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/pauseMode with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:45.610 pm [debug](http://192.168.2.170/installedapp/configure/101)Getting Privacy Mode for -9223372034804985069
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:45.505 pm [debug](http://192.168.2.170/installedapp/configure/101)Response data from SleepNumber: [beds:[[status:1, bedId:-9223372034804985069, leftSide:[isInBed:false, alertDetailedMessage:No Alert, sleepNumber:60, alertId:0, lastLink:00:00:00, pressure:827], rightSide:[isInBed:false, alertDetailedMessage:No Alert, sleepNumber:90, alertId:0, lastLink:00:00:00, pressure:2173]]]]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:45.292 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/familyStatus with query [_k:E76vaZA7CEGTk]
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:45.287 pm [debug](http://192.168.2.170/installedapp/configure/101)Getting family status
[app:101](http://192.168.2.170/logs#app101)2020-12-07 09:58:26.100 pm [debug](http://192.168.2.170/installedapp/configure/101)Sending request for /rest/bed/-9223372034804985069/foundation/adjustment/micro with query [_k:E76vaZA7CEGTk]: {"speed":0,"actuator":"F","side":"L","position":40}
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:26.079 pm [debug](http://192.168.2.170/device/edit/108)sending to parent setFoundationAdjustment, [actuator:F, position:40]
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:26.075 pm [debug](http://192.168.2.170/device/edit/108)setBedPosition(40)
[dev:108](http://192.168.2.170/logs#dev108)2020-12-07 09:58:26.067 pm [debug](http://192.168.2.170/device/edit/108)componentSetLevel foot 40 null
Ok here is my problem:
"Not updating foundation state, no data"
is showing in the log, so code around line 818 in Sleep Number Controller is hitting this error and not passing position info along to the devices.
I am not sure why this is happening. Maybe something wrong with SleepIQ API?
Response data from SleepNumber: [beds:[[status:1, bedId:-9223372034804985069, leftSide:[isInBed:false, alertDetailedMessage:No Alert, sleepNumber:60, alertId:0, lastLink:00:00:00, pressure:783], rightSide:[isInBed:false, alertDetailedMessage:No Alert, sleepNumber:90, alertId:0, lastLink:00:00:00, pressure:2116]]]]
Interesting - if you have debug logging on then we should see any errors if the API is throwing them. Can you include a screenshot of the application state?
Also if you can run /rest/bed/${bedId}/foundation/status from the diagnostic page (should be a GET) and see what it returns that may shed some light.
[beds:[[status:1, bedId:-9223372034804985069, leftSide:[isInBed:false, alertDetailedMessage:No Alert, sleepNumber:60, alertId:0, lastLink:00:00:00, pressure:803], rightSide:[isInBed:false, alertDetailedMessage:No Alert, sleepNumber:90, alertId:0, lastLink:00:00:00, pressure:2027]]]]
I am not seeing any errors - just these debug messages:
2020-12-07 10:30:10.694 pm [debug] Not updating footwarming state, no data
2020-12-07 10:30:10.690 pm [debug] Not updating foundation state, no data
What’s the application state?
Ah, that shows the problem. It shows your bed doesn't report a "base" as one of the components and I'm using the presence of that component to determine whether or not the bed has a head and a foot that can be acted on. This was a fix added to help @tray_e with errors seen polling for foundation status.
@brad2, I'm curious what the diagnostics page shows for your bed? I think last time you pasted this it just had Pump and Bed (no Warming or Base) which means this probably hasn't worked for you for a while (since end of August)? Can you confirm you do have a bed that allows the head and foot to be manipulated?
If I can't rely on the presence of a "Base" component to determine when the foundation is available I may have to make this a user selectable option or at least allow you to override the detection 
Yes I definitely have both. Mine is the i10 with the split top, so we have two separate sides for the head and a single foot.

Well that does throw a wrench in things. Tray's output looked like:
Size: KING
Dual Sleep: true
Components:
Type: Bed (double)
Status: INSTALLED
Model: P5
Type: Pump
Status: INSTALLED
Model: P5
And since mine had a base (and others I've seen as well), I took the lack of one to mean the foundation wasn't present but clearly that's incorrect. I sure wish SleepNumber supported a proper API.
The P5 bed can also come with a split top so I don't really know how to distinguish the normal bed (like Tray's case) vs. the split top case given they've seen fit to not provide additional components like they do in other cases (I swear I recall someone with a split top having a "Base" component).
I can think of a few options to resolve this:
I'm leaning towards #2 but am happy to listen to alternative ideas 
@brad2 for now if you remove the check for "Base" on line 748, things should work for you.
I don't have them. The only split on mine is between the two sides. Other than that, I don't have any of the other options.
Just bed, pump, and sensors for SleepIQ
That change in line 748 does indeed fix things - all State values are now being set correctly on the child devices. Thanks!
I think option 2 is reasonable. Its easy to ignore devices that are not relevant or manually remove them.
I just pushed 3.0.3 which should fix this by only polling if the head or foot devices exist (rather than checking what SleepIQ reports as components)
Occasionally, I'll get a flood of errors in the logs but going into the app and just clicking done again clears it up. Would it be possible for the app to do this check on its own and reinitialize or whatever?
Has anyone got the under bed lights working? I can't seem to get my on or off or set a timer from the device page or a rule. Thanks