esphome/doorbell.yaml

76 lines
1.4 KiB
YAML

esphome:
name: swablab-doorbell
friendly_name: Swablab Doorbell
name_add_mac_suffix: True
esp32:
board: esp32dev
# Enable Home Assistant API
api:
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
binary_sensor:
- platform: gpio
id: button
pin:
number: GPIO15
mode:
input: True
pulldown: True
filters:
- delayed_on: 10ms
- delayed_off: 7.75s
on_press:
then:
- output.turn_on: relay_chime
- light.turn_on:
id: ring
red: 0
green: 1
blue: 0.7
effect: pulse
- delay: 2s
- output.turn_off: relay_chime
on_release:
then:
- output.turn_off: relay_chime
- light.turn_off:
id: ring
transition_length: 1s
output:
- platform: ledc
pin: GPIO2
id: led_red
- platform: ledc
pin: GPIO4
id: led_green
- platform: ledc
pin: GPIO16
id: led_blue
- platform: gpio
pin: GPIO12
id: relay_chime
light:
- platform: rgb
id: ring
blue: led_blue
green: led_green
red: led_red
effects:
- pulse:
transition_length: 600ms
update_interval: 600ms
min_brightness: 40%
max_brightness: 100%
default_transition_length:
milliseconds: 200