From 46166eaa2fa66970dbcd8854df92c6fa924f7fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Grondek?= Date: Thu, 28 Mar 2024 13:48:34 +0100 Subject: [PATCH] Add configuration for esphome --- hs-elevator.yaml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 hs-elevator.yaml diff --git a/hs-elevator.yaml b/hs-elevator.yaml new file mode 100644 index 0000000..e9e4ee5 --- /dev/null +++ b/hs-elevator.yaml @@ -0,0 +1,65 @@ +esphome: + name: hs-elevator + friendly_name: hs-elevator + +esp32: + board: esp32dev + framework: + type: arduino + +# Enable logging +logger: + +uart: + tx_pin: 1 + rx_pin: 3 + baud_rate: 9600 + +dfplayer: + +binary_sensor: + - platform: gpio + pin: 25 + id: button + on_click: + then: + - switch.toggle: light_relay + - platform: gpio + id: lock_status + pin: 14 + on_release: + then: + - switch.turn_on: fan_relay + - delay: 5min + - if: + condition: + - binary_sensor.is_off: lock_status + then: + - switch.turn_off: fan_relay + +switch: + - platform: gpio + id: light_relay + pin: 26 + on_turn_on: + then: + - dfplayer.play_folder: + folder: 1 + loop: true + - switch.turn_off: down_led + - switch.turn_on: up_led + on_turn_off: + then: + - dfplayer.stop + - switch.turn_off: up_led + - switch.turn_on: down_led + - platform: gpio + id: fan_relay + pin: 27 + - platform: gpio + id: up_led + pin: 32 + - platform: gpio + id: down_led + pin: 33 +