SleepIQ Binding issue polling Sleep Number API

Can you hold off on upgrading for a few days? I’d like to see if I can find a solution to make it backwards compatible.

That is not a problem. I will hold off.

Hmm. I just con’t see why you’d be getting this error on 3.3 M1. The reported binary incompatibility was with 3.2. So, if you want to upgrade to the latest milestone, go for it.

OK… I see M3 just came out yesterday. I will jump to that release either later today or Tuesday. i will let you know if I see anything different following the upgrade.

Hi Mark,

Looks like I started seeing the same issue:

2022-04-04 13:00:49.499 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NoSuchMethodError: 'void org.openhab.core.library.types.DecimalType.<init>(java.lang.Number)'
	at org.openhab.binding.sleepiq.internal.handler.SleepIQDualBedHandler.onBedStateChanged(SleepIQDualBedHandler.java:183) ~[?:?]
	at org.openhab.binding.sleepiq.internal.handler.SleepIQCloudHandler.lambda$2(SleepIQCloudHandler.java:306) ~[?:?]
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:?]
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[?:?]
	at org.openhab.binding.sleepiq.internal.handler.SleepIQCloudHandler.refreshBedStatus(SleepIQCloudHandler.java:306) ~[?:?]
	at org.openhab.binding.sleepiq.internal.handler.SleepIQCloudHandler.lambda$1(SleepIQCloudHandler.java:152) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

I also see that the channels seem to have gone to sleep and no longer get updates.

I’m on 3.2

Let me know if you want me to try/provide anything specific.

Thanks
Simon

Ugh. Maybe I’ll try updating my dev environment and rebuild the binding.

Unfortunately, that’s a consequence of the above error which causes the scheduled refresh job to die.

@mhilbush I jumped to 3.3.0M3 successfully. Once stable I put the latest snapshot in and it appears ok. I will fully test my automation tonight but the bed is responsive through the API.

@mhilbush This has been stable for some time. Is this going to make it into a milestone release?

Unfortunately I’ve been dealing with a bunch of other personal stuff lately. It’ll make it into a release.

Not a problem. I am just concerned of a breaking change in the future of Openhab releases. I have not moved to a 3.4.0 milestone yet…

Yay! I finally got some time to submit the PR for my changes to the binding.

It’s likely to take a while for it to get merged, as the changes are pretty extensive.

@mhilbush, not sure if this is the right thread to ask on, but is there any thought into putting control of the FlexFit base into the binding?

Yes, I have all the SleepIQ API calls to do this. I was just waiting for this PR to get merged, since the changes will touch much of the same code as the PR.

  • get foundation features
  • get foundation status
  • select foundation preset
  • set foundation position of head/foot
  • stop foundation motion
  • get/set light/outlet
2 Likes

@mhilbush This is fantastic news! I recently moved to 3.4.0 and I was hoping the binding still worked… It does… Been very solid!

My changes to the binding have been merged into the distribution. So sorry for the long wait, but I was quite busy last year and couldn’t get the time to wrap it up. If you’re still on 3.x, unfortunately, the only way to get the released version of the binding is if you’re running a 4.0 snapshot.

I’m planning to do some additional work on the binding.

  • I’m adding some channels to get the sleep-time breakdown for in-bed time, out-of-bed time, restful sleep time, and restless sleep time.

  • I’d also like to add functionality for the foundation (e.g. select preset, adjust head and foot, control outlets, etc.). However, I don’t have a foundation on my bed, so I need someone to run a test version of the binding so that I can see the JSON object(s) returned from the API. As mentioned above, you need to be running 4.0 in order to run the test version.

This was merged today and will be in the next 4.0 snapshot.

@mhilbush I cannot test the foundation either. I will look for the new snapshot and download it.

Be careful which 4.0 snapshot you get. Some of the recent builds are broken. I’m on 3320, which feels pretty solid.

@mhilbush I’ve spun up 4.0.0 build 3331. I do have the foundation and would be happy to get you the JSON objects. Just let me know what you’re looking for and how to get them. Thanks!

That’s great. Thanks!

First uninstall your current sleepiq binding.

Then download this file and put in your addons directory.

https://github.com/mhilbush/openhab-binding-releases/raw/master/sleepiq/org.openhab.binding.sleepiq-4.0.0-SNAPSHOT.jar

This version should function exactly like the binding in the 4.0 distribution. But it also has some calls to the SleepIQ API to get the features and status of the foundation, which it will write to the log file.

I’m looking for the lines that start with the following. Hopefully it won’t throw any exceptions. :crossed_fingers:

Foundation features:

And

Foundation status:

Edit: I don’t think there’s anything sensitive in there, but of course I’ve never seen those JSON responses. So if you’d rather PM it to me, that’s fine.