pschroeder89 / homebridge-levoit-humidifiers

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

Add a fan for the mist level control and have the slider in the humidifier for the auto set level #6

Closed xuaninbox closed 2 years ago

xuaninbox commented 2 years ago

Is your feature request related to a problem? Please describe: No, but for 200S I'm seeing 9 level of mist control

Describe the solution you'd like: Have the mist level control exposed as a separate item and allow change to auto set level.

pschroeder89 commented 2 years ago

Hey @xuaninbox I believe I fixed the mist control issue. The Dual200S should now only try to set levels 1-2. Could you confirm using 1.3.0-beta2?

I will leave this ticket open though until I add the auto set humidity level.

xuaninbox commented 2 years ago

tried with beta3 and it looks correct with 50% being low and 100% being high for 200s, but still able to change in 10% interval for the slider, could we also change the step value base on the model?

pschroeder89 commented 2 years ago

@xuaninbox Please try out 1.3.0-beta4. We now calculate the step levels in the slider by 100 / number of mist levels. So now you should just have 33%, 67%, and ~100% options.

pschroeder89 commented 2 years ago

Made some updates here, as the above logic wasn't complete enough and led to some bugs. Please test 1.3.0-beta8 instead.

xuaninbox commented 2 years ago

It seems the mist lv 1 is 1% and mist lv2 is 2% now with beta 8

xuaninbox commented 2 years ago

perhaps it might be simpler to remove the slider from the humidifier and add a fan controller for mist level

pschroeder89 commented 2 years ago

This is how mine is working right now with beta8: https://user-images.githubusercontent.com/10761540/146819302-46c540ca-6557-4f67-88df-4f84404cc25a.MOV

pschroeder89 commented 2 years ago

Give beta 9 a shot, we now explicitly set the min and max values, so it shouldn't try to use 100 as the max value in your case

pschroeder89 commented 2 years ago

As for exposing the mist level as a fan control, I prefer a slider for Humidify. I plan on using the Auto slider as a way to set the auto humidity level.

If you think there are other benefits to using a fan control, I'm all ears, though

xuaninbox commented 2 years ago

beta 9 looks good~ i do have to clear the cache for it to function correctly~

humidity slider for auto mode is defiantly good and I guess the only reason for fan control is the description in the app will be more clear and using Siri it make more sense (50% as in mist level 1 vs 50% as in target humidity level).

but again if levoit come out with a model that actually have a fan then it might be an issue.

pschroeder89 commented 2 years ago

I hadn't really considered Siri, good point. This got auto-closed on the last merge, will leave open to look into the fan control.

pschroeder89 commented 2 years ago

@xuaninbox I've added the fan control for Mist Level (manual mode) and the Humidifier slider now sets the Target Humidity (Auto mode). If you have time, would you mind testing 1.5.0-beta5? Thanks!

xuaninbox commented 2 years ago

Awesome~ just did some testing, a couple things I have noticed:

  1. Dual 200s does not have sleep mode so I think we may need to add this to config for model types to hide it.
  2. It looks like the bottom selector ( auto manual off) is gone and we can change target and mist level at the same time, might be a bit confusing. Maybe we can do the old way with a selector at the bottom and have the slider be target or mist level based on the selector. I think this will match the VeSync app nicely.
  3. Also looks like mist level can be 0% may be the min can be the lowest level of mist? Like 50% for 200s

Thanks again :)

xuaninbox commented 2 years ago

also one more issue I have notice is the target mist level doesn’t no match the VeSync app, I guess the mist level is between 30% to 80% and not 0 to 100

pschroeder89 commented 2 years ago

Thanks @xuaninbox!

  1. I fixed this so Dual 200s doesn't have a sleep switch. This is in 1.5.0-beta8.
  2. HomeKit does a poor job with this UI in my opinion. In Auto mode, the slider can not be read from. Only in Humidify or Dehumidify modes can the value be applied to the device. This is why I removed the Auto mode from the switcher, which gives us the single Power switch (Humidify / Off). I agree that having the Mist Level and Target Humidify sliders can be confusing, but it's the best way I can find to expose both controls in the UI. I've added some clarifications to the README of what each of the sliders do: https://github.com/pschroeder89/homebridge-levoit-humidifiers/pull/15/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R20
  3. Since this is a fan service in HomeKit, it must have an Off value. If I tell HomeKit to use the lowest mist level as the lowest level, the UI displays the Fan as "Off" when it would actually at Level 1. That being said, your Mist slider should have 0(off) -> 50(level 1) -> 100 (level 2). Is that not the way it looks?
  4. This is another limitation of HomeKit. We can't force a range between a percentage. You did point out a bug though, where 1.5.0-beta5 was using 1-80 instead of 30-80 as possible Target Humidities. I also made it where the Target Humidity is between 1-100, but if the values sent are under 30, we send 30, and if they are over 80, we just send 80.
xuaninbox commented 2 years ago

Thanks for the explanation!! It make sense now~ just test it and everything looks good!!

pschroeder89 commented 2 years ago

Awesome! Thanks so much for testing and raising this issue @xuaninbox! It led to a lot of good refactor work.