-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
yeelight_light_lamp9.yaml
129 lines (118 loc) · 2.82 KB
/
yeelight_light_lamp9.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
substitutions:
name: yeelight-light-lamp9
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
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
platform: esphome
logger:
level: DEBUG
api:
binary_sensor:
- platform: gpio
pin:
number: GPIO14
inverted: true
name: "${name} button"
id: button
on_click:
then:
- if:
condition:
light.is_off: bedside_light
then:
light.turn_on:
id: bedside_light
brightness: 1.0
else:
light.turn_off: bedside_light
on_press:
then:
- if:
condition:
light.is_off: bedside_light
then:
- delay: 0.5s
- while:
condition:
binary_sensor.is_on: button
then:
- light.dim_relative:
id: bedside_light
relative_brightness: 5%
transition_length: 0.1s
- delay: 0.1s
else:
- delay: 0.5s
- while:
condition:
and:
- binary_sensor.is_on: button
- light.is_on: bedside_light
then:
- light.dim_relative:
id: bedside_light
relative_brightness: -5%
transition_length: 0.1s
- delay: 0.1s
output:
- platform: ledc
pin: GPIO2
id: output_warm
power_supply: power
- platform: ledc
pin: GPIO27
id: output_cold
power_supply: power
- platform: ledc
pin: GPIO12
id: output_nightlight
power_supply: power
- platform: gpio
pin: GPIO33
id: led_output
power_supply:
- id: power
pin: GPIO4
enable_time: 0s
keep_on_time: 2s
light:
- platform: monochromatic
name: "${name} night light"
id: night_light
output: output_nightlight
gamma_correct: 0
on_turn_on:
- light.turn_off: bedside_light
- platform: cwww
name: "${name} bedside light"
id: bedside_light
cold_white: output_cold
warm_white: output_warm
cold_white_color_temperature: 6500 K
warm_white_color_temperature: 2700 K
constant_brightness: true
gamma_correct: 0
on_turn_on:
- light.turn_off: night_light
- platform: binary
name: "${name} mainboard led"
output: led_output
# A eeprom at address 0x10 should be found.
# i2c:
# - id: i2c_bus
# sda: GPIO17
# scl: GPIO18
# scan: true