forked from syssi/esphome-yeelight-ceiling-light
-
Notifications
You must be signed in to change notification settings - Fork 0
/
yeerc_ylyk01yl.yaml
102 lines (89 loc) · 2.03 KB
/
yeerc_ylyk01yl.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
substitutions:
name: yeerc
external_components_source: github://syssi/esphome-yeelight-ceiling-light@main
esphome:
name: ${name}
esp32:
board: esp32doit-devkit-v1
framework:
type: esp-idf
sdkconfig_options:
CONFIG_FREERTOS_UNICORE: y
advanced:
ignore_efuse_mac_crc: true
external_components:
- source: ${external_components_source}
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
ota:
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 Lamp)
# on 0
# off 1
# sun 2
# + 3
# m 4
# - 5
on_press:
- keycode: 0
then:
- logger.log: "Button on pressed"
- keycode: 1
then:
- logger.log: "Button off pressed"
- keycode: 2
then:
- logger.log: "Button sun pressed"
- keycode: 3
then:
- logger.log: "Button + pressed"
- keycode: 4
then:
- logger.log: "Button m pressed"
- keycode: 5
then:
- logger.log: "Button - 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 on long pressed"
- keycode: 1
then:
- logger.log: "Button off long pressed"
- keycode: 2
then:
- logger.log: "Button sun long pressed"
- keycode: 3
then:
- logger.log: "Button + long pressed"
- keycode: 4
then:
- logger.log: "Button m long pressed"
- keycode: 5
then:
- logger.log: "Button - long pressed"
# Trigger on any keycode
- then:
- logger.log:
format: 'Button with keycode %d long pressed'
args: ['int(keycode)']