Page 1 of 1

Make standard doorbell smart

Posted: Thursday 02 December 2021 23:20
by theo11
Hi all,

I want to share my project.
I was inspired by a project at reichelt https://www.reichelt.com/magazin/nl/zel ... bel-maken/ based on ESP8266.
I changed it, because I have already a Raspberry Pi for smart meter reading.

What is it?
The standard doorbell is connected to a GPIO input of the raspbery PI.
When I am in the garden and someone pushes the doorbell button, a telegram message will be sent to my iPhone.

Hardware
Schema.png
Schema.png (48.8 KiB) Viewed 1659 times
Note: change the R1 resistor based transformer voltage
- 8V: 330 Ohm
- 12v: 560 Ohm
- 24V: 1.2 K Ohm

Software
Create a script, GPIO 4 as input and save it in a sh script:

Code: Select all

#!/bin/bash
# Delete gpio4 device
echo 4 >/sys/class/gpio/unexport
# Create gpio4 device
echo 4 >/sys/class/gpio/export
# Active low
echo 1 > /sys/class/gpio/gpio4/active_low
# Gpio4 as input
echo in >/sys/class/gpio/gpio4/direction
# Edge
echo both > /sys/class/gpio/gpio4/edge
Add this script to your rc.local

Domoticz
Add sysgpio Hardware
sysgpio.png
sysgpio.png (191.37 KiB) Viewed 1659 times
After this a doorbell (deurbel) device is created.
Create telegram notification message:
Send Telegram.png
Send Telegram.png (269.97 KiB) Viewed 1659 times

It works like a charm. :D

Re: Make standard doorbell smart

Posted: Tuesday 21 December 2021 13:53
by jon205
I did almost the same. My original doorbel pushbutton is connected to a KaKa doorbell. When the button is pushed, I get a telegram message including a picture of the camera pointed at the front door. I put this all in a script that is triggered when the button is pushed. So the telegram message is a 'curl' command. Same result, different route. Nice to see I'm not the only fool with these ideas.

I forgot, I have a doorsensor behind the lid of the mailbox. This triggers another script that sends a telegram message.

Code: Select all

SnapFile="web.jpg"
# Get snapshot via Domoticz server
sudo wget $SnapFile "http://*.*.*.*/cgi-bin/getsnapshot.cgi"
sudo mv getsnapshot.cgi web.jpg
# Send Telegram message with image
curl -s -X POST "https://api.telegram.org/bot*****:AAHolpBHeBMFgqhH*******/sendPhoto" -F chat_id=***** -F photo="@$SnapFile" -F caption="Post!"
# Remove Image
sudo rm $SnapFile