-
Notifications
You must be signed in to change notification settings - Fork 107
/
base_drycontact.yaml
105 lines (93 loc) · 2.25 KB
/
base_drycontact.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
103
104
105
---
external_components:
- source:
# type: local
# path: components
type: git
url: https://github.com/ratgdo/esphome-ratgdo
refresh: 1s
safe_mode:
preferences:
flash_write_interval: 1min
text_sensor:
- platform: version
name: "Firmware Version"
ratgdo:
id: ${id_prefix}
output_gdo_pin: ${uart_tx_pin}
input_obst_pin: ${input_obst_pin}
dry_contact_open_sensor: ${id_prefix}_dry_contact_open
dry_contact_close_sensor: ${id_prefix}_dry_contact_close
discrete_open_pin: ${discrete_open_pin}
discrete_close_pin: ${discrete_close_pin}
protocol: drycontact
ota:
- platform: esphome
id: ratgdo_ota
binary_sensor:
- platform: ratgdo
type: obstruction
id: ${id_prefix}_obstruction
ratgdo_id: ${id_prefix}
name: "Obstruction"
device_class: problem
- platform: gpio
id: "${id_prefix}_dry_contact_open"
pin:
number: ${dry_contact_open_pin}
inverted: true
mode:
input: true
pullup: true
name: "Open limit switch"
entity_category: diagnostic
filters:
- delayed_on_off: 500ms
- platform: gpio
id: "${id_prefix}_dry_contact_close"
pin:
number: ${dry_contact_close_pin}
inverted: true
mode:
input: true
pullup: true
name: "Close limit switch"
entity_category: diagnostic
filters:
- delayed_on_off: 500ms
number:
- platform: ratgdo
id: ${id_prefix}_opening_duration
type: opening_duration
entity_category: config
ratgdo_id: ${id_prefix}
name: "Opening duration"
unit_of_measurement: "s"
- platform: ratgdo
id: ${id_prefix}_closing_duration
type: closing_duration
entity_category: config
ratgdo_id: ${id_prefix}
name: "Closing duration"
unit_of_measurement: "s"
cover:
- platform: ratgdo
id: ${id_prefix}_garage_door
device_class: garage
name: "Door"
ratgdo_id: ${id_prefix}
button:
- platform: restart
id: ${id_prefix}_restart
name: "Restart"
- platform: safe_mode
id: ${id_prefix}_safe_mode
name: "Safe mode boot"
entity_category: diagnostic
- platform: template
id: ${id_prefix}_toggle_door
name: "Toggle door"
on_press:
then:
lambda: !lambda |-
id($id_prefix).door_toggle();