I’ve done it. Yippie!
I created a solution using an ESPHome Arduino (specifically, a NodeMCU Amica Module V2 ESP8266) and a relay module (5V KY-019 High-Level Trigger). It took a bit of effort, but the solution turned out to be straightforward. Btw. arduino and relais fit perfectly into the phone. However, the power for the arduino comes from outside.
I connected the relay in a way that it works alongside the button (to the Normally Open and Middle Pin connections) and then hooked it up to the microcontroller (to the 3.3V power, ground, and GPIO2 pin). This setup allows me to activate the button either manually or through a smart home platform called Home Assistant.
I also connected the two wires of an LED light to the microcontroller (to the ground and GPIO4 pin). Even though the LED only requires 2.3V to work, it functions perfectly, helping me know if the door is open or closed.
Finally I connected a digital noise sensor. This is not a perfect solution, as it is also activated by other loud noises. But as I only want to be notified when we are not in the house this doesn’t matter.
I honestly did not care about good cable management, as it is hidden anyway.
The blue and green LED-color is due to the NodeMCU and the sound sensor. As a true gamer I am however happy with this unexpected result. RGB ftw.
Here’s the code I used for setting up the ESPHome:
esphome:
name: interkom
friendly_name: interkom
esp8266:
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "redacted"
ota:
password: "redacted"
wifi:
networks:
- ssid: "redacted"
password: "redacted"
- ssid: "redacted"
password: "redacted"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "redacted"
password: "redacted"
captive_portal:
switch:
- platform: gpio
id: open_relay
name: "GateOpener"
restore_mode: ALWAYS_OFF
pin: GPIO2
on_turn_on:
then:
- delay: 1000ms
- switch.turn_off: open_relay
binary_sensor:
- platform: gpio
pin: GPIO4
name: "GateStatus"
filters:
- delayed_on: 500ms #Just to besure
- platform: gpio
pin: D7
name: "BellRings"