-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoorbell.yaml
102 lines (89 loc) · 2.2 KB
/
doorbell.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
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
substitutions:
name: "doorbell"
room: ""
friendly_name: "Doorbell"
project_name: "cooperised.Doorbell"
project_version: "1.1.0"
hidden_ssid: "false"
pull_angle: "130"
debounce_on: "10ms"
debounce_off: "100ms"
button_pin: "D1"
stepper_enable_pin: "D3"
stepper_step_pin: "D7"
stepper_dir_pin: "D8"
stepper_enable_invert: "true"
stepper_max_speed: "1000 steps/s"
stepper_acceleration: "2500"
stepper_deceleration: "5000"
esphome:
name: "${name}"
name_add_mac_suffix: false
project:
name: "${project_name}"
version: "${project_version}"
esp8266:
board: nodemcuv2
logger:
api:
ota:
wifi:
fast_connect: "${hidden_ssid}"
ap: {}
captive_portal:
improv_serial:
dashboard_import:
package_import_url: github://cooperised/doorbell/doorbell.yaml@main
import_full_config: false
button:
- platform: template
id: sounder
name: "Doorbell Sounder"
icon: "mdi:alarm-bell"
on_press:
then:
- logger.log: "ring ring"
- output.turn_on: step_enable
- stepper.report_position:
id: chime
position: 0
- stepper.set_target:
id: chime
target: "${pull_angle}"
- wait_until:
lambda: |-
return id(chime).current_position == id(chime).target_position;
- stepper.set_target:
id: chime
target: 0
- wait_until:
lambda: |-
return id(chime).current_position == id(chime).target_position;
- delay: 500ms
- output.turn_off: step_enable
binary_sensor:
- platform: gpio
name: "Doorbell Button"
icon: "mdi:gesture-tap-button"
filters:
- delayed_on: "${debounce_on}"
- delayed_off: "${debounce_off}"
pin:
number: "${button_pin}"
inverted: true
mode:
input: true
pullup: true
output:
- platform: gpio
pin: "${stepper_enable_pin}"
id: step_enable
inverted: "${stepper_enable_invert}"
stepper:
- platform: a4988
id: chime
step_pin: "${stepper_step_pin}"
dir_pin: "${stepper_dir_pin}"
max_speed: "${stepper_max_speed}"
acceleration: "${stepper_acceleration}"
deceleration: "${stepper_deceleration}"