Embed substitutions
This commit is contained in:
+38
-45
@@ -1,17 +1,10 @@
|
|||||||
substitutions:
|
|
||||||
id_prefix: garage_gate
|
|
||||||
friendly_name: "Garage Gate"
|
|
||||||
uart_tx_pin: GPIO17
|
|
||||||
uart_rx_pin: GPIO21
|
|
||||||
status_door_pin: GPIO26
|
|
||||||
|
|
||||||
web_server:
|
web_server:
|
||||||
include_internal: true
|
include_internal: true
|
||||||
local: true
|
local: true
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
name: garage-gate
|
name: garage-gate
|
||||||
friendly_name: ${friendly_name}
|
friendly_name: "Garage Gate"
|
||||||
name_add_mac_suffix: true
|
name_add_mac_suffix: true
|
||||||
min_version: 2026.2.0
|
min_version: 2026.2.0
|
||||||
project:
|
project:
|
||||||
@@ -44,9 +37,9 @@ preferences:
|
|||||||
flash_write_interval: 1min
|
flash_write_interval: 1min
|
||||||
|
|
||||||
ratgdo:
|
ratgdo:
|
||||||
id: ${id_prefix}
|
id: garage_gate
|
||||||
input_gdo_pin: ${uart_rx_pin}
|
input_gdo_pin: GPIO21
|
||||||
output_gdo_pin: ${uart_tx_pin}
|
output_gdo_pin: GPIO17
|
||||||
|
|
||||||
time:
|
time:
|
||||||
- platform: sntp
|
- platform: sntp
|
||||||
@@ -56,28 +49,28 @@ time:
|
|||||||
|
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_vehicle_detected
|
id: garage_gate_vehicle_detected
|
||||||
type: vehicle_detected
|
type: vehicle_detected
|
||||||
name: "Vehicle detected"
|
name: "Vehicle detected"
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_vehicle_arriving
|
id: garage_gate_vehicle_arriving
|
||||||
type: vehicle_arriving
|
type: vehicle_arriving
|
||||||
name: "Vehicle arriving"
|
name: "Vehicle arriving"
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_vehicle_leaving
|
id: garage_gate_vehicle_leaving
|
||||||
type: vehicle_leaving
|
type: vehicle_leaving
|
||||||
name: "Vehicle leaving"
|
name: "Vehicle leaving"
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_openings
|
id: garage_gate_openings
|
||||||
type: openings
|
type: openings
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
name: "Openings"
|
name: "Openings"
|
||||||
unit_of_measurement: "openings"
|
unit_of_measurement: "openings"
|
||||||
icon: mdi:open-in-app
|
icon: mdi:open-in-app
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_vehicle_distance_actual
|
id: garage_gate_vehicle_distance_actual
|
||||||
type: distance
|
type: distance
|
||||||
name: "Vehicle distance actual"
|
name: "Vehicle distance actual"
|
||||||
unit_of_measurement: "mm"
|
unit_of_measurement: "mm"
|
||||||
@@ -86,7 +79,7 @@ sensor:
|
|||||||
- throttle: 1ms
|
- throttle: 1ms
|
||||||
- heartbeat: 1ms
|
- heartbeat: 1ms
|
||||||
- platform: copy
|
- platform: copy
|
||||||
source_id: ${id_prefix}_vehicle_distance_actual
|
source_id: garage_gate_vehicle_distance_actual
|
||||||
name: Vehicle distance actual filtered
|
name: Vehicle distance actual filtered
|
||||||
filters:
|
filters:
|
||||||
- min:
|
- min:
|
||||||
@@ -104,27 +97,27 @@ sensor:
|
|||||||
|
|
||||||
lock:
|
lock:
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_lock_remotes
|
id: garage_gate_lock_remotes
|
||||||
name: "Lock remotes"
|
name: "Lock remotes"
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: "${id_prefix}_status_door"
|
id: "garage_gate_status_door"
|
||||||
internal: true
|
internal: true
|
||||||
pin:
|
pin:
|
||||||
number: ${status_door_pin}
|
number: GPIO26
|
||||||
mode:
|
mode:
|
||||||
output: true
|
output: true
|
||||||
name: "Status door"
|
name: "Status door"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_led
|
id: garage_gate_led
|
||||||
type: led
|
type: led
|
||||||
pin: GPIO2
|
pin: GPIO2
|
||||||
name: "LED"
|
name: "LED"
|
||||||
entity_category: config
|
entity_category: config
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_laser
|
id: garage_gate_laser
|
||||||
type: led
|
type: led
|
||||||
pin: GPIO23
|
pin: GPIO23
|
||||||
name: "LASER"
|
name: "LASER"
|
||||||
@@ -132,39 +125,39 @@ switch:
|
|||||||
|
|
||||||
number:
|
number:
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_rolling_code_counter
|
id: garage_gate_rolling_code_counter
|
||||||
type: rolling_code_counter
|
type: rolling_code_counter
|
||||||
entity_category: config
|
entity_category: config
|
||||||
name: "Rolling code counter"
|
name: "Rolling code counter"
|
||||||
mode: box
|
mode: box
|
||||||
unit_of_measurement: "codes"
|
unit_of_measurement: "codes"
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_opening_duration
|
id: garage_gate_opening_duration
|
||||||
type: opening_duration
|
type: opening_duration
|
||||||
entity_category: config
|
entity_category: config
|
||||||
name: "Opening duration"
|
name: "Opening duration"
|
||||||
unit_of_measurement: "s"
|
unit_of_measurement: "s"
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_closing_duration
|
id: garage_gate_closing_duration
|
||||||
type: closing_duration
|
type: closing_duration
|
||||||
entity_category: config
|
entity_category: config
|
||||||
name: "Closing duration"
|
name: "Closing duration"
|
||||||
unit_of_measurement: "s"
|
unit_of_measurement: "s"
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_client_id
|
id: garage_gate_client_id
|
||||||
type: client_id
|
type: client_id
|
||||||
entity_category: config
|
entity_category: config
|
||||||
name: "Client ID"
|
name: "Client ID"
|
||||||
mode: box
|
mode: box
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_target_distance_measurement
|
id: garage_gate_target_distance_measurement
|
||||||
type: target_distance_measurement
|
type: target_distance_measurement
|
||||||
entity_category: config
|
entity_category: config
|
||||||
name: "Vehicle distance target"
|
name: "Vehicle distance target"
|
||||||
mode: box
|
mode: box
|
||||||
unit_of_measurement: "mm"
|
unit_of_measurement: "mm"
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_closing_delay
|
id: garage_gate_closing_delay
|
||||||
type: closing_delay
|
type: closing_delay
|
||||||
entity_category: config
|
entity_category: config
|
||||||
name: "Closing Delay"
|
name: "Closing Delay"
|
||||||
@@ -172,62 +165,62 @@ number:
|
|||||||
|
|
||||||
cover:
|
cover:
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_garage_door
|
id: garage_gate_garage_door
|
||||||
device_class: garage
|
device_class: garage
|
||||||
name: "Door"
|
name: "Door"
|
||||||
on_closed:
|
on_closed:
|
||||||
- switch.turn_off: ${id_prefix}_status_door
|
- switch.turn_off: garage_gate_status_door
|
||||||
on_opened:
|
on_opened:
|
||||||
- switch.turn_on: ${id_prefix}_status_door
|
- switch.turn_on: garage_gate_status_door
|
||||||
|
|
||||||
light:
|
light:
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_light
|
id: garage_gate_light
|
||||||
name: "Light"
|
name: "Light"
|
||||||
|
|
||||||
button:
|
button:
|
||||||
- platform: template
|
- platform: template
|
||||||
id: ${id_prefix}_query_status
|
id: garage_gate_query_status
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
name: "Query status"
|
name: "Query status"
|
||||||
on_press:
|
on_press:
|
||||||
then:
|
then:
|
||||||
lambda: !lambda |-
|
lambda: !lambda |-
|
||||||
id($id_prefix).query_status();
|
id(garage_gate).query_status();
|
||||||
- platform: template
|
- platform: template
|
||||||
id: ${id_prefix}_query_openings
|
id: garage_gate_query_openings
|
||||||
name: "Query openings"
|
name: "Query openings"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
on_press:
|
on_press:
|
||||||
then:
|
then:
|
||||||
lambda: !lambda |-
|
lambda: !lambda |-
|
||||||
id($id_prefix).query_openings();
|
id(garage_gate).query_openings();
|
||||||
- platform: template
|
- platform: template
|
||||||
id: ${id_prefix}_sync
|
id: garage_gate_sync
|
||||||
name: "Sync"
|
name: "Sync"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
on_press:
|
on_press:
|
||||||
then:
|
then:
|
||||||
lambda: !lambda |-
|
lambda: !lambda |-
|
||||||
id($id_prefix).sync();
|
id(garage_gate).sync();
|
||||||
- platform: template
|
- platform: template
|
||||||
id: ${id_prefix}_toggle_door
|
id: garage_gate_toggle_door
|
||||||
name: "Toggle door"
|
name: "Toggle door"
|
||||||
on_press:
|
on_press:
|
||||||
then:
|
then:
|
||||||
lambda: !lambda |-
|
lambda: !lambda |-
|
||||||
id($id_prefix).door_toggle();
|
id(garage_gate).door_toggle();
|
||||||
|
|
||||||
output:
|
output:
|
||||||
- platform: ledc
|
- platform: ledc
|
||||||
pin: GPIO33
|
pin: GPIO33
|
||||||
id: ${id_prefix}_ledc
|
id: garage_gate_ledc
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_beeper
|
id: garage_gate_beeper
|
||||||
type: beeper
|
type: beeper
|
||||||
rtttl: ${id_prefix}_rtttl
|
rtttl: garage_gate_rtttl
|
||||||
song: "alert:d=8,o=5,b=120:a,p,a,p,a,p,4b,p"
|
song: "alert:d=8,o=5,b=120:a,p,a,p,a,p,4b,p"
|
||||||
|
|
||||||
rtttl:
|
rtttl:
|
||||||
- id: ${id_prefix}_rtttl
|
- id: garage_gate_rtttl
|
||||||
output: ${id_prefix}_ledc
|
output: garage_gate_ledc
|
||||||
|
|||||||
Reference in New Issue
Block a user