elevator-control/hs-elevator.yaml

67 lines
1.1 KiB
YAML

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_state:
then:
- dfplayer.play_folder:
folder: 1
loop: true
on_release:
then:
- dfplayer.stop
- 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:
- switch.turn_off: down_led
- switch.turn_on: up_led
on_turn_off:
then:
- 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