Skip to content

Telegram Alerts

Chieh-Min Wang edited this page Nov 23, 2026 · 5 revisions

Telegram Alerts

Languages: English | 繁體中文

Receive instant air-quality push alerts and recovery messages on your phone directly from your Stuffy Meter — no cloud account or extra server required.

Example Stuffy Meter Telegram air-quality alert notification

Step-by-Step Setup

  1. Create a bot: open Telegram, message @BotFather, send /newbot, choose a name and username, and copy the Bot token (e.g. 123456789:AAH...).
  2. Start a chat with your bot: open your new bot in Telegram and tap Start (or add the bot to a family group).
  3. Find your Chat ID: message @userinfobot in Telegram to see your numeric user ID (or add it to a group / use @yourchannel for a public channel).
  4. Configure your monitor: open your Stuffy Meter web dashboard -> Settings > Telegram alerts:
    • Turn on Enable Telegram alerts.
    • Paste your Bot token and Chat ID.
    • Optionally customize CO₂ alert threshold, VOC alert threshold (0 uses your main Bad threshold), and Alert cooldown (minimum minutes between repeated alerts; default 60).
    • Optionally turn on Bot /status command if you want to send /status in Telegram anytime to check live readings.
  5. Save & test: click Save, then click Send test message.

Telegram alert settings

Tip: Set Language (繁體中文 or English) and Device name (e.g. Living Room or 客廳) under Settings > System so every Telegram alert clearly names the room in your preferred language.

Telegram push notifications

Configured through the telegram settings group (tg_enabled, tg_url, tg_token, tg_chat_id, tg_co2_ppm, tg_voc, tg_cooldown, tg_cmd). When tg_enabled is on, the monitor sends an HTTPS POST to <tg_url>/bot<tg_token>/sendMessage (or directly to tg_url when tg_token is empty and tg_url includes a path for a custom webhook/proxy) whenever CO2 or VOC reaches the configured threshold (0 falls back to co2_t3 / voc_t3). Repeated alerts while air quality remains bad are rate-limited to tg_cooldown minutes (default 60), and one recovery message is sent once readings drop below threshold hysteresis (50 ppm CO2 / 15 VOC index). When tg_cmd is enabled (off by default to save RAM and power), the monitor short-polls getUpdates (every 15 s on USB, 30 s on battery, paused during OTA) and replies with the current air quality readings whenever /status (or /status@<bot>) is received from tg_chat_id. Use POST /api/telegram/test (admin) to verify delivery; it returns 200 {"ok":true}, 400 if tg_url/tg_token/tg_chat_id is missing, 409 if another send or OTA is running, or 502/503 with the Telegram error description on delivery failure.

Clone this wiki locally