Serverless Telegram Bot with Zapier: turn your IP camera into a Telegram Bot

edit: with the same approach I built a Telegram channel that publish updates from The Coding Love using RSS and Zapier.

Yesterday a DBPOWER VA033K landed inside a friend’s garage. The camera itself is nothing special, but it’s very cheap and can send emails when it detects motion.

So… emails are good… Telegram’s Bots are cool!

We didn’t want to write a single line of code for that and we do not want to manage anything.

In Zapier we found the answer: Email by Zapier and Webhooks by Zapier.

Email by Zapier gives you the ability to use an email as trigger for a Zap.

Webhooks by Zapier makes it easy to call Telegram Bot API.

Let’s go!

  1. Create a Telegram Bot with the Botfather and add a command to it
  2. Send a command to the new Bot
  3. With curl use the Telegram API method “getUpdates” to get the chat_id of the room where you’ll send a command to the new Bot
  4. Create the Zap, and in the Webhook GET action insert the URL for Telegram API method “sendMessage” with chat_id and text parameters
  5. Setup the IP camera so that it sends emails to the Zapier email adress generated during the Zap creation process when it detects motion

After that we were feeling like Gods and we goggled “telegram Bot with Zapier”, just to know that we were the first to do that… we discovered that http://paquebot.io/ exists, for everything else…