forked from maraid/Jarvis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jarvis.yaml
257 lines (241 loc) · 6.5 KB
/
jarvis.yaml
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
substitutions:
# main prefix for all entities
name: "Desk"
# name of your node
node_name: "jarvis-desk"
esphome:
name: $node_name
platform: ESP8266
board: d1_mini
includes:
- jarvis/include/JarvisDesk.h
- jarvis/src/JarvisDesk.cpp
- jarvis/include/HandsetHandler.h
- jarvis/src/HandsetHandler.cpp
- jarvis/include/ControlboxHandler.h
- jarvis/src/ControlboxHandler.cpp
- jarvis/include/SerialDevice.h
- jarvis/src/SerialDevice.cpp
- jarvis/include/SerialMessage.h
- jarvis/src/SerialMessage.cpp
- jarvis/include/utils.h
- jarvis/src/utils.cpp
- jarvis/include/Timer.h
- jarvis/src/Timer.cpp
libraries:
- espsoftwareserial
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Jarvis Fallback Hotspot"
password: "xxxxxx"
web_server:
port: 80
version: 2
captive_portal:
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
ota:
custom_component:
lambda: |-
auto my_custom = new JarvisDesk();
my_custom->sHeight = id(height_number);
my_custom->sPreset1 = id(preset_1_sensor);
my_custom->sPreset2 = id(preset_2_sensor);
my_custom->sPreset3 = id(preset_3_sensor);
my_custom->sPreset4 = id(preset_4_sensor);
my_custom->sSysLimitMin = id(sys_limit_min);
my_custom->sSysLimitMax = id(sys_limit_max);
my_custom->sUserLimitMin = id(user_limit_min);
my_custom->sUserLimitMax = id(user_limit_max);
my_custom->sUserLimitSet = id(user_limit_set);
my_custom->sUnits = id(units_select);
my_custom->sTouchMode = id(touch_mode_select);
my_custom->sKillMode = id(kill_mode_select);
my_custom->sSensitivity = id(sensitivity_select);
return {my_custom};
components:
- id: desk
binary_sensor:
- platform: status
name: "Desk Status"
sensor:
- platform: template
name: "$name Preset 1 Position"
id: preset_1_sensor
- platform: template
name: "$name Preset 2 Position"
id: preset_2_sensor
- platform: template
name: "$name Preset 3 Position"
id: preset_3_sensor
- platform: template
name: "$name Preset 4 Position"
id: preset_4_sensor
- platform: template
name: "$name User limit min"
id: user_limit_min
- platform: template
name: "$name User limit max"
id: user_limit_max
- platform: template
name: "$name System limit min"
id: sys_limit_min
- platform: template
name: "$name System limit max"
id: sys_limit_max
- platform: dht
model: DHT11
pin: D3
temperature:
name: "Room Temperature"
humidity:
name: "Room Humidity"
update_interval: 60s
text_sensor:
- platform: template
name: "$name User limit set"
id: user_limit_set
select:
- platform: template
name: "$name Units"
id: units_select
options:
- inch
- cm
optimistic: false
set_action:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setUnits(x.c_str());
- platform: template
name: "$name Touch Mode"
id: touch_mode_select
options:
- Continuous
- Single
optimistic: false
set_action:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setTouchMode(x.c_str());
- platform: template
name: "$name Kill Mode"
id: kill_mode_select
options:
- Kill
- LetLive
optimistic: false
set_action:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setKillMode(x.c_str());
- platform: template
name: "$name Sensitivity"
id: sensitivity_select
options:
- High
- Medium
- Low
optimistic: false
set_action:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setSensitivity(x.c_str());
number:
- platform: template
name: "$name Height"
id: height_number
optimistic: false
min_value: 1
max_value: 1800
step: 10
set_action:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).move(x);
- platform: template
name: "$name Offset"
id: offset_number
optimistic: true
min_value: 1
max_value: 1800
step: 1
set_action:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setOffset(x);
- platform: template
name: "$name Display number"
id: display_number
optimistic: true
min_value: 1
max_value: 1800
step: 1
set_action:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setDisplayNumber(x*10);
button:
- platform: template
name: "$name Go to preset 1"
id: go_preset_1
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).goPreset1();
- platform: template
name: "$name Go to preset 2"
id: go_preset_2
on_press:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).goPreset2();
- platform: template
name: "$name Go to preset 3"
id: go_preset_3
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).goPreset3();
- platform: template
name: "$name Go to preset 4"
id: go_preset_4
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).goPreset4();
- platform: template
name: "$name Set preset 1"
id: set_preset_1
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setPreset1();
- platform: template
name: "$name Set preset 2"
id: set_preset_2
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setPreset2();
- platform: template
name: "$name Set preset 3"
id: set_preset_3
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setPreset3();
- platform: template
name: "$name Set preset 4"
id: set_preset_4
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setPreset4();
- platform: template
name: "$name Set max height"
id: set_max_height
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setMaxHeight();
- platform: template
name: "$name Set min height"
id: set_min_height
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).setMinHeight();
- platform: template
name: "$name Set max height"
id: clear_max_height
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).clearMaxHeight();
- platform: template
name: "$name Set min height"
id: clear_min_height
on_press:
then:
- lambda: (*reinterpret_cast<JarvisDesk*>(id(desk))).clearMinHeight();