Alexa Skill - on/off command returns error for a switch device with leveling feature

Hi @ilkeraktuna!

I´m facing the same problem, but I don´t have the skills to code. I guess I should use the string you used in the section bellow, but I don´t know how. Could you help me?

def off() {

  • if(logEnable) log.info "open()"*
  • def currentLevel = device.currentValue("level")*
  • if (currentLevel == 100) {*
  •   sendEvent(name: "windowShade", value: "open")*
    
  •    return*
    
  • }*
  • sendTuyaCommand("0104", "00", "0100")*
    }

def on() {

  • if(logEnable) log.info "close()"*
  • def currentLevel = device.currentValue("level")*
  • if (currentLevel == 0) {*
  •   sendEvent(name: "windowShade", value: "closed")*
    
  •    return*
    
  • }*
  • sendTuyaCommand("0104", "00", "0102")*

Thanks in advance for any help or tip!

Download the Hubitat app