-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathesphome-code.yaml
63 lines (52 loc) · 1.17 KB
/
esphome-code.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
esphome:
name: ugreen-hdmi-switcher
friendly_name: "Ugreen HDMI Switcher"
esp8266:
board: d1_mini
# Enable logging
logger:
level: INFO
# Enable Home Assistant API
api:
encryption:
key: "QWthU1d2dUFlTSRhTlA5bW9yR1JrdUhCajlRI3Y5eUA=" # Change this
ota:
password: "changethis" # Change this
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
# ap:
# ssid: "Test Fallback Hotspot"
# password: "changethis"
output:
- platform: gpio
pin:
number: 2
inverted: true
id: 'output_toggle'
button:
- platform: output
name: "Toggle HDMI Port"
output: 'output_toggle'
duration: 500ms
binary_sensor:
- platform: gpio
name: "HDMI Port Status"
id: hdmi_pin
internal: true
pin: 4
publish_initial_state: true
on_state:
then:
- lambda: !lambda |-
if (id(hdmi_pin).state) {
id(hdmi_port).publish_state("hdmi2");
} else {
id(hdmi_port).publish_state("hdmi1");
}
text_sensor:
- platform: template
id: hdmi_port
name: "HDMI Port"
# captive_portal: