DeeeeLAN / homebridge-sleepiq

SleepIQ Homebridge plugin
18 stars 10 forks source link

[Bug] Sleep number must be in increments of 5 else bed stops adjusting #15

Closed 400HPMustang closed 3 years ago

400HPMustang commented 4 years ago

With the latest homekit/iOS updates it's harder to manually adjust the bed sliders in the home app. If you stop on a number that's not a multiple of 5 as the bed is inflating/deflating the bed will just stop adjusting.

Example: Bed is inflated to 100%, adjust the slider to 53% bed will stop at whatever the current firmness is, in my case it was at 70%.

Solution: Is it possible to force increments of 5 in the homekit slider? or in the Sleep-IQ plugin round to the nearest 5% increment?

DeeeeLAN commented 4 years ago

That's really odd because it should already be forcing the increments of 5 (see here). I haven't updated to iOS 13 yet, so I can't test it myself, but I will take another look once I update. For now, you probably just need to get accurate with your slider, or use Siri.

DeeeeLAN commented 4 years ago

If you turn on debugging, you could double check what values are getting sent to the bed

400HPMustang commented 4 years ago

just did a quick test with debugging. Set the right side to 100 with Siri, then set it down to 53% with the slider, bed stopped at 70% and then I set it back to 45% with Siri

log.txt

DeeeeLAN commented 4 years ago

Interesting, so it looks like it actually drops down to 60 before re-inflating to 70. I think it must be receiving those changes out of order or something, because when you move the slider by hand it sends a bunch of changes. I think the way forward would be to delay sending a change for a couple seconds to let the slider stabilize. It wouldn't be perfect but it would probably be good enough.

400HPMustang commented 4 years ago

Sounds like a good plan to me. That way if I don't nail it first try on the slider, I have a one or two seconds to get it to the correct spot. Maybe make a config option?

DeeeeLAN commented 3 years ago

I added a debounce that is configurable but defaults to 2 seconds. Let me know if you have any issues.