Add configuration for esphome

This commit is contained in:
Przemek Grondek 2024-03-28 13:48:34 +01:00
commit 46166eaa2f

65
hs-elevator.yaml Normal file
View File

@ -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