esphome-ratgdo/base.yml

169 lines
4.1 KiB
YAML
Raw Normal View History

2023-06-09 19:20:53 +00:00
---
2023-06-08 16:24:41 +00:00
esphome:
name: ${id_prefix}
2023-06-08 17:46:23 +00:00
friendly_name: ${friendly_name}
name_add_mac_suffix: true
2023-06-09 19:23:18 +00:00
project:
2023-06-08 17:49:36 +00:00
name: ratgdo.esphome
2023-06-08 17:48:16 +00:00
version: "1.0"
2023-06-08 16:26:10 +00:00
esp8266:
2023-06-09 16:09:50 +00:00
board: d1_mini_lite
2023-06-08 16:24:41 +00:00
restore_from_flash: true
2023-06-07 23:26:40 +00:00
external_components:
- source:
type: git
2023-06-09 16:00:55 +00:00
url: https://github.com/esphome-ratgdo/esphome-ratgdo
ref: dev
2023-06-07 23:26:40 +00:00
refresh: 1s
ratgdo:
id: ${id_prefix}
2023-06-09 20:41:36 +00:00
switch:
- platform: gpio
id: "${id_prefix}_status_door"
pin:
number: D0 # D0 output door status, HIGH for open, LOW for closed
mode:
output: true
name: "${friendly_name} Status Door"
entity_category: diagnostic
- platform: gpio
id: "${id_prefix}_status_obstruction"
pin:
number: D8 # D8 output for obstruction status, HIGH for obstructed, LOW for clear
mode:
output: true
name: "${friendly_name} Status Obstruction"
entity_category: diagnostic
2023-06-07 23:26:40 +00:00
binary_sensor:
- platform: ratgdo
type: motion
id: ${id_prefix}_motion
ratgdo_id: ${id_prefix}
name: "${friendly_name} Motion"
device_class: motion
- platform: ratgdo
type: obstruction
id: ${id_prefix}_obstruction
ratgdo_id: ${id_prefix}
name: "${friendly_name} Obstruction"
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-08 02:40:07 +00:00
- platform: ratgdo
type: motor
id: ${id_prefix}_motor
ratgdo_id: ${id_prefix}
name: "${friendly_name} Motor"
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-06-09 19:28:41 +00:00
pin:
number: D5 # D5 dry contact for opening door
inverted: true
mode:
input: true
pullup: true
2023-06-09 17:33:18 +00:00
name: "${friendly_name} Dry contact open"
2023-06-09 19:13:40 +00:00
entity_category: diagnostic
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:
- cover.open: ${id_prefix}_garage
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-06-09 19:28:41 +00:00
pin:
number: D6 # D6 dry contact for closing door
inverted: true
mode:
input: true
pullup: true
2023-06-09 17:33:18 +00:00
name: "${friendly_name} Dry contact close"
2023-06-09 19:13:40 +00:00
entity_category: diagnostic
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:
- cover.close: ${id_prefix}_garage
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-06-09 19:28:41 +00:00
pin:
number: D3 # D3 dry contact for triggering light (no discrete light commands, so toggle only)
inverted: true
mode:
input: true
pullup: true
2023-06-09 17:33:18 +00:00
name: "${friendly_name} Dry contact light"
2023-06-09 19:13:40 +00:00
entity_category: diagnostic
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}
name: "${friendly_name} Rolling Code Counter"
2023-06-07 23:34:24 +00:00
mode: box
unit_of_measurement: "codes"
2023-06-07 23:26:40 +00:00
cover:
- platform: ratgdo
id: ${id_prefix}_garage
device_class: garage
name: ${friendly_name}
ratgdo_id: ${id_prefix}
2023-06-09 20:42:01 +00:00
on_close:
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-07 23:26:40 +00:00
name: "${friendly_name} Light"
ratgdo_id: ${id_prefix}
uart:
2023-06-09 19:23:18 +00:00
tx_pin:
2023-06-09 19:21:53 +00:00
number: D4 # red control terminal / GarageDoorOpener (UART1 TX) pin is D4 on D1 Mini
2023-06-09 19:20:53 +00:00
inverted: true
2023-06-07 23:26:40 +00:00
rx_pin:
2023-06-09 19:21:53 +00:00
number: D2 # red control terminal / GarageDoorOpener (UART1 RX) pin is D2 on D1 Mini
2023-06-09 19:20:53 +00:00
inverted: true
2023-06-07 23:26:40 +00:00
baud_rate: 9600
button:
- platform: restart
name: "${friendly_name} Restart"
2023-06-08 16:50:39 +00:00
- platform: safe_mode
name: "${friendly_name} Safe Mode Boot"
entity_category: diagnostic
2023-06-07 23:45:37 +00:00
- platform: ratgdo
id: ${id_prefix}_sync
type: sync
entity_category: diagnostic
ratgdo_id: ${id_prefix}
name: "${friendly_name} Sync"
2023-06-07 23:59:49 +00:00
- platform: ratgdo
id: ${id_prefix}_query
type: query
entity_category: diagnostic
ratgdo_id: ${id_prefix}
name: "${friendly_name} Query"