Skip to content

Instantly share code, notes, and snippets.

@giannoug
Created January 19, 2024 19:19
Show Gist options
  • Save giannoug/16049753002292f5ddb1f7754a6ca3dd to your computer and use it in GitHub Desktop.
Save giannoug/16049753002292f5ddb1f7754a6ca3dd to your computer and use it in GitHub Desktop.
A simple doorbell implementation using LC Technology AC90V-250V 1 Channel Relay Board (ESP32_Relay X1)
esphome:
name: doorbell
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "OZiMJHYkcvBkDaT9kOx9cMXZkADXrV7u/AEdh4/dPe8="
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "doorbell"
password: "SupG8MKsFgCM"
captive_portal:
web_server:
port: 80
status_led:
pin:
number: GPIO23
switch:
- platform: gpio
name: Relay
pin: GPIO16
i2s_audio:
- id: i2s_out
i2s_lrclk_pin: GPIO14
i2s_bclk_pin: GPIO27
# speaker:
# - platform: i2s_audio
# dac_type: external
# i2s_dout_pin: GPIO25
# mode: mono
media_player:
- platform: i2s_audio
name: ESPHome I2S Media Player
dac_type: external
i2s_audio_id: i2s_out
i2s_dout_pin: GPIO25
button:
- platform: template
name: "Push Button"
on_press:
- media_player.play_media: 'https://www.soundjay.com/door/doorbell-1.mp3'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment