Skip to content

Commit

Permalink
Add support for vane and wideVane settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sethkinast committed Jul 18, 2022
1 parent e1b0048 commit 6b0d54c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion hubitat-mitsubishi-mqtt.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Hubitat Device Driver
* Mitsubishi Heat Pump + MQTT
* v1.0
* v1.1
* https://github.com/sethkinast/hubitat-mitsubishi-mqtt/
*
* Control Mitsubishi heat pumps using HeatPump.cpp via MQTT
Expand Down Expand Up @@ -67,6 +67,8 @@ import groovy.json.JsonOutput
'4': 'high',
'AUTO': 'auto'
]
@Field static List vanePositions = ['AUTO', '1', '2', '3', '4', '5', 'SWING']
@Field static List wideVanePositions = ['<<', '<', '|', '>', '>>', '<>', 'SWING']

metadata {
definition(
Expand All @@ -80,7 +82,12 @@ metadata {
capability 'Initialize'
capability 'Thermostat'

attribute 'vane', 'enum', vanePositions
attribute 'wideVane', 'enum', wideVanePositions

command 'dry'
command 'vane', [[name: 'Position*', type: 'ENUM', constraints: vanePositions]]
command 'wideVane', [[name: 'Position*', type: 'ENUM', constraints: wideVanePositions]]
}
}

Expand Down Expand Up @@ -118,6 +125,8 @@ void configure() {
sendEvent(name: 'supportedThermostatFanModes', value: supportedThermostatFanModes)
sendEvent(name: 'supportedThermostatModes', value: supportedThermostatModes)
sendEvent(name: 'thermostatOperatingState', value: 'idle')
sendEvent(name: 'vane', value: 'AUTO')
sendEvent(name: 'wideVane', value: '|')
}

void updated() {
Expand Down Expand Up @@ -262,6 +271,16 @@ void fanAuto() { setThermostatFanMode('auto') }
void fanCirculate() { setThermostatFanMode('circulate') }
void fanOn() { setThermostatFanMode('on') }

void vane(String position) {
sendEvent([name: 'vane', value: position])
publish(['vane': position])
}

void wideVane(String position) {
sendEvent([name: 'wideVane', value: position])
publish(['wideVane': position])
}

void setCoolingSetpoint(BigDecimal setpoint) {
sendEvent([name: 'coolingSetpoint', value: setpoint, unit: getTemperatureUnit()])
String currentMode = device.currentValue('thermostatMode', true)
Expand Down

0 comments on commit 6b0d54c

Please sign in to comment.