DEV Community

I.K
I.K

Posted on

Rain Alert: A Voice Bot That Warns You Before Rain Catches You Off Guard

This is a submission for Weekend Challenge: Passion Edition

What I Built

Rain Alert is a Telegram voice bot that watches the minute-by-minute rain
forecast for your exact location and — before rain actually starts — sends
you a spoken voice note telling you exactly what to do:

Inside? "Close your windows, grab an umbrella if you're heading out."
Outside? "Get inside now" or "head in soon," depending on how many
minutes you actually have.

No app to check, no refreshing a weather widget. You share your location
once, tell the bot whether you're inside or outside, and it does the rest —
running quietly in the background and only speaking up when it actually
matters.

Demo

Bot QR Code

Code

Rain Alert Voice Bot

A background Telegram bot that watches the minute-by-minute rain forecast and, when rain is about to start, sends you a spoken voice note telling you what to do — grab an umbrella, close your windows, get inside, or run — depending on whether you're currently indoors or out.

Built for DEV's Weekend Challenge: Passion Edition (ElevenLabs prize category).

Why this exists

Built out of genuine frustration with daily rain and constantly having to check the sky or a weather app. This runs on its own and pings you with a voice note instead.




How I Built It

  1. OpenWeatherMap's One Call API 4.0 gives a true minute-by-minute precipitation forecast — not just hourly buckets — so the bot can tell you rain is coming in exactly 7 minutes, not "sometime this hour."
  2. The bot scans that forecast on a schedule, entirely in the background — no command needed to trigger a check.
  3. When rain crosses the threshold within the lookahead window, it builds a short message tailored to whether you're inside or outside.
  4. ElevenLabs turns that message into a natural-sounding spoken voice note in real time.
  5. Telegram delivers it straight to your phone or desktop as a push notification — with a distinct, unmistakable heads-up ping so a real alert never gets lost among routine chatter.

Tech stack

  • Python — core bot logic
  • python-telegram-bot — chat interface, commands, location sharing, voice delivery
  • OpenWeatherMap One Call API 4.0 — minute-by-minute precipitation data
  • ElevenLabs API (official SDK) — text-to-speech voice generation
  • APScheduler — background polling, no manual trigger required
  • pytest — 19 tests covering rain-detection logic, alert wording, and integrations
  • Docker — containerized for easy deployment
  • GitHub Actions — CI running the full test suite and a Docker build on every push

Prize Categories

Best Use of ElevenLabs

Worked Solo

Top comments (0)