-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
yeerc_ylyk01yl_fancl.yaml
105 lines (92 loc) · 2.3 KB
/
yeerc_ylyk01yl_fancl.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
substitutions:
name: yeerc-fancl
external_components_source: github://syssi/esphome-yeelight-ceiling-light@main
esphome:
name: ${name}
min_version: 2024.10.0
esp32:
board: esp32doit-devkit-v1
framework:
type: esp-idf
sdkconfig_options:
CONFIG_FREERTOS_UNICORE: y
advanced:
ignore_efuse_mac_crc: true
ignore_efuse_custom_mac: true
external_components:
- source: ${external_components_source}
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
ota:
platform: esphome
logger:
level: DEBUG
api:
esp32_ble_tracker:
scan_parameters:
interval: 150ms
window: 150ms
duration: 1min
active: false
xiaomi_ylyk01yl:
mac_address: "A4:C1:38:6C:23:2D"
last_button_pressed:
name: "last button pressed"
# Button Keycode (YLYK01YL Ceiling Fan)
# fan toggle 0
# light toggle 1
# wind speed 2
# color temperature 3
# wind mode 4
# brightness 5
on_press:
- keycode: 0
then:
- logger.log: "Button fan toggle pressed"
- keycode: 1
then:
- logger.log: "Button light toggle pressed"
- keycode: 2
then:
- logger.log: "Button wind speed pressed"
- keycode: 3
then:
- logger.log: "Button color temperature pressed"
- keycode: 4
then:
- logger.log: "Button wind mode pressed"
- keycode: 5
then:
- logger.log: "Button brightness pressed"
# Trigger on any keycode
- then:
- logger.log:
format: 'Button with keycode %d pressed'
args: ['int(keycode)']
on_long_press:
- keycode: 0
then:
- logger.log: "Button fan toggle long pressed"
- keycode: 1
then:
- logger.log: "Button light toggle long pressed"
- keycode: 2
then:
- logger.log: "Button wind speed long pressed"
- keycode: 3
then:
- logger.log: "Button color temperature long pressed"
- keycode: 4
then:
- logger.log: "Button wind mode long pressed"
- keycode: 5
then:
- logger.log: "Button brightness long pressed"
# Trigger on any keycode
- then:
- logger.log:
format: 'Button with keycode %d long pressed'
args: ['int(keycode)']