merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
390 stars 61 forks source link

Fan speeds bug #240

Closed uswong closed 2 years ago

uswong commented 2 years ago

Describe the bug Siri always set my fan speed a step higher; when I ask Siri to set the fan speed to 25%, it set it to 50%, and when I ask Siri to set the fan speed to 50%, it set it to 75% and so on.

Expected behavior The fan has 4 speeds, it should be set to level 1 speed when I ask Siri to set the fan speed to 25%, level 2 speed 50%, and so on.

Your config.json

            {
                "name": "The Standing Fan",
                "ip": "192.168.0.38",
                "token": "847f49d3ed46aabcc6edda4b8c1c15c5",
                "micloud": {
                    "username": "uswong@gmail.com",
                    "password": "xxxxxxxxxxx",
                    "country": "cn",
                    "forceMiCloud": true
                }
            }

I named it The Standing fan. the model of the fan is zhimi.fan.sa1

Debug log Provide a snippet of a debug log when the issue occurs. Ideally with the deepDebugLog property enabled.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

merdok commented 2 years ago

Since your fan does not support stepless fan speed control, the fan levels are used to emulate that behavior. The fan percentage is always set to the highest value per fan level, so setting it per Siri might cause unexpected behavior. Instead of 25% just say 20% or instead of 50% just say 45%, just do not go spot on 😉

uswong commented 2 years ago

Ok, what you suggested certainly works fine. Thanks.