-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathomni-door-sudo.yml
93 lines (79 loc) · 1.99 KB
/
omni-door-sudo.yml
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
esphome:
name: omni-door-sudo
platform: ESP32
board: esp32dev
on_boot:
then:
- output.turn_off: solenoid
# Enable logging
logger:
ota:
password: "shealing duarchy sorrowy welsium"
wifi:
ssid: "Omni Commons"
password: ""
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Omni Door Sudo Fallback Hotspot"
password: "uFX3BfgUmtI9"
spi:
clk_pin: 14
miso_pin: 12
mosi_pin: 13
rc522_spi: # or rc522_i2c
cs_pin: 27
update_interval: 1s
on_tag:
then:
- homeassistant.tag_scanned: !lambda 'return x;'
binary_sensor:
- platform: gpio
pin:
number: 15
mode:
input: true
pullup: true
name: "letmein"
filters:
- delayed_off: 10ms # debounce 10ms before registering false
on_release: # https://esphome.io/components/binary_sensor/index.html#binary-sensor-on-release
then:
- output.turn_on: solenoid
- output.ledc.set_frequency:
id: solenoid
frequency: "1000Hz"
- output.set_level:
id: solenoid
level: "100%"
- delay: 4000ms
# Then turn off
- output.turn_off: solenoid
output:
- platform: ledc # use ledc component for PWM for solenoid
pin: 5
id: solenoid
api:
password: "shealing duarchy sorrowy welsium"
services:
- service: unlock_door
then:
# First turn on at higher power for a short time
- output.turn_on: solenoid
- output.ledc.set_frequency:
id: solenoid
frequency: "1000Hz"
- output.set_level:
id: solenoid
level: "100%"
- delay: 5ms
# Now sustain at a lower power for a while
- output.ledc.set_frequency:
id: solenoid
frequency: "1000Hz"
- output.set_level:
id: solenoid
level: "100%"
- delay: 3000ms
# Then turn off
- output.turn_off: solenoid
captive_portal: