merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
364 stars 62 forks source link

Change fan control to be a slider instead of multiple switches #514

Closed michaelflux closed 9 months ago

michaelflux commented 10 months ago

Currently if fan speed controls are enabled, they show up as independent switches for each fan speed. While functional, is far from ideal user experience.

Proposing merging the independent speed switches into a single standard fan speed controller as is done with all HomeKit enabled fans.

This can be done either with a percentage based fan speed controller as was done in this plugin https://github.com/torifat/xiaomi-mi-air-purifier

Or alternatively with incremental speed adjustments as done here https://github.com/AMoo-Miki/homebridge-tuya-lan/pull/148#issuecomment-575882661

Either of these solutions would be significantly more elegant and user friendly than having multiple independent single purpose switches.

merdok commented 10 months ago

You would need to provide at least the model of the device which you are talking about. Some devices simply does not support stepless fan level control, in that case an emulation is needed, this is not being done automatically as in general mapping a 4-5 level value to a 0-100% is a bad idea and does not really make sense.

michaelflux commented 10 months ago

I can't speak for all Mi devices with fans, my hands on experience is limited to just their Purifiers (3C, 3H, Pro H, 4 Pro etc) and standing fans but with those devices even if the hardware controls expose only the options of;

Going as far back as 2019, their oscillating floor fans which exposed their controls to HomeKit were using a standard slider;

With their more recent products such as the P1 Air Purifier which has native HomeKit integration, their preferred method (based on Apple's UI recommendations) of controlling the fan through HomeKit is also a standard slider.

https://www.youtube.com/watch?v=jeO_sW_Kpr0

Virtually every other fan manufacturer sticks to same standard practice - Meross , Airversa, Coway, Jya, Molekule etc.

I think the best possible implementation would be a card;

  1. Standard fan slider
  2. After scrolling down, a toggle (not switch) for 'auto' mode
  3. Below that, a toggle for 'night' mode
  4. Below that a toggle for 'fav' mode'

I fully understand why the current implementation is done the way it is and it does function as it was intended to function, but what I'm saying that it would be better to modify it to align with standard HomeKit interface practices which would make it far more user friendly.

merdok commented 10 months ago

The standard HomeKit interface for handling fan levels are buttons. If you did see a slider before then either the fan did support stepless fan control or you used a plugin which did a mapping.

The home app ui is unfortunately quite limited and what manufactures do in their own apps is up to them.

You still did not specify the device which you are using so I am still not sure about what device we are talking about and how to help you...

WindGiang commented 10 months ago

I'm using demaker.fan.p5, a fan that supports stepless speed control in the MiJia app, and after the plugin is mapped to the homekit, it becomes a 4-level speed control, even though it has a stepless speed control slider.

merdok commented 10 months ago

@WindGiang the dmaker.fan.p5 is an older miio device and only supports a limited amount of features over the miot protocol, as for some reason xiaomi did not decide to expose them all. over Stepless fan control is one of the features which this device does not support over the miot protocol.

michaelflux commented 10 months ago

@merdok as I specified earlier, my experience was primarily with Mi purifiers including 3C, 3H, Pro H and 4 Pro -- not sure what the exact identifiers are for them.

To clarify re standard HomeKit fan interface. I'm not talking about a generic Fan/Light/Switch toggle which applies to any switch, relay or plug.

What I'm specifically referring to is third party fans (including Xiaomi) which have HomeKit integration and that when those devices are added to Apple's Home app, they all use a slider - not within their own apps, but within the Home app.

You are correct in saying that all these third party devices do some degree of mapping - be it fans, lightbulbs or whatever else. My argument is simply that any end user would agree that a single standard slider is far more usable than 3-5 independent switches that act as radio buttons and make it impossible to control the device in any standard way (e.g. hey Siri set fan to 30%).

merdok commented 10 months ago

I am not sure how I can help you as you still did not provide the device which we are talking about. As already stated the emulation does exists in this plugin but it hast to be enabled on a device basis and is not happening automatically.

michaelflux commented 10 months ago

It feels like we're talking past each other here.

3C, 3H, Pro H and 4 Pro

Either one. For the sake of the example here, let's take 3H as it's the most popular of the models mentioned.

Edit ---

After manually entering the specific device model (zhimi.airpurifier.mb3) under advanced settings and turning off the fan level service, it appears like the exact thing I was asking for has appeared. 🫡

merdok commented 10 months ago

I mean I guess that you have an issue with a specific device, so in order for me to help you out I need to know what device you have, by just choosing a random device will not bring anything.

I already stated that I will not enable that feature for all devices per default because that is misleading to the users, especially because then they might think their devices support certain features which in fact they do not. As also already stated there is an emulation option available within the plugin which certainly makes what you expect, you need to tell what actual device you have so I can see what it actually supports and how I can help you.

michaelflux commented 9 months ago

Closing issue as only occurs when device model is not filled, otherwise functions as expected.

merdok commented 9 months ago

Yes, that is why I said that it is not happening automatically and the device model is needed. But good that it is sorted out now👍

michaelflux commented 9 months ago

Yes, that is why I said that it is not happening automatically and the device model is needed. But good that it is sorted out now👍

My mistake for misunderstanding what you meant in the original reply. My assumption was that you were simply asking which devices I was using (which is why was giving a list of various ones I was using), whereas what you meant was that the device model was needed for the plugin to function as intended. 👍