-
Notifications
You must be signed in to change notification settings - Fork 0
/
Macros.sample.js
100 lines (100 loc) · 2.48 KB
/
Macros.sample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
module.exports = {
// Turn the lights in the kitchen on.
// You might have more than one light, so you'd add the command to turn on
// the second light here as well.
"Kitchen On": [
{
type: "mqtt",
topic: "smartthings/Kitchen Lights/switch/set",
payload: "on"
}
],
// Turn all lights in the kitchen off.
"Kitchen Off": [
{
type: "mqtt",
topic: "smartthings/Kitchen Lights/switch/set",
payload: "off"
}
],
// turn on all lights in the bathroom
"Bathroom On": [
{
type: "mqtt",
topic: "smartthings/Bathroom Light/switch/set",
payload: "on"
}
],
// turn off all lights in the bathroom
"Bathroom Off": [
{
type: "mqtt",
topic: "smartthings/Bathroom Light/switch/set",
payload: "off"
}
],
// Turn on the light and ceiling fan in the bedroom
"Bedroom On": [
{
type: "mqtt",
topic: "smartthings/Bedroom Light/switch/set",
payload: "on"
},
{
type: "mqtt",
topic: "smartthings/Bedroom Fan/switch/set",
payload: "on"
}
],
// turn everything off in the bedroom
"Bedroom Off": [
{
type: "mqtt",
topic: "smartthings/Bedroom Light/switch/set",
payload: "off"
},
{
type: "mqtt",
topic: "smartthings/Bedroom Fan/switch/set",
payload: "off"
}
],
// turn everything off
"All Off": [
{ type: "macro", name: "Kitchen Off" },
{ type: "macro", name: "Bathroom Off" },
{ type: "macro", name: "Bedroom Off" }
],
// time to go to bed. This routine sets the thermostat to a comfortable 72, and turns on the
// lights in the kitchen so you can get a drink of water.
Bedtime: [
{ type: "macro", name: "Bedroom On" },
{
type: "mqtt",
topic: "nest/structure/thermostat_name/set/target_temperature_f",
payload: "72"
},
{ type: "macro", name: "Kitchen On" }
],
// Good night - time to sleep. Turn everything off except: the ceiling fan in the bedroom.
// Sets the thermostat to 72 for comfortable sleeping.
"Good Night": [
{ type: "macro", name: "Kitchen Off" },
{ type: "macro", name: "Bathroom Off" },
{
type: "mqtt",
topic: "smartthings/Bedroom Light/switch/set",
payload: "off"
},
{
type: "mqtt",
topic: "smartthings/Bedroom Fan/switch/set",
payload: "on"
},
{
type: "mqtt",
topic: "nest/structure/thermostat_name/set/target_temperature_f",
payload: "72"
}
]
};