From 836c2e20a4df425ab05f56eb48011c9cd3919b8c Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Sat, 22 Mar 2025 20:05:35 +0000 Subject: [PATCH] feat: add doorbell config --- doorbell.yaml | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 doorbell.yaml diff --git a/doorbell.yaml b/doorbell.yaml new file mode 100644 index 0000000..45175f7 --- /dev/null +++ b/doorbell.yaml @@ -0,0 +1,76 @@ +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: 16 + mode: + input: True + pulldown: True + filters: + - delayed_on: 10ms + - delayed_off: 10ms + on_press: + then: + - light.turn_on: + id: ring + red: 0 + green: 0.5 + blue: 1 + effect: pulse + - delay: 4s + - light.turn_off: ring + - light.turn_on: + id: ring + red: 1 + green: 0 + blue: 0 + - delay: 1s + - light.turn_off: ring + +output: + - platform: ledc + pin: 15 + id: led_red + - platform: ledc + pin: 2 + id: led_green + - platform: ledc + pin: 4 + id: led_blue + - platform: gpio + pin: 17 + id: relay_door + +light: + - platform: rgb + id: ring + blue: led_blue + green: led_green + red: led_red + effects: + - pulse: + transition_length: 250ms + update_interval: 500ms + min_brightness: 10% + max_brightness: 100% + default_transition_length: + milliseconds: 100