elevator-control/hs-elevator.yaml

67 lines
1.1 KiB
YAML
Raw Normal View History

2024-03-28 12:48:34 +00:00
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:
2024-03-28 12:48:34 +00:00
then:
- switch.toggle: light_relay
- platform: gpio
id: lock_status
pin: 14
on_state:
2024-03-28 12:48:34 +00:00
then:
- dfplayer.play_folder:
folder: 1
loop: true
on_release:
then:
- dfplayer.stop
2024-03-28 12:48:34 +00:00
- switch.turn_on: fan_relay
- delay: 5min
- if:
condition:
- binary_sensor.is_off: lock_status
2024-03-28 12:48:34 +00:00
then:
- switch.turn_off: fan_relay
switch:
- platform: gpio
id: light_relay
pin: 26
on_turn_on:
2024-03-28 12:48:34 +00:00
then:
- switch.turn_off: down_led
2024-03-28 12:48:34 +00:00
- switch.turn_on: up_led
on_turn_off:
2024-03-28 12:48:34 +00:00
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