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

(BUG) 4-Speed Fan #418

Open
3 tasks done
damienemmerson opened this issue Feb 23, 2021 · 0 comments
Open
3 tasks done

(BUG) 4-Speed Fan #418

damienemmerson opened this issue Feb 23, 2021 · 0 comments
Assignees
Labels
bug Something isn't working as expected

Comments

@damienemmerson
Copy link

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!

  • 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?: 23
  • Mobile App Version(Not required):
  • SmartApp Version: 2.3.3
  • Device Handler Version: n/a
  • Homebridge Version: 1.3.0
  • NodeJS Version: 12.15.0

Expected Behavior

  1. When fan is set to high, device command setFanSpeed should have a value of 4.
  2. When fan speed is set to low / med /med-high / high, the tile in the home app should report 25% / 50% / 75% / 100% respectively.

Current Behavior

  1. setFanSpeed command is sent with a value of 3.
  2. in all cases the correct percentage is shown momentarily before changing to 0%. This is similar to issue (BUG) Fan reads 0% while running #326 but for the 4-speed fan.

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 Device Handler to Smartthings IDE
metadata {
	definition(name: "Fan Controller v3.0", namespace: "Damien Emmerson", author: "Damien Emmerson", vid: "generic-fan", ocfDeviceType: "oic.d.fan") {
	capability "switch"
        capability "Actuator"
        capability "Fan Speed"
        
        command "setStatus"
	}

	simulator {
	}
    
    preferences {
            input "defaultOnSpeed", "number", title: "Default On Speed", description: "Set the default On speed", defaultValue: 4, range: "1..4", required: false, displayDuringSetup: false
    }
}

def parse(String description) {
	log.debug(description)
}

def setFanSpeed(speed) {
	sendEvent(name: "fanSpeed", value: speed, displayed: true)
    if (speed == 0) {
    	sendEvent(name: "switch", value: "off", displayed: true)
    } else {
    	sendEvent(name: "switch", value: "on", displayed: true)
    }
}

def on() {
    setFanSpeed(defaultOnSpeed ?: state.defaultOnSpeed ?: 4)
}

def off() {
    setFanSpeed(0)
}

def setStatus(type, status) {
	sendEvent(name: type, value: status)
}
  1. Create a simulated fan device using the device handler above.
  2. Add the simulated fan device to the 4-speed fan category in the homebridge smartapp
  3. [Issue 1] Turn the fan on to high in the Home app. The fan turns on to med-high. See log output below.

Log output:
NOTICE: Sending Device Command: on | Name: (Simulated Fan) | DeviceID: (9c001bc6-6f3b-4ffd-bfb1-93f9a0c0d709) | SendToLocalHub: (false)
NOTICE: Sending Device Command: setFanSpeed | Value: {"value1":3} | Name: (Simulated Fan) | DeviceID: (9c001bc6-6f3b-4ffd-bfb1-93f9a0c0d709) | SendToLocalHub: (false)

  1. [Issue 2] Set the fan so any speed in the home app. The fan will change speed but fan speed slider in the Home App will change to 0%.

Context

The issue means you can never turn a fan on to high.
It also means that the reported speed in the Home app is different to that in Smartthings.

@damienemmerson damienemmerson added the bug Something isn't working as expected label Feb 23, 2021
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

2 participants