-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSonoff TH16 - doorbell
108 lines (91 loc) · 1.94 KB
/
Sonoff TH16 - doorbell
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
substitutions:
name: "{{name of the device}}"
friendly_name: "{{friendly name}}"
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
project:
name: esphome.sonoff_th16_doorbell-template
version: "1.0"
esp8266:
board: esp01_1m
restore_from_flash: true
preferences:
flash_write_interval: 0s
logger:
api:
encryption:
key: !secret api_encryption_key
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
password: !secret ap_password
captive_portal:
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
version: 2
local: true
text_sensor:
- platform: wifi_info
ip_address:
name: WiFi - IP-address
ssid:
name: WiFi - Connected SSID
bssid:
name: WiFi - Connected BSSID
mac_address:
name: WiFi - MAC-address
scan_results:
name: WiFi - Latest Scan Results
dns_address:
name: WiFi - DNS Address
sensor:
- platform: wifi_signal
name: "WiFi - Signal"
update_interval: 60s
entity_category: "diagnostic"
### EDIT BELOW THIS LINE ###
binary_sensor:
- platform: status
name: "API connection status"
id: connection_status
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
name: "Device - Button"
on_press:
- switch.turn_on: relay
- delay: 0.3s
- switch.turn_off: relay
- platform: gpio
pin:
number: GPIO14
inverted: True
name: "Device - Switch"
on_press:
if:
condition:
binary_sensor.is_off: connection_status
then:
- switch.turn_on: relay
- delay: 0.3s
- switch.turn_off: relay
switch:
- platform: restart
name: "Device - Restart"
- platform: gpio
name: "Device - Relay"
pin: GPIO12
id: relay
restore_mode: ALWAYS_OFF
status_led:
pin:
number: GPIO13
inverted: true