esphome-ratgdo/base.yml

141 lines
3.4 KiB
YAML

---
esphome:
name: ${id_prefix}
friendly_name: ${friendly_name}
name_add_mac_suffix: true
project:
name: ratgdo.esphome
version: "1.0"
esp8266:
board: d1_mini_lite
restore_from_flash: true
external_components:
- source:
type: git
url: https://github.com/esphome-ratgdo/esphome-ratgdo
ref: dev
refresh: 1s
ratgdo:
id: ${id_prefix}
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
- platform: ratgdo
type: motor
id: ${id_prefix}_motor
ratgdo_id: ${id_prefix}
name: "${friendly_name} Motor"
device_class: running
entity_category: diagnostic
- platform: gpio
id: "${id_prefix}_dry_contact_open"
pin:
number: D5 # D5 dry contact for opening door
inverted: true
mode:
input: true
pullup: true
name: "${friendly_name} Dry contact open"
entity_category: diagnostic
on_press:
- if:
condition:
binary_sensor.is_off: ${id_prefix}_dry_contact_close
then:
- cover.open: ${id_prefix}_garage
- platform: gpio
id: "${id_prefix}_dry_contact_close"
pin:
number: D6 # D6 dry contact for closing door
inverted: true
mode:
input: true
pullup: true
name: "${friendly_name} Dry contact close"
entity_category: diagnostic
on_press:
- if:
condition:
binary_sensor.is_off: ${id_prefix}_dry_contact_open
then:
- cover.close: ${id_prefix}_garage
- platform: gpio
id: "${id_prefix}_dry_contact_light"
pin:
number: D3 # D3 dry contact for triggering light (no discrete light commands, so toggle only)
inverted: true
mode:
input: true
pullup: true
name: "${friendly_name} Dry contact light"
entity_category: diagnostic
on_press:
- light.toggle: ${id_prefix}_light
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"
mode: box
unit_of_measurement: "codes"
cover:
- platform: ratgdo
id: ${id_prefix}_garage
device_class: garage
name: ${friendly_name}
ratgdo_id: ${id_prefix}
light:
- platform: ratgdo
id: ${id_prefix}_light
name: "${friendly_name} Light"
ratgdo_id: ${id_prefix}
uart:
tx_pin:
number: D4 # red control terminal / GarageDoorOpener (UART1 TX) pin is D4 on D1 Mini
inverted: true
rx_pin:
number: D2 # red control terminal / GarageDoorOpener (UART1 RX) pin is D2 on D1 Mini
inverted: true
baud_rate: 9600
button:
- platform: restart
name: "${friendly_name} Restart"
- platform: safe_mode
name: "${friendly_name} Safe Mode Boot"
entity_category: diagnostic
- platform: ratgdo
id: ${id_prefix}_sync
type: sync
entity_category: diagnostic
ratgdo_id: ${id_prefix}
name: "${friendly_name} Sync"
- platform: ratgdo
id: ${id_prefix}_query
type: query
entity_category: diagnostic
ratgdo_id: ${id_prefix}
name: "${friendly_name} Query"