From 3c389f912ca4f517d619b5c1657d9925ece3e687 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 30 Apr 2025 01:18:15 +0200 Subject: [PATCH] Add esphome --- esphome/.gitignore | 5 ++++ esphome/door.yaml | 56 ++++++++++++++++++++++++++++++++++++++++ esphome/secrets.yaml.gpg | 2 ++ 3 files changed, 63 insertions(+) create mode 100644 esphome/.gitignore create mode 100644 esphome/door.yaml create mode 100644 esphome/secrets.yaml.gpg diff --git a/esphome/.gitignore b/esphome/.gitignore new file mode 100644 index 0000000..d8b4157 --- /dev/null +++ b/esphome/.gitignore @@ -0,0 +1,5 @@ +# Gitignore settings for ESPHome +# This is an example and may include too much for your use-case. +# You can modify this file to suit your needs. +/.esphome/ +/secrets.yaml diff --git a/esphome/door.yaml b/esphome/door.yaml new file mode 100644 index 0000000..28b348f --- /dev/null +++ b/esphome/door.yaml @@ -0,0 +1,56 @@ +esphome: + name: "door" + friendly_name: "Door" + platform: ESP32 + board: esp-wrover-kit + +api: + encryption: + key: !secret apikey_door + +ota: + - platform: esphome + password: !secret otapass_door + +ethernet: + type: LAN8720 + mdc_pin: GPIO23 + mdio_pin: GPIO18 + clk_mode: GPIO0_IN + phy_addr: 1 + power_pin: GPIO16 + +logger: + +output: + - platform: gpio + pin: GPIO2 + id: output_relay + +button: + - platform: template + name: "door opener" + id: btn_door_opener + icon: mdi:lock-open + on_press: + - output.turn_on: output_relay + - delay: 2s + - output.turn_off: output_relay + +time: + - platform: sntp + id: sntp_time + timezone: Europe/Berlin + servers: + - 0.pool.ntp.org + - 1.pool.ntp.org + - 2.pool.ntp.org + +wireguard: + address: 10.20.16.2 + private_key: !secret wireguard_key_door + peer_endpoint: jalr-bw.duckdns.org + peer_public_key: Ew25M4+OxfBGfW3g98m2chq+TIgWhxpVulrsuFmwOic= + netmask: 255.255.255.252 + peer_port: 51001 + peer_persistent_keepalive: 120s diff --git a/esphome/secrets.yaml.gpg b/esphome/secrets.yaml.gpg new file mode 100644 index 0000000..1c22600 --- /dev/null +++ b/esphome/secrets.yaml.gpg @@ -0,0 +1,2 @@ +^ci5V@#kf18^dCjMZДeb0J>PpP*)͡OD%D20 H2 vzF?yL3!KӊE,|%tc4pZ#6ԠkoMx|eV_9S}7ҦןBԃ]stvax>pj%ZY^_pV[Mh#b=ݠ3~:{ +oLOՕMtC<arZ&u, =zAc>#lZOM@i̠)u; \ No newline at end of file