jump to navigation

How to reuse your old Raspberry Pi as a Telegram-controlled Alarm Clock – AlarmPi August 14, 2017

Posted by GuySoft in diy, Electronics, open source, programming, python, Uncategorized.
Tags: , , , ,
RaspberryPi Alarm clock

RaspberryPi alarm clock

Hey all,

So do you have a RaspberryPi not doing anything at home? Got that 2GB class 4 SD card that you just don’t know what to do with it? Well this guide is for you! It will let you turn your Pi in to an IOT alarm clock, no code, no complicated commands, just flash, edit two text files and you are good to go. The alarm clock is controlled from Telegram, so you can set it and turn it off from your smartphone. I find that usually using my phone wakes me up. So it’s useful for me. You can also edit the alarm and use any mp3 file you want.
The code is all available in github. AlarmBot is the Telegram Bot. An AlarmPi is the distro (built with CustomPiOS yet again).

Steps to install

  1. Download the image here
  2. Unzip and flash it to an SD card (small enough to fit a 2GB card)
  3. While it downloads and flashes, let’s create a telegram bot and get a token for it!
    1. Send a message to bot father
    2. Send /newbot

      Setting a new bot

      Setting a new bot

    3. Copy the telegram token that is in the last message
  4. Open newly flashed image and edit two files, one for the wifi, and one for the bot token:
    1. Put in alarmpi-wpa-supplicant.txt your wifi address (skip if using Ethernet cable). Here is how it should look:
    2. In config.ini,  paste the newly created bot token from step 3. This is where the token goes:
    3. optionally, you can change the alarm.mp3 file to the sound of your choice.
  5. Boot your pi and connect it to speakers, wait a bit, because it will reboot internally twice. And send /start to your bot.
  6. You’re done! Let’s see how we can set alarm with telegram!

How to use the telegram bot

Once you got a reply to /start and you know the bot is working you can use “/help” to list all the available commands.

First, set the /timezone to your location, and make sure you can see the correct time with the /time command.

Now let’s set an alarm, type /new and you will get the option to pick an alarm that works daily or weekly (code contributions would be great to add more types of alarms).


Once you have alarms, you can manage them in the /list command.


You can disable, or delete commands using this menu. Selecting the bell will disable it, the X will delete an alarm, pressing on the alarm names would close the table.

To stop an alarm that is going, send /stop to the bot.

You can test the alarm using the /test command.

There is no reason why any Pi on earth should not be doing something

So this AlarmPi distro is usable, it lets you burn and flash a device within minutes and make it useful instead of lying and collecting dust in your house. The reason people are not using Pis is because making them do something requires “a guide”, aka list of instructions you are probably going to get wrong to do something simple. Building something as robust as this would take hours, and would be hell to maintain and receive code contributions. But AlarmPi is easy to read and modify. There is a repo for the bot, and a repo for the distro. If a new rapsberrypi comes out and there is a new Raspbian, all you got to do is rebuild and release. No manual editing. And takes less time to build and supports over 40 devices already which run Armbian.

The code base of AlarmBot lets you control crontabs, it could be used for controlling

As always, code contribute are appreciated!


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: