-
Notifications
You must be signed in to change notification settings - Fork 0
/
schuur-outlet.yaml
executable file
·77 lines (63 loc) · 1.32 KB
/
schuur-outlet.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
substitutions:
name: schuur-outlet
friendly_name: Schuur Outlet
esphome:
name: ${name}
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Schuur-Outlet Fallback Hotspot"
password: !secret hotspot_password
captive_portal:
web_server:
port: 80
binary_sensor:
- platform: status
name: "${friendly_name} Status"
- platform: gpio
name: "${friendly_name} Button"
pin:
number: GPIO14
mode: INPUT_PULLUP
inverted: true
internal: true
on_press:
- switch.toggle: relay
output:
- platform: esp8266_pwm
id: led
pin:
number: GPIO4
inverted: true
light:
- platform: monochromatic
id: status_led
name: "${friendly_name} Light"
output: led
switch:
- platform: gpio
id: relay
pin: GPIO12
- platform: template
name: "${friendly_name} Relay"
optimistic: true
id: relay_and_light
turn_on_action:
- switch.turn_on: relay
- light.turn_on: status_led
turn_off_action:
- switch.turn_off: relay
- light.turn_off: status_led
button:
- platform: restart
name: "${friendly_name} Restart"