Closed ireun closed 3 weeks ago
Few commits that have implemented that platform:
https://github.com/esphome/esphome/pull/6310 https://github.com/esphome/esphome-docs/pull/3655 https://github.com/esphome/esphome/pull/6112
For now it seems that everything works, with the exception of presets auto, night, manual being lost in HA after turning the fan off and on again .
sorry ive been very busy. i'll try to have a look at it in the following days
For me, it doesn't sync the fan percentage to the actual value at all but having this setup as a fan entity is the right way in general.
It works but the fan speed slider has no effect. Does it work for you?
Have you set the mode to manual?
I guess so. Clicked the fan and moved the slider up and down - nothing.
still nothing...
Will check if the code here is the same as mine, or weather I have made any changes. Though it works for me..
only looked at it from hi up in the sky but after
XiaomiPurifierFan->speed = atof(val)+1;
isn't there supposed to be a
call.perform();
?
I've found some differences between what I use in HA and what was in this draft, could You try that?
it's on now but one suggestion - whenever the slider is moved just change the preset automatically to manual in this case you do not need to firstly change the preset and then move the slider
I've tried to do that, but I wasn't able to achieve that, since than I have not worked on it, maybe @jaromeyer could figure it out ;)
Yeah that'd be great. Right now if you're in let's say the Medium preset and change the percentage slider, the unit itself stays in that preset and doesn't actually change the speed and on Home-Assistant it goes to an unknown/bogus state for the mode selection
Before adjusting %:
After adjusting % from the medium preset:
on_speed_set:
- lambda: |-
auto c = static_cast<MiPurifier *>(mipurifier);
c->set_mode("manual");
- delay: 1s
- lambda: |-
auto c = static_cast<MiPurifier *>(mipurifier);
c->set_manualspeed((int)x-1);
I've changed the on_speed_set function to set manual mode every time I change the speed. There needed to be a delay so the send_buffer can loop twice.
Thanks @Xploder! I've swapped these lambada, so first the speed is set and than the mode, to prevent going it to a previous speed for that split second :)
Let me know if it works okay for you this way
Thanks! Works fine within the usual limitations of it not being able to read current mode later etc. But now we're at least able to easily set percentage from Alexa from any mode!
works great. like this, enough for getting things done
Finally got to test your PR and it works great! Thanks @ireun
https://esphome.io/components/fan/template This allows to use https://github.com/denysdovhan/purifier-card