-
Notifications
You must be signed in to change notification settings - Fork 0
/
s20switch.yaml
72 lines (60 loc) · 1.28 KB
/
s20switch.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
esphome:
name: s20switch
platform: ESP8266
board: esp01_1m
time:
- platform: sntp
id: sntp_time
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: on
reboot_timeout: 0s
power_save_mode: high
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "S20 Fallback Hotspot"
password: !secret fallback_password
captive_portal:
# Enable web server
web_server:
port: 80
auth:
username: !secret web_server_user
password: !secret web_server_password
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret hass_key
ota:
password: !secret hass_password
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: true
name: "Sonoff S20 Button"
- platform: status
name: "Sonoff S20 Status"
- platform: gpio
pin: GPIO2
name: "Sonoff S20 Sensor"
switch:
- platform: gpio
name: "Sonoff S20 Relay"
pin: GPIO12
output:
# Register the green LED as a dimmable output ....
- platform: esp8266_pwm
id: s20_green_led
pin:
number: GPIO13
inverted: true
light:
# ... and then make a light out of it.
- platform: monochromatic
name: "Sonoff S20 Green LED"
output: s20_green_led