Only the bed device has that method as the head and foot are generic (built in) devices (though looking at the code I think it may call on all). But I’m surprised that method generates any load at all, it’s just dispatching an event indicating whether or not the device is connected and it does so once per poll.
I don’t see this on mine, is there a chance you poll very often (what’s your refresh rate)?
In any case, I think I can likely make this a bit more efficient and will try to look sometime soon.
@mluck - I updated the setConnectionState method to only dispatch an event if there's a change. I don't know if that will resolve it for you or not but it's about the only tweak I can think of. I did confirm the app is only calling that on the bed devices (the custom ones) so it should be calling it once per side only and only during refreshes. So unless your beds are going online and offline with each refresh poll, I can't see how this is exerting any real load... in any case, try the new version and let me know how it goes.
I hope I am posting this in the right place. If not, please direct me. I’m an occasional user of HE, meaning that I get something working then I don’t pay much attention to it unless it quits working.
So. I am trying to get this Sleep Number Controller working and am getting an error when I go to select bed. Also, the app is not listed in my list of apps although it is listed under Hubitat Package Manager and I’m not sure how to get back to it.
While I was initially trying to set up the app, I was able to generate a debug log:
Hi! Just trying to get this integration off the ground and am having some trouble. When configuring the app for the first time after a successful package manager install, it’ll show online until I try to send a command and then goes into an “API Error” state.
Logs are showing “400 Bad Request”…
Error making request {uri=https://prod-api.sleepiq.sleepnumber.com, path=/rest/bed/-9223372018060107576/sleepNumberFavorite, requestContentType=application/json, contentType=application/json, headers={Host=prod-api.sleepiq.sleepnumber.com, User-Agent=SleepIQ/1669639706 CFNetwork/1399 Darwin/22.1.0, Cookie=AWSALB=3x0i7Kqwy5o9NCxDI63wBzSzmmKCCyT0dViQCaXmU+pTYCK2z9AiZaUyhLmCvglAvW0Z4xnIbNc2nDuXv8DexeyaV3cGT2G37l76ouZDPcEzxqWfNiHcrv1IG9qP;AWSALBCORS=3x0i7Kqwy5o9NCxDI63wBzSzmmKCCyT0dViQCaXmU+pTYCK2z9AiZaUyhLmCvglAvW0Z4xnIbNc2nDuXv8DexeyaV3cGT2G37l76ouZDPcEzxqWfNiHcrv1IG9qP;JSESSIONID=5882F195C0F50DBBF0A3D359E34FC84E;, DNT=1, Accept-Version=4.4.1, X-App-Version=4.4.1}, query={_k=mow8cWO9nheKg}}
groovyx.net.http.HttpResponseException: status code: 400, reason phrase: Bad Request
Ideas? Happens consistently with any command. I can read state from the bed, but won’t respond to commands at all. Thanks!
I’ve been traveling so haven’t had a chance to try this since the update. Maybe others can comment if it still works or not? I won’t be back until mid-December and can test a bit with my bed then.
I wonder if the update switched old beds to the new API somehow? If so I’ll try to step up my efforts to modify the code to handle both… I’ve got a few calls updated but it’s been going slowly.
Update: at least on my bed remotely, the API is still the old one and the app works.
@shircliffs - are you able to update logging level to debug and provide output from when you try to set the number?
Much appreciated! I've got some developer skills (php, mysql, js, html, etc...), but I've never done anything for hubitat and really wouldn't know where to start on my own. But if there's anything I can do to help out just let me know.
I could use some advice. This app is awesome and I'm hoping to use it more and more. Bed presence detection in particular is going to be great when my shades get here. There is 2 things that I have not figured out how to make work. And it could entirely be my fault. I can't set the sleep number and I can't update the favorite. I get the error in the attached screen snip.
I'd love to learn how to troubleshoot this one. Any thoughts?
And I apologize if this was already answered. It's a long thread and I've tried to look. If it's there, I'm missing it.
Thanks for reporting this. I think that’s a bug that must’ve been introduced recently. I’ll see if I can reproduce it and get it fixed. If I can’t reproduce then I may reach out for some help troubleshooting.