Skip to content

Instantly share code, notes, and snippets.

@robbi5
Last active June 19, 2023 22:25
Show Gist options
  • Save robbi5/737ce8cde2732e3e71a321a8c1796a8c to your computer and use it in GitHub Desktop.
Save robbi5/737ce8cde2732e3e71a321a8c1796a8c to your computer and use it in GitHub Desktop.
Nuki Opener, but as ESPHome device

ESP based door buzzer (for intercoms, like nuki opener)

  • Create a new device in ESPHome, use the contents from esphome.yml as template
  • Create a new automation in your homeassistant, use buzz-open.automation.yml as template

Device

Connect a transistor / relais controlling your intercom buzzer line to GPIO D2 of your esp.

Webhook

Look into https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger for documentation.

Tl;dr: Call https://<your-home-assistant>:8123/api/webhook/door-buzzer if your instance is reachable by your device directly (e.g. using wireguard / tailscale or dyndns), or use the unique Nabu Casa Webhook URL like on https://www.nabucasa.com/config/webhooks/#triggering-automation-with-a-webhook

alias: Remote Door Buzzer
trigger:
- platform: webhook
webhook_id: door-buzzer
allowed_methods:
- POST
local_only: false
condition: []
action:
- service: switch.turn_on
data:
entity_id: switch.door_buzzer
- delay: "00:00:04"
- service: switch.turn_off
data:
entity_id: switch.door_buzzer
- service: notify.notify
data:
message: Door buzzered
esphome:
name: door
platform: ESP8266
board: nodemcuv2
wifi:
ssid: '...'
password: '...'
logger:
ota:
api:
switch:
- platform: gpio
pin: D2
id: gpio_d2
name: "Door Buzzer (internal)"
discovery: false
- platform: template
name: "Door Buzzer"
icon: "mdi:access-point"
turn_on_action:
- switch.turn_on:
id: gpio_d2
- delay: 5s
- switch.turn_off:
id: gpio_d2
turn_off_action:
- switch.turn_off:
id: gpio_d2
optimistic: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment