DeeeeLAN / homebridge-sleepiq

SleepIQ Homebridge plugin
18 stars 10 forks source link

Foot warmer API in flex fit 3 base #22

Closed rvrolyk closed 3 years ago

rvrolyk commented 4 years ago

Hi there,

I don't actually use your plugin but it was referenced in a Hubitat thread and your note of using a proxy on Android made me realize I can sniff out what the foot warmer API is. Since I notice it's in your future enhancements, I wanted to share. Please see https://community.hubitat.com/t/sleepiq-sleep-number/15053/83?u=rvrolyk for the details and let me know if you have any questions I can help answer.

DeeeeLAN commented 3 years ago

Thanks, I might be able to use that!

DeeeeLAN commented 3 years ago

@rvrolyk Do you have to set a timer, or can you leave it on?

rvrolyk commented 3 years ago

As far as I can tell, a timer is required.

DeeeeLAN commented 3 years ago

Is there a tempRight and a tempLeft field in the same dataset, or are they separate calls?

DeeeeLAN commented 3 years ago

Initial attempt added in 5b72427.

rvrolyk commented 3 years ago

I think that won't work as written. The API SleepNumber exposes is a bit clunkier... the status call you have works but the request on line 573 needs to be structured like:

{
  _k: key,
 footWarmingTempRight: tempRight,
 footWarmingTimerRight: timerRight,
 footWarmingTempLeft: tempLeft,
 footWarmingTimerLeft: timerLeft
}

I tested and though their app only ever sends a single side at a time, the API will let you send all four parameters

DeeeeLAN commented 3 years ago

I wish they could have some consistency in their different endpoints. Can you try with the style I have written? I am curious if it will work anyway, since they use that style for so many of their requests. Maybe we will get lucky and they accept multiple styles.

rvrolyk commented 3 years ago

Unfortunately that fails with a BadRequest response. Agree it would be nice if they were more consistent... though I'd settle for a fully supported public API :)

On Fri, Sep 18, 2020 at 4:32 PM DeeeeLAN notifications@github.com wrote:

I wish they could have some consistency in their different endpoints. Can you try with the style I have written? I am curious if it will work anyway, since they use that style for so many of their requests. Maybe we will get lucky and they accept multiple styles.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DeeeeLAN/homebridge-sleepiq/issues/22#issuecomment-695127926, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHIJVF2VV7OKW6LOX7APNDSGPUZ3ANCNFSM4OHEMKAQ .

DeeeeLAN commented 3 years ago

Okay, I just pushed an update that should work. We will see once somebody tests it, but I believe it should follow the correct format now.