2023-06-09 19:20:53 +00:00
|
|
|
---
|
2023-06-08 17:48:16 +00:00
|
|
|
|
2023-06-07 23:26:40 +00:00
|
|
|
external_components:
|
|
|
|
- source:
|
|
|
|
type: git
|
2023-09-12 23:42:17 +00:00
|
|
|
url: https://github.com/ratgdo/esphome-ratgdo
|
2024-01-06 19:38:33 +00:00
|
|
|
ref: sec_plus_v1
|
2023-06-07 23:26:40 +00:00
|
|
|
refresh: 1s
|
|
|
|
|
2023-06-25 15:45:37 +00:00
|
|
|
preferences:
|
|
|
|
flash_write_interval: 5s
|
|
|
|
|
2023-06-07 23:26:40 +00:00
|
|
|
ratgdo:
|
|
|
|
id: ${id_prefix}
|
2023-06-23 13:52:29 +00:00
|
|
|
input_gdo_pin: ${uart_rx_pin}
|
|
|
|
output_gdo_pin: ${uart_tx_pin}
|
|
|
|
input_obst_pin: ${input_obst_pin}
|
2023-07-07 22:56:12 +00:00
|
|
|
on_sync_failed:
|
|
|
|
then:
|
|
|
|
- homeassistant.service:
|
|
|
|
service: persistent_notification.create
|
|
|
|
data:
|
|
|
|
title: "${friendly_name} sync failed"
|
2024-01-11 22:25:51 +00:00
|
|
|
message: "Failed to communicate with garage opener on startup."
|
2023-07-07 22:56:12 +00:00
|
|
|
notification_id: "esphome_ratgdo_${id_prefix}_sync_failed"
|
2024-01-18 22:25:08 +00:00
|
|
|
api:
|
|
|
|
services:
|
|
|
|
- service: wipe_devices_from_gdo_memory
|
|
|
|
variables:
|
|
|
|
devices_to_wipe: string
|
|
|
|
then:
|
|
|
|
- lambda: !lambda |-
|
|
|
|
if(devices_to_wipe.compare("all") == 0) {
|
|
|
|
id($id_prefix).clear_paired_devices(ratgdo::PairedDevice::ALL);
|
|
|
|
} else if (devices_to_wipe.compare("remote") == 0) {
|
|
|
|
id($id_prefix).clear_paired_devices(ratgdo::PairedDevice::REMOTE);
|
|
|
|
} else if (devices_to_wipe.compare("keypad") == 0) {
|
|
|
|
id($id_prefix).clear_paired_devices(ratgdo::PairedDevice::KEYPAD);
|
|
|
|
} else if (devices_to_wipe.compare("wall") == 0) {
|
|
|
|
id($id_prefix).clear_paired_devices(ratgdo::PairedDevice::WALL_CONTROL);
|
|
|
|
} else if (devices_to_wipe.compare("accessory") == 0) {
|
|
|
|
id($id_prefix).clear_paired_devices(ratgdo::PairedDevice::ACCESSORY);
|
|
|
|
}
|
2023-06-07 23:26:40 +00:00
|
|
|
|
2023-06-09 22:36:56 +00:00
|
|
|
sensor:
|
|
|
|
- platform: ratgdo
|
|
|
|
id: ${id_prefix}_openings
|
|
|
|
type: openings
|
|
|
|
entity_category: diagnostic
|
|
|
|
ratgdo_id: ${id_prefix}
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Openings"
|
2023-06-09 22:36:56 +00:00
|
|
|
unit_of_measurement: "openings"
|
2023-06-09 22:53:27 +00:00
|
|
|
icon: mdi:open-in-app
|
2024-01-18 22:25:08 +00:00
|
|
|
- platform: ratgdo
|
|
|
|
id: ${id_prefix}_paired_devices_total
|
|
|
|
type: paired_devices_total
|
|
|
|
entity_category: diagnostic
|
|
|
|
ratgdo_id: ${id_prefix}
|
|
|
|
name: "Paired Devices"
|
|
|
|
icon: mdi:remote
|
2023-06-09 22:36:56 +00:00
|
|
|
|
2023-12-06 00:12:01 +00:00
|
|
|
lock:
|
2023-06-09 20:54:20 +00:00
|
|
|
- platform: ratgdo
|
|
|
|
id: ${id_prefix}_lock_remotes
|
|
|
|
ratgdo_id: ${id_prefix}
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Lock remotes"
|
2023-12-06 00:12:01 +00:00
|
|
|
|
|
|
|
switch:
|
2023-06-09 20:41:36 +00:00
|
|
|
- platform: gpio
|
|
|
|
id: "${id_prefix}_status_door"
|
2023-06-09 22:45:15 +00:00
|
|
|
internal: true
|
2023-10-19 00:23:30 +00:00
|
|
|
pin:
|
2023-06-13 21:30:38 +00:00
|
|
|
number: ${status_door_pin} # D0 output door status, HIGH for open, LOW for closed
|
2023-06-09 20:41:36 +00:00
|
|
|
mode:
|
|
|
|
output: true
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Status door"
|
2023-06-09 20:41:36 +00:00
|
|
|
entity_category: diagnostic
|
|
|
|
- platform: gpio
|
|
|
|
id: "${id_prefix}_status_obstruction"
|
2023-06-09 22:45:15 +00:00
|
|
|
internal: true
|
2023-10-19 00:23:30 +00:00
|
|
|
pin:
|
2023-06-13 21:30:38 +00:00
|
|
|
number: ${status_obstruction_pin} # D8 output for obstruction status, HIGH for obstructed, LOW for clear
|
2023-06-09 20:41:36 +00:00
|
|
|
mode:
|
|
|
|
output: true
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Status obstruction"
|
2023-06-09 20:41:36 +00:00
|
|
|
entity_category: diagnostic
|
2024-01-18 22:25:08 +00:00
|
|
|
- platform: ratgdo
|
|
|
|
id: "${id_prefix}_learn"
|
|
|
|
type: learn
|
|
|
|
ratgdo_id: ${id_prefix}
|
|
|
|
name: "Learn"
|
|
|
|
icon: mdi:plus-box
|
|
|
|
entity_category: config
|
2023-06-09 20:41:36 +00:00
|
|
|
|
2023-06-07 23:26:40 +00:00
|
|
|
binary_sensor:
|
|
|
|
- platform: ratgdo
|
|
|
|
type: motion
|
|
|
|
id: ${id_prefix}_motion
|
|
|
|
ratgdo_id: ${id_prefix}
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Motion"
|
2023-06-07 23:26:40 +00:00
|
|
|
device_class: motion
|
|
|
|
- platform: ratgdo
|
|
|
|
type: obstruction
|
|
|
|
id: ${id_prefix}_obstruction
|
|
|
|
ratgdo_id: ${id_prefix}
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Obstruction"
|
2023-06-07 23:26:40 +00:00
|
|
|
device_class: problem
|
2023-06-09 20:41:36 +00:00
|
|
|
on_press:
|
|
|
|
- switch.turn_on: ${id_prefix}_status_obstruction
|
|
|
|
on_release:
|
|
|
|
- switch.turn_off: ${id_prefix}_status_obstruction
|
2023-06-09 23:05:06 +00:00
|
|
|
- platform: ratgdo
|
|
|
|
type: button
|
|
|
|
id: ${id_prefix}_button
|
|
|
|
ratgdo_id: ${id_prefix}
|
|
|
|
name: "Button"
|
2023-10-19 00:23:30 +00:00
|
|
|
entity_category: diagnostic
|
2023-06-08 02:40:07 +00:00
|
|
|
- platform: ratgdo
|
|
|
|
type: motor
|
|
|
|
id: ${id_prefix}_motor
|
|
|
|
ratgdo_id: ${id_prefix}
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Motor"
|
2023-06-08 02:40:07 +00:00
|
|
|
device_class: running
|
2023-06-08 11:54:05 +00:00
|
|
|
entity_category: diagnostic
|
2023-06-09 16:08:16 +00:00
|
|
|
- platform: gpio
|
2023-06-09 19:38:21 +00:00
|
|
|
id: "${id_prefix}_dry_contact_open"
|
2023-10-19 00:23:30 +00:00
|
|
|
pin:
|
2023-06-13 21:30:38 +00:00
|
|
|
number: ${dry_contact_open_pin} # D5 dry contact for opening door
|
2023-06-09 19:28:41 +00:00
|
|
|
inverted: true
|
|
|
|
mode:
|
|
|
|
input: true
|
|
|
|
pullup: true
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Dry contact open"
|
2023-06-09 19:13:40 +00:00
|
|
|
entity_category: diagnostic
|
2023-11-16 15:00:47 +00:00
|
|
|
filters:
|
|
|
|
- delayed_on_off: 500ms
|
2023-06-09 17:33:18 +00:00
|
|
|
on_press:
|
2023-06-09 19:38:21 +00:00
|
|
|
- if:
|
|
|
|
condition:
|
|
|
|
binary_sensor.is_off: ${id_prefix}_dry_contact_close
|
|
|
|
then:
|
2023-06-09 22:56:47 +00:00
|
|
|
- cover.open: ${id_prefix}_garage_door
|
2023-06-09 17:33:18 +00:00
|
|
|
- platform: gpio
|
2023-06-09 19:38:21 +00:00
|
|
|
id: "${id_prefix}_dry_contact_close"
|
2023-10-19 00:23:30 +00:00
|
|
|
pin:
|
2023-06-13 21:30:38 +00:00
|
|
|
number: ${dry_contact_close_pin} # D6 dry contact for closing door
|
2023-06-09 19:28:41 +00:00
|
|
|
inverted: true
|
|
|
|
mode:
|
|
|
|
input: true
|
2023-10-19 00:23:30 +00:00
|
|
|
pullup: true
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Dry contact close"
|
2023-06-09 19:13:40 +00:00
|
|
|
entity_category: diagnostic
|
2023-11-16 15:00:47 +00:00
|
|
|
filters:
|
|
|
|
- delayed_on_off: 500ms
|
2023-06-09 17:33:18 +00:00
|
|
|
on_press:
|
2023-06-09 19:38:21 +00:00
|
|
|
- if:
|
|
|
|
condition:
|
|
|
|
binary_sensor.is_off: ${id_prefix}_dry_contact_open
|
|
|
|
then:
|
2023-06-09 22:56:47 +00:00
|
|
|
- cover.close: ${id_prefix}_garage_door
|
2023-06-09 17:33:18 +00:00
|
|
|
- platform: gpio
|
2023-06-09 19:38:21 +00:00
|
|
|
id: "${id_prefix}_dry_contact_light"
|
2023-10-19 00:23:30 +00:00
|
|
|
pin:
|
2023-06-13 21:30:38 +00:00
|
|
|
number: ${dry_contact_light_pin} # D3 dry contact for triggering light (no discrete light commands, so toggle only)
|
2023-06-09 19:28:41 +00:00
|
|
|
inverted: true
|
|
|
|
mode:
|
|
|
|
input: true
|
2023-10-19 00:23:30 +00:00
|
|
|
pullup: true
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Dry contact light"
|
2023-06-09 19:13:40 +00:00
|
|
|
entity_category: diagnostic
|
2023-11-16 15:00:47 +00:00
|
|
|
filters:
|
|
|
|
- delayed_on_off: 500ms
|
2023-06-09 17:33:18 +00:00
|
|
|
on_press:
|
2023-06-09 19:23:18 +00:00
|
|
|
- light.toggle: ${id_prefix}_light
|
2023-06-07 23:26:40 +00:00
|
|
|
|
|
|
|
number:
|
|
|
|
- platform: ratgdo
|
|
|
|
id: ${id_prefix}_rolling_code_counter
|
|
|
|
type: rolling_code_counter
|
|
|
|
entity_category: config
|
|
|
|
ratgdo_id: ${id_prefix}
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Rolling code counter"
|
2023-06-07 23:34:24 +00:00
|
|
|
mode: box
|
|
|
|
unit_of_measurement: "codes"
|
2023-10-19 00:23:30 +00:00
|
|
|
|
2023-06-25 23:03:39 +00:00
|
|
|
- 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"
|
2023-06-07 23:26:40 +00:00
|
|
|
|
2023-10-26 17:04:35 +00:00
|
|
|
- platform: ratgdo
|
|
|
|
id: ${id_prefix}_client_id
|
|
|
|
type: client_id
|
|
|
|
entity_category: config
|
|
|
|
ratgdo_id: ${id_prefix}
|
|
|
|
name: "Client ID"
|
|
|
|
mode: box
|
|
|
|
|
2023-06-07 23:26:40 +00:00
|
|
|
cover:
|
|
|
|
- platform: ratgdo
|
2023-06-09 22:56:17 +00:00
|
|
|
id: ${id_prefix}_garage_door
|
2023-06-07 23:26:40 +00:00
|
|
|
device_class: garage
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Door"
|
2023-06-07 23:26:40 +00:00
|
|
|
ratgdo_id: ${id_prefix}
|
2023-06-09 20:43:13 +00:00
|
|
|
on_closed:
|
2023-06-09 20:41:36 +00:00
|
|
|
- switch.turn_off: ${id_prefix}_status_door
|
2023-06-09 20:42:01 +00:00
|
|
|
on_open:
|
2023-06-09 20:41:36 +00:00
|
|
|
- switch.turn_on: ${id_prefix}_status_door
|
2023-06-07 23:26:40 +00:00
|
|
|
|
|
|
|
light:
|
|
|
|
- platform: ratgdo
|
2023-06-09 19:23:41 +00:00
|
|
|
id: ${id_prefix}_light
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Light"
|
2023-06-07 23:26:40 +00:00
|
|
|
ratgdo_id: ${id_prefix}
|
|
|
|
|
|
|
|
button:
|
|
|
|
- platform: restart
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Restart"
|
2023-06-08 16:50:39 +00:00
|
|
|
- platform: safe_mode
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Safe mode boot"
|
2023-06-08 16:50:39 +00:00
|
|
|
entity_category: diagnostic
|
2023-10-19 00:23:30 +00:00
|
|
|
|
2023-06-24 23:51:19 +00:00
|
|
|
- platform: template
|
|
|
|
id: ${id_prefix}_query_status
|
2023-06-07 23:45:37 +00:00
|
|
|
entity_category: diagnostic
|
2023-06-24 23:51:19 +00:00
|
|
|
name: "Query status"
|
2023-10-19 00:23:30 +00:00
|
|
|
on_press:
|
2023-06-24 23:51:19 +00:00
|
|
|
then:
|
|
|
|
lambda: !lambda |-
|
2023-10-19 00:23:30 +00:00
|
|
|
id($id_prefix).query_status();
|
|
|
|
|
2023-06-24 23:51:19 +00:00
|
|
|
- platform: template
|
|
|
|
id: ${id_prefix}_query_openings
|
|
|
|
name: "Query openings"
|
|
|
|
entity_category: diagnostic
|
2023-10-19 00:23:30 +00:00
|
|
|
on_press:
|
2023-06-24 23:51:19 +00:00
|
|
|
then:
|
|
|
|
lambda: !lambda |-
|
|
|
|
id($id_prefix).query_openings();
|
|
|
|
|
|
|
|
- platform: template
|
2023-06-25 15:52:16 +00:00
|
|
|
id: ${id_prefix}_sync
|
2023-06-09 22:58:46 +00:00
|
|
|
name: "Sync"
|
2023-06-07 23:59:49 +00:00
|
|
|
entity_category: diagnostic
|
2023-10-19 00:23:30 +00:00
|
|
|
on_press:
|
2023-06-24 23:51:19 +00:00
|
|
|
then:
|
|
|
|
lambda: !lambda |-
|
2023-10-19 00:18:42 +00:00
|
|
|
id($id_prefix).sync();
|
|
|
|
|
|
|
|
- platform: template
|
|
|
|
id: ${id_prefix}_toggle_door
|
|
|
|
name: "Toggle door"
|
2023-10-19 00:23:30 +00:00
|
|
|
on_press:
|
2023-10-19 00:18:42 +00:00
|
|
|
then:
|
|
|
|
lambda: !lambda |-
|
2024-01-11 23:10:51 +00:00
|
|
|
id($id_prefix).door_toggle();
|