Skip to content

Communicate between your phone and ESP8266 using a magnet, reedcontact and Telegram bot

Notifications You must be signed in to change notification settings

Funhobbyprojects/TelegramDoorEvents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

TelegramDoorEvents

With this project you will receive a notification on your phone as soon as your frontdoor is being locked or unlocked. The other way around you can type a command in your phone, after which you will receive an answer with the current status of your frontdoor (locked or unlocked). The project also includes a red and green LED which show the current status of your frontdoor so you can see if it's locked or not just by looking at it. You can also choose to turn off the LEDs or notifications by phone.

The architecture in short: the project is built around an ESP8266, a magnet and reedcontact in your frontdoor and a Telegram bot on your phone.

Demonstration

TelegramDoorEvents

Here is an example of the input/output in your Telegram Bot, where you see some notifications of events which occured and some commands and answers. My bot is called Frontdoor. You can name it any name you like.

alt text

Parts

  • ESP8266 (I used a clone NodeMCU)
  • Magnet
  • Reedcontact
  • some electro components
  • Phone

Software

Closeups

My ESP8266 on a board with other components:

alt text

The reedcontact in the closing bowl:

alt text

The magnet glued onto the deadbolt:

alt text

Software details

As for the WiFi connection. Enter your router's credentials on the place of the ***.

Hereby a disclaimer for the (in)secure connection! In my project I used this code:

client.setInsecure();

This line makes it possible to get a HTTPS-connection without having to flash a new certificate or fingerprint to the ESP every time it changes. I know it's not adviceable but it's sooooo easy and for the simple purpose of this project I'm not too worried things will go wrong.

As for Telegram: you will need to install the Telegram app on your phone. Once you've done that, create a bot. That's fairly easy to do. When you have created the bot you will need the bot token and the chat id. The BotFather knows it all. You will need to enter both credentials in the project's code on the place of the ***.

As for the project code: I grabbed lines of code from all over the web. So definately not all code is mine!

About

Communicate between your phone and ESP8266 using a magnet, reedcontact and Telegram bot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages