ikaruswill / lovelace-fan-xiaomi

Xiaomi Smartmi Fan Lovelace card with CSS fan animation
Apache License 2.0
74 stars 34 forks source link

Buttons for Buzzer and Ionizer, Levels for LED brightness #90

Open garv3 opened 2 years ago

garv3 commented 2 years ago

Added support for buzzer and ionizer. There will now be additional buttons to toggle the buzzer and ionizer on and off on supported devices. The LED Button will toggle between 0%, 25%, 75% and 100% brightness if the brightness control value is a number.

image

Olegz73 commented 2 years ago

Thanks for you work! But at my dmaker.fan.p9 this card look diferent Снимок
Can you fix it ? i didn't see led brightness and buzzer button. and my fan don't have ionizer function, need off toggle in setup to off it. Buttons angle and timer doesn't work at all (( and can you add a buzzer sound levels ? Standart to loud(( thanks

garv3 commented 2 years ago

So first of all this is just a pull request for the project. It is not implemented yet. If you installed or downloaded the release and did not apply the changes in this pull request, you will see neither the buzzer and ionizer buttons nor the LED brightness.

If you already applied the changes: If your fan does not support ionization, the button will not be shown. Don't worry about that. Does the buzzer support a volume setting? I do not own your fan so I do not know which features it supports exactly. If you can send me a list of all entities belonging to your fan device including the default names their types and allowed values / ranges, I might be able to figure out how to implement the volume setting for the buzzer. The buzzer of the Smartmi Standing Fan 3 does not have a buzzer volume setting. It's just a on/of switch. I think this might be the same on you fan. If so, there is no way to change the volume.

Olegz73 commented 2 years ago

Thank you for the answer. Model of my fan - Xiaomi Smart Tower Fan (dmaker.fan.p9) Thanks for the explaination about buzzer, yes my fan have the same buzzer settings , only on\off. List of all entities: fan

garv3 commented 2 years ago

Okay. So your setup does support the on/off button for the buzzer. LED brightness and ionizer are not supported and will not show in the UI. This means the only difference my changes will make to your card is the buzzer button. But this will only be available when @ikaruswill has merged this pull request into the project an created a new release. You will then have to update the card through HACS (if you installed it that way) or manually. Alternatively you could use the fan-xiaomi.js from my repo, but if you installed the card through HACS it won't be easy to clear the cache so the changes show.

Olegz73 commented 2 years ago

thank you. i install this via HACS. Wait when @ikaruswill create a new release.
But now i open fan-xiaomi.js and didn't see model of my fan dmaker.fan.p9 maybe that's the problem?

garv3 commented 2 years ago

The model of your fan usually does not need to be mentioned in the config. Only special models need their own config if they do not follow the naming scheme. But this is more of a talk to @ikaruswill. I only intended to add the missing features with this pull request - have not been involveld in this project before.

Olegz73 commented 2 years ago

ok. thank you again

garv3 commented 2 years ago

@ikaruswill Did you have a chance to check the changes? If you have any questions, let me know!

faquaresma commented 2 years ago

Hi,

This new feature is in the release 2.10 ?

Thanks

ikaruswill commented 2 years ago

On second thought, we might want to merge the refactor in first as it's relatively complex. Adding more features right away will introduce conflicts that will make the transition much harder.

Here's what I suggest:

How does that sound?

garv3 commented 2 years ago

Okay. Let's take this route.

garv3 commented 2 years ago

So, what about this PR? I am currently using my own forked version of this repo until the features have been implemented. Any ETA?

ian-craig commented 2 years ago

@garv3 sorry for the delay. I think the boilerplate card refactor @ikaruswill mentioned should be stable enough now and we can go ahead with your change. Could you please merge master and send an update to this PR? I'll try to take a look quickly once that comes through.

There have been quite a few changes, so let me know if you run into any issues and I'll be happy to help.