pyvesync icon indicating copy to clipboard operation
pyvesync copied to clipboard

Core 200s - can't switch from sleep to previous speed

Open gmariotti opened this issue 2 years ago • 11 comments

Hi, I'm currently looking at the issue described in https://github.com/home-assistant/core/issues/70420, would you be able to help with it?

What happens is that, if I set the fan speed to 33% (or 1 in your library), enable the preset mode sleep, and then switch back the speed to 33%, nothing happens. The only way is to turn the fan off, turn it on (which puts the speed at 66%) and then lower it to 33%.

I tried to do some debugging of your library and home-assistant/core, and so far I found that:

  • In home-assistant/core, the call to manual_mode returns false, because the fan doesn't have that mode, while the change_fan_speed returns true.
  • The change_fan_speed returns true but no API call from the library is logged. My guess is that the execution is terminated earlier here because the preset change has no effect on the speed field.

gmariotti avatar Aug 12 '22 08:08 gmariotti

Hey, I stumbled upon your issue while looking at the library for another one. I'm developping a custom component to override the core VeSync integration, as it doesn't support humidifier and doesn't seem very active... Can you have a try and let me know whether you get any improvement? https://github.com/vlebourl/custom_vesync

vlebourl avatar Aug 31 '22 07:08 vlebourl

@gmariotti I think I can remove that check for fan speed and it should fix it so that you can set fan speed from sleep mode. I'll make a PR shortly

webdjoe avatar Aug 31 '22 13:08 webdjoe

Hey @vlebourl I didn't have a chance yet to try your custom component, but I'll let you know when I'll do it.

@webdjoe I'm currently using the OS version of Home Assistant, is there any way I can try your PR once it's ready? Or should I just wait for the version bump on Home Assistant side?

gmariotti avatar Aug 31 '22 14:08 gmariotti

@gmariotti Not if you are using the OS version. You can create a testing script in a virtual environment on your computer to check if those calls work as expected. I don't have a Core200S to test myself

webdjoe avatar Aug 31 '22 14:08 webdjoe

@webdjoe I think I can reuse the virtual environment I set up when debugging the issue, so it shouldn't be a problem.

gmariotti avatar Aug 31 '22 14:08 gmariotti

I just added 'manual' mode to the core200s in this branch #144. That should fix it without breaking anything. Please test it out by cloning the branch in a fresh environment. You can just download the branch directly or use the following.

Once you have the virtual environment created and activated, you can install the branch directly with pip:

python -m pip install git+https://github.com/webdjoe/pyvesync.git@core200s-manual-fix

Let me know if it is good to publish

webdjoe avatar Sep 01 '22 03:09 webdjoe

@webdjoe I just looked at your PR, it seems that you added the manual mode to the Classic200S instead of the Core200S

gmariotti avatar Sep 01 '22 07:09 gmariotti

@gmariotti That's embarrassing 😳. This issue actually impacts all air purifiers. I have a 400s that I was able to test with and it should be working now without breaking any prior functionality

webdjoe avatar Sep 01 '22 12:09 webdjoe

Hi @webdjoe, sorry to bother you again on this, is there anything blocking merging https://github.com/webdjoe/pyvesync/pull/144 and getting a new version of the library released?

gmariotti avatar Oct 16 '22 12:10 gmariotti

Merged, I'll upload the package today

webdjoe avatar Oct 16 '22 19:10 webdjoe

Great, thank you @webdjoe 🙏

gmariotti avatar Oct 16 '22 19:10 gmariotti

@webdjoe is there anything blocking the release of the library?

gmariotti avatar Nov 02 '22 17:11 gmariotti

My apologies, just the lack of time, uploaded to pypi version 2.1.0!

webdjoe avatar Nov 03 '22 01:11 webdjoe

My apologies, just the lack of time, uploaded to pypi version 2.1.0!

Can you also make a github release of the 2.1.0 ? There are lots of places that reference the github releases.

sdrapha avatar Nov 03 '22 02:11 sdrapha

You got it, released and tagged!

webdjoe avatar Nov 03 '22 02:11 webdjoe