-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathloud-esp.yaml
134 lines (120 loc) · 2.39 KB
/
loud-esp.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
substitutions:
name: esphome-web-e0c2e8
friendly_name: loud-esp
esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: false
project:
name: esphome.web
version: '1.0'
on_boot:
priority: 800
then:
- media_player.volume_set:
id: loudesp
volume: 50%
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
password: !secret esphome_ota_password
wifi:
ssid: !secret esphome_wifi_ssid
password: !secret esphome_wifi_password
ap:
ssid: "$name Hotspot"
password: !secret esphome_ap_password
psram:
mode: octal
speed: 80MHz
i2s_audio:
i2s_lrclk_pin: GPIO25
i2s_bclk_pin: GPIO26
media_player:
- platform: i2s_audio
name: $friendly_name
id: loudesp
dac_type: external
i2s_dout_pin: GPIO22
mode: stereo
light:
- platform: esp32_rmt_led_strip
id: rgb_light
rgb_order: GRB
pin: GPIO33
num_leds: 1
rmt_channel: 1
chipset: ws2812
name: "RGB led"
remote_receiver:
pin:
number: GPIO0
inverted: true
mode:
input: true
dump: samsung
on_samsung:
then:
- if:
condition:
- lambda: 'return (x.data == 0xE0E0E01F);'
then:
- media_player.volume_up:
id: loudesp
- if:
condition:
- lambda: 'return (x.data == 0xE0E0D02F);'
then:
- media_player.volume_down:
id: loudesp
spi:
clk_pin: GPIO18
mosi_pin: GPIO23
miso_pin: GPIO19
touchscreen:
platform: xpt2046
cs_pin: GPIO2
interrupt_pin: GPIO21
update_interval: 50ms
threshold: 400
calibration:
x_min: 280
x_max: 3860
y_max: 340
y_min: 3860
transform:
swap_xy: false
# mirror_x: true
# mirror_y: true
on_touch:
- lambda: |-
for (auto touch: touches) {
if (touch.state <= 2) {
ESP_LOGI("Touch points:", "id=%d x=%d, y=%d", touch.id, touch.x, touch.y);
}
}
display:
- platform: ili9xxx
id: tft_display
model: ILI9341
dimensions:
width: 240
height: 320
offset_height: 0
offset_width: 0
invert_colors: false
dc_pin: GPIO04
reset_pin: GPIO32
cs_pin: GPIO05
rotation: 180
update_interval: 1s
lambda: |-
it.fill(id(Color::BLACK));