-
Notifications
You must be signed in to change notification settings - Fork 10
/
touchpanel.yaml
180 lines (162 loc) · 3.98 KB
/
touchpanel.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
# Insert your SSID and Your PWD after inital setup
wifi:
networks:
- ssid: 'REPLACEME' # Enter your WiFi SSID here. Example: `ssid: 'your_network_name'`
password: 'REPLACEME' # Enter your wifi password here. Example: `password: 'abcde123456'`
# manual_ip:
# static_ip: 192.168.2.165
# gateway: 192.168.2.2
# subnet: 255.255.255.0
ap:
ssid: ${devicename}
# Enable the captive portal for inital WiFi setup
captive_portal:
substitutions:
devicename: touchpanel
friendly_name: TouchPanel
esphome:
name: $devicename
platform: ESP8266
board: nodemcuv2
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true
# This will allow for (future) project identification,
# configuration and updates.
project:
name: jagr.touch_panel
version: "0.1"
on_boot:
priority: -10
then:
- wait_until:
api.connected:
- logger.log: API is connected!
- rtttl.play: "success:d=24,o=5,b=100:c,g,b"
# Enable logging
logger:
# Enable Home Assistant API
api:
services:
- service: ok
then:
- rtttl.play: "beep:d=16,o=5,b=100:b"
- service: ko
then:
- rtttl.play: "beep:d=8,o=5,b=100:b"
- service: play_rtttl
variables:
song_str: string
then:
- rtttl.play: !lambda 'return song_str;'
ota:
i2c:
sda: D3
scl: D2
mpr121:
id: mpr121_component
touch_threshold: 8
release_threshold: 7
binary_sensor:
- platform: mpr121
id: touch_key0
channel: 0
name: "${friendly_name} Touch Key 0"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=5,b=1000:16e6"
- platform: mpr121
id: touch_key1
channel: 1
name: "${friendly_name} Touch Key 1"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key2
channel: 2
name: "${friendly_name} Touch Key 2"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key3
channel: 3
name: "${friendly_name} Touch Key 3"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key4
channel: 4
name: "${friendly_name} Touch Key 4"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key5
channel: 5
name: "${friendly_name} Touch Key 5"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key6
channel: 6
name: "${friendly_name} Touch Key 6"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key7
channel: 7
name: "${friendly_name} Touch Key 7"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key8
channel: 8
name: "${friendly_name} Touch Key 8"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key9
channel: 9
name: "${friendly_name} Touch Key 9"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key10
channel: 10
name: "${friendly_name} Touch Key 10"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
- platform: mpr121
id: touch_key11
channel: 11
name: "${friendly_name} Touch Key 11"
on_press:
then:
- rtttl.play:
rtttl: "short:d=4,o=4,b=1000:16e6"
output:
- platform: esp8266_pwm
pin: D5
id: rtttl_out
rtttl:
output: rtttl_out