tonesto7 / homebridge-smartthings

SmartThings Homebridge Plugin
384 stars 767 forks source link

(BUG) Z-Wave Fan uses wrong fan speed value #412

Closed sd-dlinger closed 3 years ago

sd-dlinger commented 3 years ago

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help!


About Your Setup

Expected Behavior

Tell us what you think should be happening

If I ask siri to turn the fan off (0%), it should set the Z-wave device's "switch" to off and "Fan Speed" parameter to 0, and "Level" parameter to 0. If I ask siri to set fan speed to "low", it should set the Z-wave device's "switch" to on and "Fan Speed" parameter to 1, and/or "Level" parameter to 32. If I ask siri to set fan speed to "medium", it should set the Z-wave device's "switch" to on and "Fan Speed" parameter to 2 and/or "Level" parameter to 66. If I ask siri to set fan speed to "high", it should set the Z-wave device's "switch" to on and "Fan Speed" parameter to 3 and/or "Level" parameter to 100.

Current Behavior

What happens instead of the expected behavior?

If I ask siri to set fan speed to "low", it sets the Z-wave device's "switch" to on "Level" parameter to 33 - this results in the fan speed being set to 2 (medium). This results in the home app showing the 33% level that I requested, but in SmartThings app, it shows "Medium". If I change it to "Low" in SmartThings app, it then reflects as the fan being ON at 0% in the home app, which should not be possible. SmartThings IDE then shows the "Level" at 32% and "Fan Speed" at "1".

It seems like iOS considers exactly 33% to be "low", but Smartthings (or this device) consider 32% to be "low" and anything higher (even 33%) to be "medium". Might be better to set the fan speed (0-3) instead of the "level".

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. Add a Z-wave device with handler "Z-Wave Fan Controller" to SmartThings.
  2. In the Homebridge v2 SmartApp, select the device as a "Fans (3 Speeds)" device.
  3. Use the home app or siri to set the fan to 33% speed or "low".

Context

How has this issue affected you? What are you trying to accomplish? Providing context helps us come up with a solution that is most useful in the real world**

I have an automation to set the fan to "low", and it always ends up being on "medium" after I run the automation. I have to go into the smartthings app and manually decrease it to "low".


Please include a copy of any relevant log output to assist in tracking down the bug

INFO: [Device Event]: (Guest Room Fan) [SWITCH] is off INFO: [Device Event]: (Guest Room Fan) [LEVEL] is 0 INFO: [Device Event]: (Guest Room Fan) [FANSPEED] is 0 NOTICE: Sending Device Command: on | Name: (Guest Room Fan) | DeviceID: (69913479-6d89-4c63-ae8d-00551f2a85fa) | SendToLocalHub: (false) DEBUG: sendDeviceCommand | Response: "" NOTICE: Sending Device Command: setLevel | Value: {"value1":33} | Name: (Guest Room Fan) | DeviceID: (69913479-6d89-4c63-ae8d-00551f2a85fa) | SendToLocalHub: (false) DEBUG: sendDeviceCommand | Response: "" INFO: [Device Event]: (Guest Room Fan) [LEVEL] is 33 INFO: [Device Event]: (Guest Room Fan) [SWITCH] is on INFO: [Device Event]: (Guest Room Fan) [FANSPEED] is 2

--- Home app shows fan is on "low" but it's spinning at medium speed. --- --- Smartthings app shows the fan is on "medium" --- --- I change the speed from "medium" to "low" in Smartthings App ---

INFO: [Device Event]: (Guest Room Fan) [FANSPEED] is 1 INFO: [Device Event]: (Guest Room Fan) [LEVEL] is 32

sd-dlinger commented 3 years ago

This is the device: https://www.amazon.com/gp/product/B06XTKQTTV/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

sd-dlinger commented 3 years ago

Basically this: https://github.com/tonesto7/homebridge-smartthings/commit/41a8e5d85e536b869ef5f8512d1c2a0c0b58a68f

sd-dlinger commented 3 years ago

I just manually applied the fix from that commit and it seems to be working now.