254 lines
5.3 KiB
YAML
254 lines
5.3 KiB
YAML
substitutions:
|
|
id_prefix: garage_gate
|
|
friendly_name: "Garage Gate"
|
|
uart_tx_pin: GPIO17
|
|
uart_rx_pin: GPIO21
|
|
status_door_pin: GPIO26
|
|
|
|
web_server:
|
|
include_internal: true
|
|
local: true
|
|
|
|
esphome:
|
|
name: garage-gate
|
|
friendly_name: ${friendly_name}
|
|
name_add_mac_suffix: true
|
|
min_version: 2026.2.0
|
|
project:
|
|
name: ratgdo.v32disco_secplus2
|
|
version: "32disco"
|
|
|
|
esp32:
|
|
board: esp32dev
|
|
framework:
|
|
type: arduino
|
|
|
|
external_components:
|
|
- source:
|
|
type: local
|
|
path: components
|
|
components: [ ratgdo ]
|
|
|
|
packages:
|
|
wifi: !include templates/wifi.yaml
|
|
mqtt: !include templates/mqtt.yaml
|
|
ota: !include templates/ota.yaml
|
|
uptime: !include templates/uptime.yaml
|
|
restart: !include templates/restart.yaml
|
|
syslog: !include templates/syslog.yaml
|
|
time: !include templates/time.yaml
|
|
|
|
safe_mode:
|
|
|
|
preferences:
|
|
flash_write_interval: 1min
|
|
|
|
ratgdo:
|
|
id: ${id_prefix}
|
|
input_gdo_pin: ${uart_rx_pin}
|
|
output_gdo_pin: ${uart_tx_pin}
|
|
|
|
ota:
|
|
- platform: web_server
|
|
id: ${id_prefix}_ratgdo_ota_ws
|
|
|
|
time:
|
|
- platform: sntp
|
|
id: sntp_time
|
|
servers: !secret sntp_servers
|
|
timezone: Europe/Zurich
|
|
|
|
improv_serial:
|
|
|
|
esp32_improv:
|
|
authorizer: none
|
|
|
|
wifi:
|
|
ap:
|
|
ssid: "ratgdo"
|
|
|
|
captive_portal:
|
|
|
|
logger:
|
|
baud_rate: 115200
|
|
logs:
|
|
sensor: NONE
|
|
|
|
binary_sensor:
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_vehicle_detected
|
|
type: vehicle_detected
|
|
name: "Vehicle detected"
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_vehicle_arriving
|
|
type: vehicle_arriving
|
|
name: "Vehicle arriving"
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_vehicle_leaving
|
|
type: vehicle_leaving
|
|
name: "Vehicle leaving"
|
|
|
|
sensor:
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_openings
|
|
type: openings
|
|
entity_category: diagnostic
|
|
name: "Openings"
|
|
unit_of_measurement: "openings"
|
|
icon: mdi:open-in-app
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_vehicle_distance_actual
|
|
type: distance
|
|
name: "Vehicle distance actual"
|
|
unit_of_measurement: "mm"
|
|
internal: true
|
|
filters:
|
|
- throttle: 1ms
|
|
- heartbeat: 1ms
|
|
- platform: copy
|
|
source_id: ${id_prefix}_vehicle_distance_actual
|
|
name: Vehicle distance actual filtered
|
|
filters:
|
|
- min:
|
|
window_size: 5000
|
|
send_every: 5000
|
|
- platform: adc
|
|
pin: GPIO34
|
|
name: "Voltage"
|
|
attenuation: auto
|
|
update_interval: 60s
|
|
filters:
|
|
- calibrate_linear:
|
|
- 1.16 -> 5
|
|
- 2.783 -> 12
|
|
|
|
lock:
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_lock_remotes
|
|
name: "Lock remotes"
|
|
|
|
switch:
|
|
- platform: gpio
|
|
id: "${id_prefix}_status_door"
|
|
internal: true
|
|
pin:
|
|
number: ${status_door_pin}
|
|
mode:
|
|
output: true
|
|
name: "Status door"
|
|
entity_category: diagnostic
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_led
|
|
type: led
|
|
pin: GPIO2
|
|
name: "LED"
|
|
entity_category: config
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_laser
|
|
type: led
|
|
pin: GPIO23
|
|
name: "LASER"
|
|
entity_category: config
|
|
|
|
number:
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_rolling_code_counter
|
|
type: rolling_code_counter
|
|
entity_category: config
|
|
name: "Rolling code counter"
|
|
mode: box
|
|
unit_of_measurement: "codes"
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_opening_duration
|
|
type: opening_duration
|
|
entity_category: config
|
|
name: "Opening duration"
|
|
unit_of_measurement: "s"
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_closing_duration
|
|
type: closing_duration
|
|
entity_category: config
|
|
name: "Closing duration"
|
|
unit_of_measurement: "s"
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_client_id
|
|
type: client_id
|
|
entity_category: config
|
|
name: "Client ID"
|
|
mode: box
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_target_distance_measurement
|
|
type: target_distance_measurement
|
|
entity_category: config
|
|
name: "Vehicle distance target"
|
|
mode: box
|
|
unit_of_measurement: "mm"
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_closing_delay
|
|
type: closing_delay
|
|
entity_category: config
|
|
name: "Closing Delay"
|
|
unit_of_measurement: "s"
|
|
|
|
cover:
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_garage_door
|
|
device_class: garage
|
|
name: "Door"
|
|
on_closed:
|
|
- switch.turn_off: ${id_prefix}_status_door
|
|
on_opened:
|
|
- switch.turn_on: ${id_prefix}_status_door
|
|
|
|
light:
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_light
|
|
name: "Light"
|
|
|
|
button:
|
|
- platform: template
|
|
id: ${id_prefix}_query_status
|
|
entity_category: diagnostic
|
|
name: "Query status"
|
|
on_press:
|
|
then:
|
|
lambda: !lambda |-
|
|
id($id_prefix).query_status();
|
|
- platform: template
|
|
id: ${id_prefix}_query_openings
|
|
name: "Query openings"
|
|
entity_category: diagnostic
|
|
on_press:
|
|
then:
|
|
lambda: !lambda |-
|
|
id($id_prefix).query_openings();
|
|
- platform: template
|
|
id: ${id_prefix}_sync
|
|
name: "Sync"
|
|
entity_category: diagnostic
|
|
on_press:
|
|
then:
|
|
lambda: !lambda |-
|
|
id($id_prefix).sync();
|
|
- platform: template
|
|
id: ${id_prefix}_toggle_door
|
|
name: "Toggle door"
|
|
on_press:
|
|
then:
|
|
lambda: !lambda |-
|
|
id($id_prefix).door_toggle();
|
|
|
|
output:
|
|
- platform: ledc
|
|
pin: GPIO33
|
|
id: ${id_prefix}_ledc
|
|
- platform: ratgdo
|
|
id: ${id_prefix}_beeper
|
|
type: beeper
|
|
rtttl: ${id_prefix}_rtttl
|
|
song: "alert:d=8,o=5,b=120:a,p,a,p,a,p,4b,p"
|
|
|
|
rtttl:
|
|
- id: ${id_prefix}_rtttl
|
|
output: ${id_prefix}_ledc
|