Comments (2)
I made some modifications to your code in order the fan speed slider to work with Air Purifer 3H
def calFanLevel(speed){
if(speed == 0){
return 0
}else if(speed == 1){
return 33
}else if(speed == 2){
return 66
}else if(speed == 3){
return 100
}else if(speed == 4){ // - - - - - - - - - - - new entry of silent mode
return -1
}
}
// - - - - - - - - - - - modifications to support auto and silent modes
def setFanSpeed(speed){
log.debug "setFanSpeed " + speed
def level = calFanLevel(speed)
if(level > 0){
setLevel(level)
}else if (level == 0) {
setModeAuto()
}else if (level < 0) {
setModeSilent()
}
//sendEvent(name:"fanSpeed", value: level)
}
def setLevel(level){
def speed = Math.round(level/6.25)
// if(model == "MiAirPurifier3"){
// level = Math.round(stf/7.14)
// }
log.debug "setLevel >> " + level + " >> " + speed
// - - - - - - - - - - - modifications to support auto and silent modes
if(level == 33){
speed = "low"
level = 1
}else if(level == 66){
speed = "medium"
level = 2
}else if(level == 100){
speed = "high"
level = 3
}
if(model != "MiAirPurifier"){
def body = [
"id": state.id,
"cmd": "mode",
"data": speed
]
def options = makeCommand(body)
sendEvent(name:"fanSpeed", value: level)
sendCommand(options, null)
}
}
def setModeAuto(){
log.debug "setModeAuto >> ${state.id}"
def body = [
"id": state.id,
"cmd": "mode",
"data": "auto"
]
def options = makeCommand(body)
sendEvent(name:"fanSpeed", value: 0) // - - - - - - - - - - - entry for updating DHT of auto mode
sendCommand(options, null)
}
def setModeSilent(){
log.debug "setModeSilent >> ${state.id}"
def body = [
"id": state.id,
"cmd": "mode",
"data": "silent"
]
def options = makeCommand(body)
sendEvent(name:"fanSpeed", value: 4) // - - - - - - - - - - - entry for updating DHT of silent mode
sendCommand(options, null)
}
I have’t access to custom capabilities, so in silent mode (currently setFanSpeed 4) the label appears as MAX and for auto mode (currently setFanSpeed 0) the label apperas as off.
Can you please integrate this modifications to your repo code?
Also the dimmer slider should be updated to off->dimmed->bright, to supported by Air purifier 3H
from mi_connector.
Hello.
I saw that you released a new DTH for air purifier. (devicetypes/streamorange58819) (thanks so much btw..)
I test it out and I have faced some issues.
Do you need any feedback on anything?
from mi_connector.
Related Issues (20)
- migration from Smartthings to Hubitat HOT 1
- Unsupported Air Purifier model HOT 7
- capability issues on Alexa control - Air Purifier
- Air Purifier 3H doesn't update the data
- I can't log to the Mi connector
- Xioami Fan 1c / dmaker.fan.1c
- zhimi.fan.v4 support?
- Unsupported Xiaomi HUB lumi.gateway.mgl03
- lywsd03mmc custom firmware
- This viomi.vacuum.v19 is not supported now
- Xiaomi Plug (lumi.plug) Not Updating Power Load
- Mi Air Fryer support HOT 1
- air fryer support
- Mi Smart Standing Fan 2 (dmaker.fan.p18)
- Xiaomi Air Purifier 4 Pro
- qnap 268
- Improvement for DB Connections
- How to use Mi Connector in SmartThings 2023 new interface?
- Mi Connector makes Mi Air Purifier non-responsive
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mi_connector.