-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintercom.yaml
More file actions
109 lines (95 loc) · 2.21 KB
/
intercom.yaml
File metadata and controls
109 lines (95 loc) · 2.21 KB
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
esphome:
name: intercom
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret API_PASSWORD
ota:
password: !secret OTA_PASSWORD
wifi:
ssid: !secret WIFI_SSID
password: !secret WIFI_PASSWORD
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: !secret AP_SSID
password: !secret AP_PASSWORD
captive_portal:
binary_sensor:
- platform: gpio
id: intercom_ringer
pin:
number: D5
mode:
input: true
inverted: true
on_press:
then:
- output.turn_on: intercom_ringer_led_out
- output.set_level:
id: intercom_ringer_led_out
level: 60%
on_release:
then:
- output.turn_off: intercom_ringer_led_out
name: "Intercom Ringer"
filters:
- delayed_on: 20ms
- delayed_off: 20ms
device_class: sound
icon: mdi:bell-ring-outline
- platform: gpio
id: intercom_mute_sw
pin:
number: D7
mode:
input: true
pullup: true
inverted: true
name: "Intercom Mute Switcher"
filters:
- delayed_on: 20ms
- delayed_off: 20ms
internal: true
on_press:
then:
- switch.toggle: intercom_mute
switch:
- platform: gpio
id: intercom_mute
pin: D1
name: "Intercom Mute"
icon: mdi:volume-mute
- platform: output
id: intercom_unlock
output: intercom_unlock_out
name: "Intercom Unlock"
icon: mdi:lock-open-variant-outline
on_turn_on:
- delay: 500ms
- switch.turn_off: intercom_unlock
#########################################
## DEBUG ##
#########################################
# - platform: output
# output: intercom_ringer_led_out
# name: "Intercom Ringer LED"
# on_turn_on:
# then:
# - output.turn_on: intercom_ringer_led_out
# - output.set_level:
# id: intercom_ringer_led_out
# level: 50%
# on_turn_off:
# then:
# - output.turn_off: intercom_ringer_led_out
output:
- platform: gpio
id: intercom_unlock_out
pin: D2
- platform: slow_pwm
id: intercom_ringer_led_out
pin: D6
period: 600ms