I wanted a small device for the doorbell ring/door opener, this required two relays, and since I swapped the loratap for a SONOFF dual r3 in the past for the curtain switch (position control) I had this loratap laying around.
I cut traces, MANY OF THEM, and soldered cables, and found some code online.
Now its working,
Flashing wiring:
Source: LoraTap In-Wall Curtain Module (SC500W) Configuration for Tasmota
Also for the code Its based on another code I found online with some modifications to modify the pushed times of the buttons and to enable the door opener.
Source: https://www.zuidwijk.com/esphome-based-doorbell/
esphome:
name: telefonillo
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "xxxxxxx"
ota:
password: "xxxxxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Telefonillo Fallback Hotspot"
password: "xxxxxxxx"
captive_portal:
text_sensor:
- platform: template
name: Uptime Human Readable
id: uptime_human
icon: mdi:clock-start
- platform: wifi_info
ip_address:
name: Telefonillo IP
ssid:
name: Telefonillo SSID
bssid:
name: Telefonillo BSSID
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
- platform: uptime
name: Uptime Sensor
id: uptime_sensor
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
status_led:
pin:
number: GPIO3
inverted: false
###################
globals:
- id: chime
type: bool
restore_value: true
initial_value: 'true'
switch:
- platform: restart
name: "Telefonillo Restart"
- platform: gpio
pin: GPIO12
name: "Abridor Puerta"
icon: mdi:door-closed
restore_mode: always_off
id: r1
on_turn_on:
- delay: 2000ms
- switch.turn_off: r1
- platform: gpio
pin: GPIO14
name: "Telefonillo"
icon: mdi:bell
restore_mode: always_off
id: r2
on_turn_on:
- delay: 2000ms
- switch.turn_off: r2
- platform: template
name: "Telefonillo Timbre Activado"
icon: mdi:alarm-bell
id: chime_active
restore_state: false
turn_on_action:
- globals.set:
id: chime
value: 'true'
turn_off_action:
- globals.set:
id: chime
value: 'false'
lambda: |-
return id(chime);
binary_sensor:
- platform: gpio
pin:
number: GPIO13
#Externall pullup fitted, un-coment if using a decent board with proper internall pullups.
# mode: INPUT_PULLUP
inverted: True
name: "Telefonillo"
icon: mdi:gesture-tap-button
on_press:
then:
if:
condition:
- switch.is_on: chime_active
then:
- switch.turn_on: r2
- delay: 2000ms
- switch.turn_off: r2
filters:
- delayed_on: 35ms
- delayed_off: 3000ms
- platform: status
name: "Status Telefonillo"
Panel
Device