-
Notifications
You must be signed in to change notification settings - Fork 2
/
automower.yaml
515 lines (454 loc) · 14.1 KB
/
automower.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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
esphome:
name: automower
friendly_name: automower
includes:
- automower/automower.h
esp8266:
board: d1_mini
# Enable logging
logger:
hardware_uart: UART1
baud_rate: 0
level: VERBOSE
esp8266_store_log_strings_in_flash: False
# Enable Home Assistant API
api:
encryption:
key: "XXXX"
ota:
password: "YYY"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
uart:
id: uart_bus
rx_pin: D2
tx_pin: D1
baud_rate: 9600
# debug:
# direction: BOTH
# dummy_receiver: true
# after:
# timeout: 100ms
custom_component:
- lambda: |-
// update_interval = 15 seconds
auto my_custom = new Automower(id(uart_bus),5000);
return {my_custom};
components:
- id: automower
text_sensor:
# - platform: template
# name: "Template Text Sensor"
# lambda: |-
# return {"Hello World"};
# update_interval: 60s
- platform: custom
lambda: |-
Automower *mower = (Automower *) id(automower);
//App.register_component(mower);
return {mower->lastCodeReceivedTextSensor,mower->modeTextSensor,mower->statusTextSensor};
//,mower->batteryLevelSensor
text_sensors:
- id: "last_read_code"
name: "Last received code"
- id: "current_mode"
name: "Mode actuel"
- id: "status"
name: "Etat"
sensor:
- platform: custom
lambda: |-
Automower *mower = (Automower *) id(automower);
return {mower->batteryLevelSensor,mower->chargingTimeSensor,mower->batteryUsedSensor,mower->batteryVoltageSensor,mower->firmwareVersionSensor};
sensors:
- id: batteryLevelSensor
name: "Battery level"
unit_of_measurement: mAh
- id: chargingTimeSensor
name: "Charging time"
unit_of_measurement: min
- id: batteryUsedSensor
name: "Battery used"
unit_of_measurement: mAh
- id: batteryVoltageSensor
name: "Battery voltage"
unit_of_measurement: V
- id: firmwareVersionSensor
name: "Firmware version"
select:
- platform: template
name: "Mode select"
update_interval: 10s
options:
- "MAN"
- "AUTO"
- "HOME"
- "DEMO"
lambda: |-
Automower *mower = (Automower *) id(automower);
return {mower->modeTextSensor->state};
set_action:
then:
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->setMode(x);
# select:
# - platform: custom
# lambda: |-
# Automower *mower = (Automower *) id(automower);
# return {mower->modeSelect};
# id: mode_select
# name: "Mode"
button:
- platform: restart
name: "Restart"
- platform: template
name: "Moteur droit 0x8000"
on_press:
- logger.log: Button Moteur droit 0x8000
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->setRightMotor(0x8000);
- platform: template
name: "Moteur droit 0x0000"
on_press:
- logger.log: Button Moteur droit 0x0000
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->setRightMotor(0x0000);
- platform: template
name: "Moteur gauche 0x8000"
on_press:
- logger.log: Button Moteur gauche 0x8000
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->setLeftMotor(0x8000);
- platform: template
name: "Moteur gauche 0x0000"
on_press:
- logger.log: Button Moteur gauche 0x0000
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->setLeftMotor(0x0000);
- platform: template
name: "Mode 0D"
on_press:
- logger.log: Mode 0D
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->setMode0D();
- platform: template
name: "Mode 9A"
on_press:
- logger.log: Mode 9A
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->setMode9A();
- platform: template
name: "Mode 99"
on_press:
- logger.log: Mode 99
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->setMode99();
- platform: template
name: "Key 0"
on_press:
- logger.log: Key 0
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x00);
- platform: template
name: "Key 1"
on_press:
- logger.log: Key 1
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x01);
- platform: template
name: "Key 2"
on_press:
- logger.log: Key 2
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x02);
- platform: template
name: "Key 3"
on_press:
- logger.log: Key 3
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x03);
- platform: template
name: "Key 4"
on_press:
- logger.log: Key 4
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x04);
- platform: template
name: "Key 5"
on_press:
- logger.log: Key 5
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x05);
- platform: template
name: "Key 6"
on_press:
- logger.log: Key 6
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x06);
- platform: template
name: "Key 7"
on_press:
- logger.log: Key 7
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x07);
- platform: template
name: "Key 8"
on_press:
- logger.log: Key 8
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x08);
- platform: template
name: "Key 9"
on_press:
- logger.log: Key 9
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x09);
- platform: template
name: "Key A"
on_press:
- logger.log: Key A
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x0A);
- platform: template
name: "Key B"
on_press:
- logger.log: Key B
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x0B);
- platform: template
name: "Key C"
on_press:
- logger.log: Key C
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x0C);
- platform: template
name: "Key HOME"
on_press:
- logger.log: Key Home
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x0D);
- platform: template
name: "Key MAN/AUTO"
on_press:
- logger.log: "Key MAN/AUTO"
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x0E);
- platform: template
name: "Key Cancel"
on_press:
- logger.log: Key Cancel
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x0F);
- platform: template
name: "Key Up"
on_press:
- logger.log: Key Up
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x10);
- platform: template
name: "Key Down"
on_press:
- logger.log: Key Down
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x11);
- platform: template
name: "Key Yes"
on_press:
- logger.log: Key Yes
- lambda: |-
Automower *mower = (Automower *) id(automower);
mower->numKey(0x12);
time:
- platform: homeassistant
id: homeassistant_time
timezone: "Europe/Paris"
# switch:
# - platform: uart
# name: "W go home key"
# data: [0x0F, 0x80, 0x5F, 0x00, 0x0D]
# - platform: uart
# name: "W yes key"
# data: [0x0F, 0x80, 0x5F, 0x00, 0x12]
# - platform: uart
# name: "W Cancel key"
# data: [0x0F, 0x80, 0x5F, 0x00, 0x0F]
# - platform: uart
# name: "W auto key"
# data: [0x0F, 0x80, 0x5F, 0x00, 0x0E]
# - platform: uart
# name: "R return fast"
# data: [0x0F, 0x02, 0x7D, 0x00, 0x00]
# - platform: uart
# name: "W return fast 0 "
# data: [0x0F, 0x82, 0x7D, 0x00, 0x00]
# - platform: uart
# name: "W return fast 1"
# data: [0x0F, 0x82, 0x7D, 0x00, 0x01]
# - platform: uart
# name: "R Software Stop"
# data: [0x0F, 0x01, 0x2F, 0x00, 0x00]
# # 2=Stop,0=éteint
# - platform: uart
# name: "W Software Stop 2=STOP"
# data: [0x0F, 0x81, 0x2F, 0x00, 0x02]
# - platform: uart
# name: "W Software Stop 0=pasSTOP"
# data: [0x0F, 0x81, 0x2F, 0x00, 0x00]
# - platform: uart
# name: "R Software Stop status"
# data: [0x0F, 0x43, 0x78, 0x00, 0x00]
# # 1=allumé,0=éteint
# - platform: uart
# name: "R Statuscode"
# data: [0x0F, 0x01, 0xF1, 0x00, 0x00]
# - platform: uart
# name: "R heure"
# data: [0x0F, 0x36, 0xB5, 0x00, 0x00]
# - platform: uart
# name: "R minuterie status"
# data: [0x0F, 0x4A, 0x4E, 0x00, 0x00]
# - platform: uart
# name: "W minuterie => allumer "
# data: [0x0F, 0xCA, 0x4E, 0x00, 0x01]
# - platform: uart
# name: "W minuterie => éteindre"
# data: [0x0F, 0xCA, 0x4E, 0x00, 0x00]
# - platform: uart
# name: "R Timer 1"
# data: [0x0F, 0x4A, 0x38, 0x00, 0x00]
# - platform: uart
# name: "R mode"
# data: [0x0F, 0x01, 0x2C, 0x00, 0x00]
# - platform: uart
# name: "W mode => 0 MAN "
# data: [0x0F, 0x81, 0x2C, 0x00, 0x00]
# - platform: uart
# name: "W mode => 1 AUTO "
# data: [0x0F, 0x81, 0x2C, 0x00, 0x01]
# - platform: uart
# name: "W mode => 3 HOME "
# data: [0x0F, 0x81, 0x2C, 0x00, 0x03]
# - platform: uart
# name: "W mode => 4 DEMO "
# data: [0x0F, 0x81, 0x2C, 0x00, 0x04]
# "W_MODE_MAN" {set hexin "0F812C0000"}
# "W_MODE_AUTO" {set hexin "0F812C0001"}
# "W_MODE_HOME" {set hexin "0F812C0003"}
# "W_MODE_DEMO" {set hexin "0F812C0004"}
# "W_KEY_0" {set hexin "0F805F0000"}
# "W_KEY_1" {set hexin "0F805F0001"}
# "W_KEY_2" {set hexin "0F805F0002"}
# "W_KEY_3" {set hexin "0F805F0003"}
# "W_KEY_4" {set hexin "0F805F0004"}
# "W_KEY_5" {set hexin "0F805F0005"}
# "W_KEY_6" {set hexin "0F805F0006"}
# "W_KEY_7" {set hexin "0F805F0007"}
# "W_KEY_8" {set hexin "0F805F0008"}
# "W_KEY_9" {set hexin "0F805F0009"}
# "W_PRG_A" {set hexin "0F805F000A"}
# "W_PRG_B" {set hexin "0F805F000B"}
# "W_PRG_C" {set hexin "0F805F000C"}
# "W_KEY_HOME" {set hexin "0F805F000D"}
# "W_KEY_MANAUTO" {set hexin "0F805F000E"}
# "W_KEY_C" {set hexin "0F805F000F"}
# "W_KEY_UP" {set hexin "0F805F0010"}
# "W_KEY_DOWN" {set hexin "0F805F0011"}
# "W_KEY_YES" {set hexin "0F805F0012"}
# "R_STATUS" {set hexin "0F01F10000"}
# "R_SEKUNDE" {set hexin "0F36B10000"}
# "R_MINUTE" {set hexin "0F36B30000"}
# "R_STUNDE" {set hexin "0F36B50000"}
# "R_TAG" {set hexin "0F36B70000"}
# "R_MONAT" {set hexin "0F36B90000"}
# "R_JAHR" {set hexin "0F36BD0000"}
# "R_TIMERSTATUS" {set hexin "0F4A4E0000"}
# "R_WOCHEN-TIMER1-START-STD" {set hexin "0F4A380000"}
# "R_WOCHEN-TIMER1-START-MIN" {set hexin "0F4A390000"}
# "R_WOCHEN-TIMER1-STOP-STD" {set hexin "0F4A3A0000"}
# "R_WOCHEN-TIMER1-STOP-MIN" {set hexin "0F4A3B0000"}
# "R_WOCHENEND-TIMER1-START-STD" {set hexin "0F4A3C0000"}
# "R_WOCHENEND-TIMER1-START-MIN" {set hexin "0F4A3D0000"}
# "R_WOCHENEND-TIMER1-STOP-STD" {set hexin "0F4A3E0000"}
# "R_WOCHENEND-TIMER1-STOP-MIN" {set hexin "0F4A3F0000"}
# "R_WOCHEN-TIMER2-START-STD" {set hexin "0F4A400000"}
# "R_WOCHEN-TIMER2-START-MIN" {set hexin "0F4A410000"}
# "R_WOCHEN-TIMER2-STOP-STD" {set hexin "0F4A420000"}
# "R_WOCHEN-TIMER2-STOP-MIN" {set hexin "0F4A430000"}
# "R_WOCHENEND-TIMER2-START-STD" {set hexin "0F4A440000"}
# "R_WOCHENEND-TIMER2-START-MIN" {set hexin "0F4A450000"}
# "R_WOCHENEND-TIMER2-STOP-STD" {set hexin "0F4A460000"}
# "R_WOCHENEND-TIMER2-STOP-MIN" {set hexin "0F4A470000"}
# "R_TIMER-TAGE" {set hexin "0F4A500000"}
# "R_TIMER-STATUS" {set hexin "0F4A4E0000"}
# "R_WOCHENTIMER-TAGE" {set hexin "0F4A500000"}
# "R_MAEHZEIT" {set hexin "0F00380000"}
# "R_VIERECKMODUS-STATUS" {set hexin "0F01380000"}
# "R_VIERECKMODUS-PROZENT" {set hexin "0F01340000"}
# "R_VIERECKMODUS-STATUS" {set hexin "0F01370000"}
# "R_AKKU-LADEZEIT_MIN" {set hexin "0F01EC0000"}
# "R_AKKU-KAPAZITAET_MA" {set hexin "0F01EB0000"}
# "R_AKKU-KAPAZITAET_MAH" {set hexin "0F01EF0000"}
# "R_AKKU-KAPAZITAET-SUCHSTART_MAH" {set hexin "0F01EF0000"}
# "R_AKKU-KAPAZITAET-GENUTZT_MAH" {set hexin "0F2EE00000"}
# "R_AKKU-SPANNUNG_MV" {set hexin "0F2EF40000"}
# "R_AKKU-TEMPERATUR-AKTUELL" {set hexin "0F02330000"}
# "R_AKKU-TEMPERATUR-LADEN" {set hexin "0F02350000"}
# "R_AKKU-LETZTER-LADEVORGANG_MIN" {set hexin "0F02350000"}
# "R_AKKU-NAECHSTE_TEMPERATURMESSUNG_SEK" {set hexin "0F02360000"}
# "R_GESCHWINDIGKEIT-MESSERMOTOR" {set hexin "0F2EEA0000"}
# "R_GESCHWINDIGKEIT-RECHTS" {set hexin "0F24BF0000"}
# "R_GESCHWINDIGKEIT-LINKS" {set hexin "0F24C00000"}
# "R_FIRMWARE-VERSION" {set hexin "0F33900000"}
# "R_SPRACHDATEI-VERSION" {set hexin "0F3AC00000"}
# "W_TIMERAKTIV" {set hexin "0FCA4E0000"}
# "W_TIMERINAKTIV" {set hexin "0FCA4E0001"}
# "W_MODE_HOME" {set hexin "0F812C0003"}
# "W_MODE_MAN" {set hexin "0F812C0000"}
# "W_MODE_AUTO" {set hexin "0F812C0001"}
# "W_MODE_DEMO" {set hexin "0F812C0004"}
# "W_KEY_0" {set hexin "0F805F0000"}
# "W_KEY_1" {set hexin "0F805F0001"}
# "W_KEY_2" {set hexin "0F805F0002"}
# "W_KEY_3" {set hexin "0F805F0003"}
# "W_KEY_4" {set hexin "0F805F0004"}
# "W_KEY_5" {set hexin "0F805F0005"}
# "W_KEY_6" {set hexin "0F805F0006"}
# "W_KEY_7" {set hexin "0F805F0007"}
# "W_KEY_8" {set hexin "0F805F0008"}
# "W_KEY_9" {set hexin "0F805F0009"}
# "W_PRG_A" {set hexin "0F805F000A"}
# "W_PRG_B" {set hexin "0F805F000B"}
# "W_PRG_C" {set hexin "0F805F000C"}
# "W_KEY_HOME" {set hexin "0F805F000D"}
# "W_KEY_MANAUTO" {set hexin "0F805F000E"}
# "W_KEY_C" {set hexin "0F805F000F"}
# "W_KEY_UP" {set hexin "0F805F0010"}
# "W_KEY_DOWN" {set hexin "0F805F0011"}
# "W_KEY_YES" {set hexin "0F805F0012"}