My [Hac!ked] wireless Doorbell
Posted: Monday 28 March 2016 22:18
Hi here... Thought i would show a nice little project i just did recently
(I recently finished my HomeBox, and now i decided to do a HomeBox2) viewtopic.php?f=38&t=9138
https://youtu.be/3NqnNMTzxsE
Aldi just got a offer for a wireless doorbell, which i ran and bought for 20Eur.

After less than half an hour, the warranty was broke, and i soldered two wires on the traces where the blue led's are triggered, when the bell is triggered.


So, when bell is triggered, it sends a signal through an optocoupler into one of the Raspberry's GPIO pins, executing a script, and then the whole world is open for possibilities
I tested everything, and build everything into a box...
All the other stuff is for recieving DHT22 temp+humidity, but that's another story!

Right now, one of my Hue's is flashing, TV is muted and bling bling.. when somebody rings at the front door!
So it's soo fun to make these thing cheaply, and integrate into Domoticz too

Script was a little tricky, while it's executed a lot of times, so i have to do something which is checking and controlling that !
What to you think ?
Rgds; Jesper.

(I recently finished my HomeBox, and now i decided to do a HomeBox2) viewtopic.php?f=38&t=9138
https://youtu.be/3NqnNMTzxsE
Aldi just got a offer for a wireless doorbell, which i ran and bought for 20Eur.

After less than half an hour, the warranty was broke, and i soldered two wires on the traces where the blue led's are triggered, when the bell is triggered.


So, when bell is triggered, it sends a signal through an optocoupler into one of the Raspberry's GPIO pins, executing a script, and then the whole world is open for possibilities

I tested everything, and build everything into a box...
All the other stuff is for recieving DHT22 temp+humidity, but that's another story!

Right now, one of my Hue's is flashing, TV is muted and bling bling.. when somebody rings at the front door!
So it's soo fun to make these thing cheaply, and integrate into Domoticz too


Script was a little tricky, while it's executed a lot of times, so i have to do something which is checking and controlling that !
Code: Select all
#!/bin/bash
SCRIPTDIR=/home/pi/scripts/doorbell
# Telegram
TOKEN=xxx......xxx....xxx
TEXT="HEY... DOORBELL"
CHAT_ID=xxxxxxxx
RSER=192.168.1.xxx
RSER_PORT=xxxx
RIDX=71
SLEEPTIME=60 # Must be set to minimum time of MP3 tune (Seconds)
UNIXTIME=$(date +%s) # %s seconds since 1970-01-01 00:00:00 UTC
TIME1=$SCRIPTDIR/TIME1
if [ ! -e $TIME1 ]; then
touch $TIME1
let INIT_TIME=($UNIXTIME+$SLEEPTIME)
echo $INIT_TIME > $TIME1
fi
UNIXTIME1=$(cat $TIME1)
if [ $UNIXTIME -gt $UNIXTIME1 ]; then
let UNIXTIME2=($UNIXTIME+$SLEEPTIME)
echo $UNIXTIME2 > $TIME1
curl -s -X POST https://api.telegram.org/bot$TOKEN/sendMessage -d text="$TEXT" -d chat_id=$CHAT_ID
sleep 0.3
curl -s -i -H "Accept: application/json" "http://$RSER:$RSER_PORT/json.htm?type=command¶m=switchlight&idx=$RIDX&switchcmd=On"
fi
exit
Rgds; Jesper.