Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

(BUG) Fan reads 0% while running #326

Open
3 tasks done
danielhopkins opened this issue May 1, 2020 · 5 comments
Open
3 tasks done

(BUG) Fan reads 0% while running #326

danielhopkins opened this issue May 1, 2020 · 5 comments
Assignees
Labels
bug Something isn't working as expected

Comments

@danielhopkins
Copy link

(Moved from the old project)

  • That OAuth is Enabled for the SmartApp under the IDE.
  • The SmartApp and Device Handler are using the latest code available.
  • That Both the SmartApps and Device Handlers have been Published for You in the IDE.
    About Your Setup

How many devices are detected?: 9
Mobile App Version(Not required): iOS 13.5
SmartApp Version: 2.3.3
Device Handler Version: ?? not sure what this is
Homebridge Version: 1.0.4
NodeJS Version: 12.6.1

Expected Behavior

I have a modern forms house fan connected to smartthings and then bridged to homekit through homebridge. While the fan can be turned on and off through the app it always says that it’s at 0% speed.

Current Behavior

Always shows as 0% speed.

Context

Trying to control the fan in my living room.

I’m not sure at which logs to look at? Homebridge? Smarthings?

Sorry this isn’t that good of information, I’m not sure where to start debugging this.

@tonesto7 tonesto7 transferred this issue from tonesto7/homebridge-smartthings-v2 Jul 10, 2020
@tonesto7 tonesto7 added the bug Something isn't working as expected label Jul 10, 2020
@jonnyborbs
Copy link
Contributor

jonnyborbs commented Aug 16, 2020

I've got this same issue and it seems to be an issue with alignment of the FANSPEED and LEVEL settings.

I control my 3-speed fans using both Alexa and SmartThings currently and the default DTH in SmartThings sets the steps as follows:

FANSPEED 0 = LEVEL 0
FANSPEED 1 = LEVEL 32
FANSPEED 2 = LEVEL 66
FANSPEED 3 = LEVEL 100

The problem is that the homebridge-SmartThings plugin sets a threshold of FANSPEED 1 = LEVEL 33

This means that at the DTH's FANSPEED 1 setting, the LEVEL is 32 and HomeBridge/HomeKit register it as a FANSPEED 0 instead, hence showing at 0% while still spinning.

It also means that if you set the fan's speed to "LOW" (FANSPEED 1) in HomeKit, the DTH will get a LEVEL setting of 33 and actually be running at "MEDIUM" (FANSPEED 2)

Should be easily fixed... would love to see it happen!

@jfsteele
Copy link

Saw similar (would set to "low" via Home, it sends 33, and actually sets the fan to "medium"). This fixed it:
file ST_Transforms.js:
in fanSpeedLevelToInt:
lines 471 and 473: change 33 to 34

file ST_DeviceCharacteristics.js:
line 269: if (_accessory.hasDeviceFlag('fan_3_spd')) spdSteps = 33
change 33 to 32

Everything seems to be happy with those tweaks. It seems that there's 2 issues, 1) ST_Transforms says that 33 is "medium" (hence the change from 33 to 34), and 2) the 3-speed step is 33, which seems to trigger my GE fans to go to medium. I noticed that ST sends 32, so adjusted the step. All 3 speeds work correctly now.

@jonnyborbs
Copy link
Contributor

Saw similar (would set to "low" via Home, it sends 33, and actually sets the fan to "medium"). This fixed it:

file ST_Transforms.js:

in fanSpeedLevelToInt:

    lines 471 and 473: change 33 to 34

file ST_DeviceCharacteristics.js:

line 269: if (_accessory.hasDeviceFlag('fan_3_spd')) spdSteps = 33

    change 33 to 32

Everything seems to be happy with those tweaks. It seems that there's 2 issues, 1) ST_Transforms says that 33 is "medium" (hence the change from 33 to 34), and 2) the 3-speed step is 33, which seems to trigger my GE fans to go to medium. I noticed that ST sends 32, so adjusted the step. All 3 speeds work correctly now.

That's fantastic! I wonder if you open a PR with these changes if @tonesto7 would just merge it? I'd prefer not to branch off of the default repo if I could avoid it, to keep updates current going forward.

@jfsteele
Copy link

Thanks for handling the PR. Family emergency, wasn't where I could.. Hope he accepts it!

@jonnyborbs
Copy link
Contributor

Thanks for handling the PR. Family emergency, wasn't where I could.. Hope he accepts it!

Of course! Hope all is well, I just happened to have the time to make the commits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants