Created
August 29, 2025 11:37
-
-
Save ngxson/92f826f5ba324bb1be8ad158f71a8344 to your computer and use it in GitHub Desktop.
ESPHome door lock + interphone demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: wifi configs are not included | |
esphome: | |
name: # you name it | |
comment: # you name it | |
esp32: | |
variant: esp32 | |
switch: | |
- platform: template | |
id: interphone_auto | |
name: "Interphone Auto" | |
optimistic: true | |
on_turn_off: | |
- output.turn_off: interphone_unlock_pin | |
- output.turn_off: interphone_pickup_pin | |
- output.turn_off: status_light | |
output: | |
- platform: gpio | |
pin: GPIO4 | |
id: interphone_pickup_pin | |
- platform: gpio | |
pin: GPIO13 | |
id: interphone_unlock_pin | |
- platform: gpio | |
pin: GPIO12 | |
id: door_indicator_locked # green | |
- platform: gpio | |
pin: GPIO14 | |
id: door_indicator_unlocked # red | |
- platform: gpio | |
pin: GPIO33 | |
id: status_light | |
binary_sensor: | |
- platform: gpio | |
pin: | |
number: GPIO32 | |
mode: | |
input: true | |
pulldown: true | |
id: main_door_lock | |
name: "Main Door Lock" | |
device_class: lock | |
trigger_on_initial_state: true | |
filters: | |
- delayed_on_off: | |
time_on: 100ms | |
time_off: 100ms | |
on_release: | |
then: | |
- output.turn_on: door_indicator_locked | |
- output.turn_off: door_indicator_unlocked | |
on_press: | |
then: | |
- output.turn_off: door_indicator_locked | |
- output.turn_on: door_indicator_unlocked | |
interval: | |
- interval: 10s | |
then: | |
if: | |
condition: | |
switch.is_on: interphone_auto | |
then: | |
- output.turn_on: interphone_pickup_pin | |
- delay: 800ms | |
- output.turn_on: interphone_unlock_pin | |
- output.turn_on: status_light | |
- delay: 100ms | |
- output.turn_off: interphone_unlock_pin | |
- output.turn_off: status_light | |
- delay: 500ms | |
- output.turn_off: interphone_pickup_pin | |
- logger.log: "Done Interphone sequence" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment