pschroeder89 / homebridge-levoit-humidifiers

Levoit Humidifiers Plugin for Apple HomeKit via Homebridge
Apache License 2.0
70 stars 9 forks source link

Add Support for Classic200S #7

Closed wphillips82 closed 2 years ago

wphillips82 commented 2 years ago

Can you add support for the Classic 200S

pschroeder89 commented 2 years ago

I don't own one, so I'd need to know some info about it. How many mist levels does it have? Does it have auto mode?

pschroeder89 commented 2 years ago

Hey @wphillips82, I did a quick google search and looks like it has 3 mist levels and auto mode. I've created 1.3.0-beta2 that adds support, so please test it out and let me know if things work as expected. Thanks!

wphillips82 commented 2 years ago

Wow that was quick. Just got to test it and it actually has 9 mist levels and currently when I set Apple Home to 100% the Vesync app only shows mist level 3 out of 9.

On, Off and Auto work as expected.

pschroeder89 commented 2 years ago

@wphillips82 I adjusted the mist level for the Classic 200s to 9 levels instead of 3, sorry bout that. I also adjusted some logic around how the slider values are calculated per humidifier, so you should now see the slider increment by ~11% instead of 10%, since we now calculate it by (100 / the the number of mist levels).

This is all in 1.3.0-beta4 if you wouldn't mind re-testing the mist levels for the 200s. Thanks in advance!

wphillips82 commented 2 years ago

Setting the mist level works correctly now but there still appears to be a issue when Apple Home is reading the mist level back from the humidifier for just mist level 1, 2, 3 and 4.

Example I set the mist level to 22% in Home Go to vesync app and it shows level 2 go back to Home and now it shows 11% Go back to vesync and it still shows level 2

For mist level 1, Home set at 11% reads it back at 0% For mist level 2, Home set at 22% reads it back at 11% For mist level 3, Home set at 33% reads it back at 22% For mist level 4, Home set at 44% reads it back at 33%

This doesn't happen for mist level 5-9 For mist level 5, Home sets and reads it back at 56% For mist level 6, Home sets and reads it back at 67% For mist level 7, Home sets and reads it back at 78% For mist level 8, Home sets and reads it back at 89% For mist level 9, Home sets and reads it back at 100%

pschroeder89 commented 2 years ago

Yup, I saw that too after messing around for a while. The problem is I tried to fix something for the Dual200s at the same time, which complicated how the percentages and mist levels were calculated.

I've pushed 1.3.0-beta8 1.3.0-beta9 that simplifies the mist level logic. I have tested it a bit and haven't seen any error logs (which I was getting infrequently in previous versions), and the issue you described above isn't happening for me.

Please test if you have time. I'll continue to test on my end, too.

wphillips82 commented 2 years ago

beta9 works as expected. Tested all mist levels and switched back and forth between Homekit and Vesync and everything is correct now. Thanks alot for getting this added.