esphome-ratgdo/base_drycontact.yaml

105 lines
2.2 KiB
YAML
Raw Normal View History

---
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
2024-04-18 18:52:53 +00:00
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
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 |-
2024-04-18 18:52:53 +00:00
id($id_prefix).door_toggle();