1
1
/**
2
- * Copyright 2014 SmartThings
2
+ * Copyright 2015 SmartThings
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
5
* in compliance with the License. You may obtain a copy of the License at:
@@ -15,18 +15,48 @@ metadata {
15
15
// Automatically generated. Make future change here.
16
16
definition (name : " Simulated Thermostat" , namespace : " smartthings/testing" , author : " SmartThings" ) {
17
17
capability " Thermostat"
18
+ capability " Relative Humidity Measurement"
18
19
19
20
command " tempUp"
20
21
command " tempDown"
21
22
command " heatUp"
22
23
command " heatDown"
23
24
command " coolUp"
24
25
command " coolDown"
25
- command " setTemperature" , [" number" ]
26
+ command " setTemperature" , [" number" ]
26
27
}
27
28
28
- tiles {
29
- valueTile(" temperature" , " device.temperature" , width : 1 , height : 1 ) {
29
+ tiles(scale : 2 ) {
30
+ multiAttributeTile(name :" thermostatMulti" , type :" thermostat" , width :6 , height :4 ) {
31
+ tileAttribute(" device.temperature" , key : " PRIMARY_CONTROL" ) {
32
+ attributeState(" default" , label :' ${currentValue}' , unit :" dF" )
33
+ }
34
+ tileAttribute(" device.temperature" , key : " VALUE_CONTROL" ) {
35
+ attributeState(" default" , action : " setTemperature" )
36
+ }
37
+ tileAttribute(" device.humidity" , key : " SECONDARY_CONTROL" ) {
38
+ attributeState(" default" , label :' ${currentValue}%' , unit :" %" )
39
+ }
40
+ tileAttribute(" device.thermostatOperatingState" , key : " OPERATING_STATE" ) {
41
+ attributeState(" idle" , backgroundColor :" #44b621" )
42
+ attributeState(" heating" , backgroundColor :" #ffa81e" )
43
+ attributeState(" cooling" , backgroundColor :" #269bd2" )
44
+ }
45
+ tileAttribute(" device.thermostatMode" , key : " THERMOSTAT_MODE" ) {
46
+ attributeState(" off" , label :' ${name}' )
47
+ attributeState(" heat" , label :' ${name}' )
48
+ attributeState(" cool" , label :' ${name}' )
49
+ attributeState(" auto" , label :' ${name}' )
50
+ }
51
+ tileAttribute(" device.heatingSetpoint" , key : " HEATING_SETPOINT" ) {
52
+ attributeState(" default" , label :' ${currentValue}' , unit :" dF" )
53
+ }
54
+ tileAttribute(" device.coolingSetpoint" , key : " COOLING_SETPOINT" ) {
55
+ attributeState(" default" , label :' ${currentValue}' , unit :" dF" )
56
+ }
57
+ }
58
+
59
+ valueTile(" temperature" , " device.temperature" , width : 2 , height : 2 ) {
30
60
state(" temperature" , label :' ${currentValue}' , unit :" dF" ,
31
61
backgroundColors :[
32
62
[value : 31 , color : " #153591" ],
@@ -39,51 +69,51 @@ metadata {
39
69
]
40
70
)
41
71
}
42
- standardTile(" tempDown" , " device.temperature" , inactiveLabel : false , decoration : " flat" ) {
72
+ standardTile(" tempDown" , " device.temperature" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
43
73
state " default" , label :' down' , action :" tempDown"
44
74
}
45
- standardTile(" tempUp" , " device.temperature" , inactiveLabel : false , decoration : " flat" ) {
75
+ standardTile(" tempUp" , " device.temperature" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
46
76
state " default" , label :' up' , action :" tempUp"
47
77
}
48
78
49
- valueTile(" heatingSetpoint" , " device.heatingSetpoint" , inactiveLabel : false , decoration : " flat" ) {
79
+ valueTile(" heatingSetpoint" , " device.heatingSetpoint" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
50
80
state " heat" , label :' ${currentValue} heat' , unit : " F" , backgroundColor :" #ffffff"
51
81
}
52
- standardTile(" heatDown" , " device.temperature" , inactiveLabel : false , decoration : " flat" ) {
82
+ standardTile(" heatDown" , " device.temperature" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
53
83
state " default" , label :' down' , action :" heatDown"
54
84
}
55
- standardTile(" heatUp" , " device.temperature" , inactiveLabel : false , decoration : " flat" ) {
85
+ standardTile(" heatUp" , " device.temperature" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
56
86
state " default" , label :' up' , action :" heatUp"
57
87
}
58
88
59
- valueTile(" coolingSetpoint" , " device.coolingSetpoint" , inactiveLabel : false , decoration : " flat" ) {
89
+ valueTile(" coolingSetpoint" , " device.coolingSetpoint" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
60
90
state " cool" , label :' ${currentValue} cool' , unit :" F" , backgroundColor :" #ffffff"
61
91
}
62
- standardTile(" coolDown" , " device.temperature" , inactiveLabel : false , decoration : " flat" ) {
92
+ standardTile(" coolDown" , " device.temperature" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
63
93
state " default" , label :' down' , action :" coolDown"
64
94
}
65
- standardTile(" coolUp" , " device.temperature" , inactiveLabel : false , decoration : " flat" ) {
95
+ standardTile(" coolUp" , " device.temperature" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
66
96
state " default" , label :' up' , action :" coolUp"
67
97
}
68
98
69
- standardTile(" mode" , " device.thermostatMode" , inactiveLabel : false , decoration : " flat" ) {
99
+ standardTile(" mode" , " device.thermostatMode" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
70
100
state " off" , label :' ${name}' , action :" thermostat.heat" , backgroundColor :" #ffffff"
71
101
state " heat" , label :' ${name}' , action :" thermostat.cool" , backgroundColor :" #ffa81e"
72
102
state " cool" , label :' ${name}' , action :" thermostat.auto" , backgroundColor :" #269bd2"
73
103
state " auto" , label :' ${name}' , action :" thermostat.off" , backgroundColor :" #79b821"
74
104
}
75
- standardTile(" fanMode" , " device.thermostatFanMode" , inactiveLabel : false , decoration : " flat" ) {
105
+ standardTile(" fanMode" , " device.thermostatFanMode" , width : 2 , height : 2 , inactiveLabel : false , decoration : " flat" ) {
76
106
state " fanAuto" , label :' ${name}' , action :" thermostat.fanOn" , backgroundColor :" #ffffff"
77
107
state " fanOn" , label :' ${name}' , action :" thermostat.fanCirculate" , backgroundColor :" #ffffff"
78
108
state " fanCirculate" , label :' ${name}' , action :" thermostat.fanAuto" , backgroundColor :" #ffffff"
79
109
}
80
- standardTile(" operatingState" , " device.thermostatOperatingState" ) {
110
+ standardTile(" operatingState" , " device.thermostatOperatingState" , width : 2 , height : 2 ) {
81
111
state " idle" , label :' ${name}' , backgroundColor :" #ffffff"
82
112
state " heating" , label :' ${name}' , backgroundColor :" #ffa81e"
83
113
state " cooling" , label :' ${name}' , backgroundColor :" #269bd2"
84
114
}
85
115
86
- main(" temperature " , " operatingState " )
116
+ main(" thermostatMulti " )
87
117
details([
88
118
" temperature" ," tempDown" ," tempUp" ,
89
119
" mode" , " fanMode" , " operatingState" ,
@@ -101,6 +131,7 @@ def installed() {
101
131
sendEvent(name : " thermostatMode" , value : " off" )
102
132
sendEvent(name : " thermostatFanMode" , value : " fanAuto" )
103
133
sendEvent(name : " thermostatOperatingState" , value : " idle" )
134
+ sendEvent(name : " humidity" , value : 53 , unit : " %" )
104
135
}
105
136
106
137
def parse (String description ) {
0 commit comments